feat!: consolidate diagnostic codes; sourceNames follows dev in both compilers - #3646
Conversation
🦋 Changeset detectedLatest commit: f9ad287 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will not alter performance
Comparing Footnotes
|
|
…compilers Diagnostic codes: - HUGE_FAN_OUT absorbs WIDE_WRITE; the write-side attribution now ships as `data.write` on the same code, and the engine emits it directly. - SERVER_ERROR_SANITIZED replaces SERVER_FN_ERROR_SANITIZED and SSR_ERROR_SANITIZED, distinguished by `data.source`. - SSR_BOUNDARY_WATERFALL split out of ASYNC_WATERFALL (which drops `data.side`). - AttributionOptions.wideWrites renamed to fanOut (`number | false`, default 250); new FanOutWrite type. Compilers: - `sourceNames` defaults to `dev` in both @solidjs/babel-plugin and @solidjs/compiler; object-form kinds default to `dev`; dev SSR keeps `createComponent` naming. - Primitive naming stays with the native standalone pass; neither JSX compiler exposes a `primitives` key. Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Vitest compiles with `dev: true`, and `sourceNames` now follows `dev` in both compilers. For SSR output that keeps `createComponent(Comp, props, "Name")` in place of the inlined `Comp(props)`, so the from-source (dev) server runtime runs every component under a labelled transparent owner — `observedComponent`: pool pop + field reset, `<Name>` string, closure, try/finally per component instance. CodSpeed priced that at +24% on `search-results: 50 items (renderToString)` and +5.9% on `polymorphic-chain: chain-static` (~1000 component owners per render); the remaining two deltas in the report touch benches with a single component per render and are runtime-environment noise. That owner is the diagnostics tier's cost, not the SSR runtime cost this lane tracks. `vite.config.server-bench.mjs` now sets `sourceNames: false` explicitly so the lane keeps measuring the production component shape it measured before the default followed `dev`. The compilers' default is unchanged; the bench lane only measures what it did on `next`. Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
6aaa3df to
f9ad287
Compare
Coverage Report for CI Build 36097105774Coverage decreased (-0.05%) to 73.084%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Fourth PR of the public-API consolidation. Two legs.
Leg A — diagnostic codes
Codes are public API (Sentry fingerprint roots). Three consolidations, zero stale references outside
CHANGELOG.mdand the historical.changeset/*.mdentries.dataWIDE_WRITE(engine,wideWritesthreshold) +HUGE_FAN_OUT(core, 2000)HUGE_FAN_OUT— one code, one threshold storygraphwarn{ count }from the core;{ count, write: "write" | "refresh" | "async" }from the engineSERVER_FN_ERROR_SANITIZEDSERVER_ERROR_SANITIZEDssrerror{ source: "server-function", error, wire }SSR_ERROR_SANITIZEDSERVER_ERROR_SANITIZEDssrinfo{ source: "ssr", error, wire }ASYNC_WATERFALL(data.side: "server")SSR_BOUNDARY_WATERFALLssrinfo(2 waits) /warn(3+){ boundary, passes, sequentialMs }noteFanOut,packages/signals/src/core/dev.ts) is the single emitter; the attribution engine'scheckFanOut(attribution.ts,stampWritefunnel) calls it from its lowerfanOutthreshold (default 250) and hands over atGRAPH_SIZE_WARN_AT(2000) so one change never carries two findings. Both share thegraphSizeWarnedAtdedupe (re-warn after +500). One message text; the engine's finding addsdata.write.WIDE_WRITE's doubling policy anddata.subscribersare gone.record()inpackages/solid/src/server/signals.ts(SSR road,info) andsanitizeServerErrorinpackages/web/server-functions/src/server.ts(server-function road,error). Severity carries the road;data.sourcenames it.devCheckinpackages/solid/src/server/hydration.ts, off the<Loading>boundary record'spasses.ASYNC_WATERFALLis the client's graph-proven sequential-flights verdict again, only.Guide anchors: RFC 08
#### HUGE_FAN_OUT,#### SERVER_ERROR_SANITIZED,#### SSR_BOUNDARY_WATERFALL;packages/solid/skills/reactivity-diagnostics/SKILL.md### HUGE_FAN_OUT/### SERVER_ERROR_SANITIZED/### SSR_BOUNDARY_WATERFALL;packages/diagnostics/skills/agent-loops/SKILL.mdupdated; RFC 10/12 link#server_error_sanitized.Leg B —
sourceNamesparity and dev defaultsourceNames?: boolean | { components?: boolean; bindings?: boolean }and resolve it identically: unset → every kind isdev; boolean → every kind; object → each unspecified kind isdev.devisPluginConfig.dev(Babel) /TransformOptions.dev(native, resolved innode_adapter.rs::core_options; the Rust coreSourceNamesstays explicit,Defaultall-off).dev: false) is byte-identical with the option set or unset — asserted inpackages/compiler/__tests__/transform.test.jsandpackages/babel-plugin/test/dom-source-names.spec.json the same source; the existing prod fixture suites are unchanged.__dom_hydratable_dev_fixtures__/walkValidation(Babel) and__tests__/fixtures/dom-hydratable-dev/walkValidation(native) now carryspan.children-style insert names; the parity harness (dom-hydratable-devmode) passes.components(DOM + SSR) andbindings(DOM only) with the same shape.transformSourceNamespass, which the build tool runs on every module independently of the JSX compiler (solid-vite-plugin #371,solid: { sourceNames }). No Babel counterpart; READMEs,types.d.ts,config.rsdocs and RFC 08 say so.Public API changes
Diagnostic codes (
@solidjs/signalsDiagnosticCode; emitters insolid-jsserver,@solidjs/web/server-functions)WIDE_WRITE,SERVER_FN_ERROR_SANITIZED,SSR_ERROR_SANITIZED.SERVER_ERROR_SANITIZED(kindssr;errorfrom the server-function wire,infofrom the SSR wire;data: { source: "ssr" | "server-function", error, wire }),SSR_BOUNDARY_WATERFALL(kindssr;info/warn;data: { boundary, passes, sequentialMs }).HUGE_FAN_OUTnow also fires from the attribution engine atfanOut;data.write?: "write" | "refresh" | "async"added;data.countunchanged.ASYNC_WATERFALLno longer has a server variant;data.sideis gone.AttributionOptions.wideWrites→AttributionOptions.fanOut(number | false, default 250;checks: falsefolds it) —packages/signals/src/core/attribution.ts, re-exported throughsolid-js/attribution.FanOutWriteinpackages/signals/src/core/dev.ts.Compilers
@solidjs/babel-pluginPluginConfig.sourceNamesis now optional and defaults todev(wasfalse); in the object form each unspecified kind defaults todev(wasfalse). Dev builds now emitcreateComponent(Comp, props, "Comp")and binding-effect names by default; SSR dev output keeps thecreateComponentcall it previously inlined.@solidjs/compilerTransformOptions.sourceNamesdefaults todev(wasfalse); object form as above.SourceNames::all(bool)added to the Rust core.primitiveskey on either JSX compiler.Size
scripts/sizegzip, merge-basedcca7d46e→ branch: every prod scenario ±0;app: CSR, observe tier17677 → 17666 (−11);observe tier + attribution engine31686 → 31607 (−79). All limits pass.Verification
@solidjs/signals,solid-js,@solidjs/web(client,vite.config.server.mjs,vite.config.hydrate.mjs),@solidjs/diagnostics,@solidjs/babel-plugin(typecheck + build + vitest),@solidjs/compiler(cargo test×3 feature sets + native debug build + vitest incl. parity) all green;pnpm typesand the runtime packages'test-types/typecheckclean.Rebased onto
nextat 78523bf (#3640, #3641; clean, no conflicts). Post-rebase:pnpm types,@solidjs/signals,solid-js,@solidjs/webclient +vite.config.server.mjsre-run green (after rebuildingpackages/webso the framesdistartifacts those upstream tests read are current).Follow-ups
sourceNames(components/bindings, defaulting todev) and the native standalonetransformSourceNamespass for primitives. It should readsolid: { sourceNames }and forward the JSX-level keys to the compiler and the primitive naming to the standalone pass; noprimitiveskey exists on either JSX compiler.WIDE_WRITE,SERVER_FN_ERROR_SANITIZED,SSR_ERROR_SANITIZED; addSERVER_ERROR_SANITIZED,SSR_BOUNDARY_WATERFALL.