Patch Changes
- ade599a: The Rust compiler core exports
compile_program, an entry point that compiles an OxcProgramthe caller has already built instead of source text. It iscompilewith the parse step split off: the program goes through the samedom/ssr/universal/dynamicback ends, with the samerequireImportSourcegate and coverage-pragma handling, so a frontend that produces an AST (rather than projecting to JSX text) gets the shared lowering and source maps on its own authored positions.sourcemust be the program'ssource_text. Additive and Rust-only:compileand the Nodetransform()are unchanged (the shared back half is factored out ofcompile_inner; the TSRX route reaches it with its extracted stylesheet as before). - 838b74b: The Rust compiler core exports TSRX's scoped-CSS engine as
solidjs_compiler::style, moved fromsrc/tsrx/style/tosrc/style/so it is available without thetsrxfeature:compile_style,compile_style_with_class_map_selectors, and their input and output types (StyleInput,StyleLocation,StyleKind,Element,ElementKind,ElementChild,Attribute,AttributeValue,StyleOutput,ClassMapEntry,StyleError). The engine already had no dependency on the TSRX frontend; exporting it lets another frontend (one that does not use TSRX at all) scope a<style>block over its own elements and get the same stylesheet and hash a.tsrxfile gets. Additive and Rust-only: the TSRX route and the Nodetransform()are unchanged. - b989693: Numbers inlined into templates now print the way JS
String(number)does, as Babel's output does. Before, any whole number of 2^63 or more saturated to9223372036854775807, and very large or very small values never switched to exponent form. Now{1e21}prints1e+21,{1e19}prints10000000000000000000and{1e-7}prints1e-7. A child hole now also folds-,*and/the way an attribute does, so<div>{1 / 0}</div>putsInfinityin the template instead of inserting1 / 0at runtime (#4322). - 0c6db49: The secondary passes (
transformDirectives, the lazy and refresh passes, source names) accept a filename with any extension. They run on code that is already lowered to JavaScript, so the filename is metadata rather than a parser choice: a known extension still picks its dialect, and any other (App.rx, from another front end) is parsed as TSX instead of failing with "Unknown file extension". This matters for server functions, whose IDs hash the filename: a front end can now pass the module's real path, so the ID matches the onemoduleForFunctionIdcomputes for that module. The JSX transform itself is unchanged. - 9e1edbc: A lone dynamic spread on an SSR element (
<label {...props()} />) now defers behind a thunk like a spread beside other attributes, so it runs after the element's hydration key. A spread that created a memo shifted the element's key on the server only, and hydration missed the element (#4240). - 4b836ab: Validate SSR templates rooted at an SVG or MathML element (such as
<image>or<g>under control flow, in a fragment, or as a component root) inside their<svg>/<math>owner, as DOM templates already are, so valid SVG partials no longer fail thevalidatecheck.