Skip to content

build: development server builds for solid-js and @solidjs/web; uniform <entry>.dev.js naming - #3309

Merged
ryansolid merged 3 commits into
nextfrom
server-dev-build
Sep 8, 2026
Merged

build: development server builds for solid-js and @solidjs/web; uniform <entry>.dev.js naming#3309
ryansolid merged 3 commits into
nextfrom
server-dev-build

Conversation

@ryansolid

@ryansolid ryansolid commented Sep 8, 2026

Copy link
Copy Markdown
Member

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's src/server.ts (head/preload descriptor validation, useHead warnings, the committed-response header guard) never ran outside the test suite — and both server entries hard-coded their public dev flags (solid-js export const DEV = undefined, @solidjs/web export const isDev = false).

  • solid-js: dist/server.dev.{js,cjs}; replaceDev(false) added to the prod server build (no gates in src/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/web shipped with).
  • @solidjs/web: dist/server.dev.* and frames/dist/server.dev.*.
  • exports: development nested under worker/deno/node for every server entry, including the nested frames/package.json stub. Nesting is required — those conditions precede the top-level development key, so a top-level entry never matches on a server. Same shape ./server-functions already used.
  • Server entries now gate DEV / isDev on the same _SOLID_DEV_ replace as their internals. solid-js's server DEV is @solidjs/signals' DEV object in the dev artifact (so DEV.diagnostics.subscribe/capture work server-side — this is the channel P1 emits into) and undefined in prod. The export-parity test asserted the old hard-coded undefined; it now asserts identity with the client's DEV.

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 bare dist/dev.js. With dist/server.dev.js shipping, dev.js no longer said which entry it was the dev build of. Renamed: solid.dev.*, web.dev.*, universal.dev.*. File names are private to the exports map; 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).

3. Signals development CJS build (c07a044e)

The require branch of @solidjs/signals' exports had only the prod dist/node.cjs (__DEV__ false). A CJS host resolving solid-js's dist/server.dev.cjs under development would require a prod signals and get DEV === undefined from a dev artifact — a lie that stays invisible until P1 makes the server emit into DEV.diagnostics. Added dist/node.dev.cjs (flat, unmangled twin of dist/dev.js) behind require.development; prod CJS unchanged. Also: solid-js#test now depends on solid-js#build in turbo.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 development condition (Vite dev does by default: ssr.resolve.conditions is ['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 to console.error and 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 gains isDev === 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.tsDEV undefined in prod, is signals' object in dev, same export surface.
  • web/test/server/exports-server-conditions.spec.tsx — spawns Node with --conditions and reads import.meta.resolve / createRequire().resolve, so Node's real resolver (not a reimplementation) pins that all five server entries flip to .dev together under node, worker, deno ± development; that browser ± development pairs the client artifacts; and that the CJS hops @solidjs/websolid-js@solidjs/signals flip together. Catches the key-ordering trap, the rename, and a prod-signals-under-dev-solid mix permanently.
  • signals/tests/dist-cjs-artifacts.test.tsDEV undefined in node.cjs, live with diagnostics in node.dev.cjs, same export surface.

Verified: @solidjs/signals 1590, solid-js 588, @solidjs/web 712 / 766 / 165, universal 43, h 61, html 192, element 10, type tests, prettier. @solidjs/web dist/server.dev.js is +5.5 KB over prod; solid-js's differs only in DEV.

Not in this PR


Authored with Claude via Cursor.

ryansolid and others added 2 commits September 8, 2026 01:21
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>
@coveralls

coveralls commented Sep 8, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34212340599

Coverage remained the same at 71.892%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1002
Covered Lines: 768
Line Coverage: 76.65%
Relevant Branches: 784
Covered Branches: 516
Branch Coverage: 65.82%
Branches in Coverage %: Yes
Coverage Strength: 14.99 hits per line

💛 - Coveralls

@codspeed-hq

codspeed-hq Bot commented Sep 8, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 29.9%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 2 regressed benchmarks
✅ 140 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

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-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c07a044

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
solid-js Patch
@solidjs/web Patch
@solidjs/universal Patch
@solidjs/signals Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch

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

@ryansolid
ryansolid merged commit 73ad22e into next Sep 8, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants