build: development server builds for solid-js and @solidjs/web; uniform <entry>.dev.js naming - #3309
Conversation
SSR had no dev build: the only server artifact was built with _SOLID_DEV_
stripped, so the server runtime's dev checks (head/preload descriptor
validation, useHead warnings, the committed-response header guard) never
ran outside the test suite, and the server entries hard-coded their public
dev flags (`DEV = undefined`, `isDev = false`).
- solid-js: dist/server.dev.{js,cjs}; replaceDev(false) on the prod server
build (no gates in src/server yet — insurance for the first one)
- @solidjs/web: dist/server.dev.* and frames/dist/server.dev.*
- exports: `development` nested under worker/deno/node for every server
entry (top-level `development` never matches: `node` precedes it), incl.
the nested frames/package.json stub
- server entries gate DEV / isDev on the same replace as their internals;
solid-js's server DEV is @solidjs/signals' object in dev (the diagnostics
channel), undefined in prod
- tests: dev artifact throws on late header write where prod reports and
drops; isDev true/false per artifact; solid DEV undefined/signals' per
artifact; exports resolution via Node's real resolver under node/worker/
deno ± development, all five server entries flip together
- docs: server dev build plan (P0 done) and production observability sketch
Co-authored-by: Claude via Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The three legacy client dev builds were a bare dist/dev.js (solid-js, @solidjs/web, @solidjs/universal); every entry added since — refresh, server, frames client/server, server-functions server — used <entry>.dev.js. With server dev builds shipping, "dev.js" no longer said which entry it was the dev build of. Rename: solid.dev.*, web.dev.*, universal.dev.*. Exports maps updated; file names are private to the exports map, so only deep imports of dist/dev.js are affected. Signals keeps dev.js vs prod/ (chunked dir for the mangle pass — a restructure, not a rename). The exports resolution test now pins the client pairing under `browser` ± `development` as well. Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Coverage Report for CI Build 34212340599Coverage remained the same at 71.892%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Merging this PR will degrade performance by 29.9%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | merge |
186.8 µs | 293.4 µs | -36.35% |
| ❌ | merge |
266.4 µs | 345.1 µs | -22.81% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing server-dev-build (c07a044) with next (94fe5b4)
The `require` branch of @solidjs/signals' exports had only the prod dist/node.cjs (__DEV__ false). A CJS host that resolved solid-js's dist/server.dev.cjs under `development` therefore required a prod signals and got DEV === undefined from a dev artifact — a lie that goes unnoticed until P1 makes the server emit into DEV.diagnostics. - dist/node.dev.cjs: flat, unmangled twin of dist/dev.js; `development` condition on the `require` branch selects it - signals dist test pins DEV per CJS artifact and equal export surface - web resolution test walks the CJS hops (@solidjs/web -> solid-js -> @solidjs/signals) under `development` and pins all three flipping together - turbo: solid-js#test now depends on solid-js#build — it had no dist-based tests until this branch, so it was the only package whose test task didn't wait for its own build Co-authored-by: Claude via Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: c07a044 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 |
Summary
Step one of the server observability track (plan:
documentation/plans/server-dev-build-plan.md, P0). Three commits.1. Development server builds (
80ff52e1)SSR had no dev build. The only server artifact was built with
_SOLID_DEV_stripped, so the 26 dev gates in@solidjs/web'ssrc/server.ts(head/preload descriptor validation,useHeadwarnings, the committed-response header guard) never ran outside the test suite — and both server entries hard-coded their public dev flags (solid-jsexport const DEV = undefined,@solidjs/webexport const isDev = false).solid-js:dist/server.dev.{js,cjs};replaceDev(false)added to the prod server build (no gates insrc/server/yet — insurance so the first one can't constant-fold into the dev branch in prod, the Production SSR bundle throws on post-commit header writes #2982 failure@solidjs/webshipped with).@solidjs/web:dist/server.dev.*andframes/dist/server.dev.*.exports:developmentnested underworker/deno/nodefor every server entry, including the nestedframes/package.jsonstub. Nesting is required — those conditions precede the top-leveldevelopmentkey, so a top-level entry never matches on a server. Same shape./server-functionsalready used.DEV/isDevon the same_SOLID_DEV_replace as their internals.solid-js's serverDEVis@solidjs/signals'DEVobject in the dev artifact (soDEV.diagnostics.subscribe/capturework server-side — this is the channel P1 emits into) andundefinedin prod. The export-parity test asserted the old hard-codedundefined; it now asserts identity with the client'sDEV.2. Uniform dev artifact naming (
bd22ac83)Every entry added after the originals used
<entry>.dev.js(refresh,server,frames/client,frames/server,server-functions/server); only the three original client entries were a baredist/dev.js. Withdist/server.dev.jsshipping,dev.jsno longer said which entry it was the dev build of. Renamed:solid.dev.*,web.dev.*,universal.dev.*. File names are private to theexportsmap; only deep imports ofdist/dev.jsare affected. Signals keepsdev.jsvsprod/(chunked dir for the mangle pass — a restructure, not a rename).3. Signals development CJS build (
c07a044e)The
requirebranch of@solidjs/signals' exports had only the proddist/node.cjs(__DEV__false). A CJS host resolvingsolid-js'sdist/server.dev.cjsunderdevelopmentwouldrequirea prod signals and getDEV === undefinedfrom a dev artifact — a lie that stays invisible until P1 makes the server emit intoDEV.diagnostics. Addeddist/node.dev.cjs(flat, unmangled twin ofdist/dev.js) behindrequire.development; prod CJS unchanged. Also:solid-js#testnow depends onsolid-js#buildinturbo.json— it had no dist-based tests until this branch, so it was the only package whose test task didn't wait for its own build.Behavior change
Dev SSR hosts that pass the
developmentcondition (Vite dev does by default:ssr.resolve.conditionsis['module', 'node', 'development|production']) now get the dev artifacts. A header write after the response has committed throws with the offending header named, where the production artifact continues toconsole.errorand drop the write. Called out in the changeset.Tests
web/test/server/dist-server-dev-artifact.spec.tsx— dev artifact throws on late header write;isDev === true. Twin of the existing prod spec, which gainsisDev === false. A string scan can't pin this (babel's folding erases the marker either way); the behavior does.solid/test/server/dist-server-artifact.spec.ts—DEVundefined in prod, is signals' object in dev, same export surface.web/test/server/exports-server-conditions.spec.tsx— spawns Node with--conditionsand readsimport.meta.resolve/createRequire().resolve, so Node's real resolver (not a reimplementation) pins that all five server entries flip to.devtogether undernode,worker,deno±development; thatbrowser±developmentpairs the client artifacts; and that the CJS hops@solidjs/web→solid-js→@solidjs/signalsflip together. Catches the key-ordering trap, the rename, and a prod-signals-under-dev-solid mix permanently.signals/tests/dist-cjs-artifacts.test.ts—DEVundefined innode.cjs, live withdiagnosticsinnode.dev.cjs, same export surface.Verified:
@solidjs/signals1590,solid-js588,@solidjs/web712 / 766 / 165,universal43,h61,html192,element10, type tests, prettier.@solidjs/webdist/server.dev.jsis +5.5 KB over prod;solid-js's differs only inDEV.Not in this PR
@solidjs/diagnosticsserver scenario). P1 is unblocked by this PR plus feat(diagnostics): responsiveness attribution — holds, provenance, feedback tables, effect-sync and identity diagnostics #3302.documentation/proposals/production-observability-sketch.mdrides along as the "why" for the track. It is a proposal, not something this PR implements; skip it if you're reviewing the code.Authored with Claude via Cursor.