1.20.0 release - #101
Open
ECorreia45 wants to merge 137 commits into
Open
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prepares
@beforesemicolon/markup@1.20.0from thenextbranch. It replaces the renderer internals with a compiled, persistent-part architecture while preserving the documentedhtml, state, effect, lifecycle, ref, helper, and rendering behavior established in 1.19.x.The redesign reduces repeated parsing and DOM discovery, makes reactive ownership explicit, improves list reconciliation, and removes renderer code that is no longer required. It also expands the package-owned documentation used by developers and AI tools.
There are no intentional breaking changes. One additive API,
unsafeHTML, makes deliberate raw-HTML parsing explicit. The legacyhtml(string[])form remains operational for compatibility but is deprecated in favor of the named unsafe boundary.Renderer architecture
Cached compilation and persistent parts
<template>definition.DOM and table parsing
<script>and<style>interpolation behavior.childNodestraversal during insertion.Lists and reconciliation
Reactivity, lifecycle, and refs
HTML safety boundary
Normal
htmltagged-template interpolations remain outside the browser HTML parser. Runtime strings are applied as values, including in standalone table-row content and attributes.This PR adds
unsafeHTML(source)for the deliberate parsing of trusted or independently sanitized markup. User-controlled content must remain in ordinaryhtmlinterpolations and must not be passed tounsafeHTML.The older manually constructed array form, such as
html([source]), remains supported at runtime for compatibility and is now deprecated. Documentation and regression coverage make the distinction explicit and reviewable.Package and build cleanup
ReactiveNode, normalization, dynamic-raw parsing, render-content, andsyncNodesimplementation paths.@beforesemicolon/html-parserruntime dependency.@beforesemicolon/builder2.0.1 with minification-oriented build options.distpublishing layout.typesexport condition correctly.Current package output:
Documentation and AI context
llms.txtwith the API contract, behavioral rules, examples, and ecosystem boundaries.llms-full.txtdocumentation artifact.unsafeHTMLboundary in the README, templating guide, localized content, and AI context.Compatibility coverage
Regression coverage includes:
unsafeHTML.Performance
The renderer was compared with 1.19.1 using 1,000 representative rows on an Apple M3 with Node 24.14.0. Results are medians from seven warmed, alternating paired runs with explicit garbage collection; absolute timings vary by machine.
The deepest filesystem-like standalone teardown remains slower than 1.19.1, but its mount improvement is larger than that cost, leaving the complete cycle faster. The repository benchmark suite completes successfully across repeat bookkeeping, DOM mount/update, and reactive lifecycle scenarios.
Verification
Verification performed on the final implementation:
npm run buildnpm pack --dry-run --jsonnpm run benchmarkunsafeHTML.Review notes
The main review areas are the compiled-part renderer in
src/html.ts, effect ownership insrc/effect-context.tsandsrc/state.ts, repeat rebinding, table-context parsing, and the compatibility regressions consolidated in the existing test suites.