fix: inline packages that consume the Solid runtime in dev - #352
Open
brenelz wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 02207d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
Follow-up to a810d09. Inlining solid-js and @solidjs/web fixes every resolution those two perform, and vitefu inlines packages advertising a `solid` export condition. A package that does neither is still external, so Node resolves its own `import "solid-js"` without `development` and loads the production server build while the inlined graph holds the dev one — the same two-instance split, one layer out. @solidjs/meta is the first-party case: no `solid` export condition, so an app rendering <Title> still fails in useContext under solid-js 2.0.0-rc.7 with the core packages already inlined. Classify any package declaring solid-js or @solidjs/web in dependencies or peerDependencies as a semi-framework package: ssr.noExternal without optimizeDeps.exclude, which is right here as they carry no raw Solid components. Gated on replaceDev, so builds are unchanged.
brenelz
force-pushed
the
fix/ssr-inline-solid-consumers
branch
from
September 8, 2026 18:11
bdf2b24 to
02207d9
Compare
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.
Follow-up to a810d09 (#350), rebased onto it. That commit fixes the split for
solid-jsand@solidjs/web; this closes the remaining half.The gap
a810d09 reasons:
@solidjs/metadeclares nosolidexport condition:So it stays external, Node resolves its own
import "solid-js"without thedevelopmentcondition, and it loads the production server build while theinlined graph holds the dev one — the same two
sharedConfigs, one layer out.On
3.0.0-next.40an app that renders a<Title>still dies:It generalises past first-party packages: any component library or helper that
imports
solid-jswithout advertising asolidcondition splits the runtimethe same way.
The change
vitefu's semi-framework class is the right bucket —
ssr.noExternalwithoutoptimizeDeps.exclude, since these carry no raw Solid components:Gated on
replaceDev, so builds are unchanged. It composes with a810d09 ratherthan replacing it: that commit still covers the two core packages directly,
including the case where a consumer is absent.
Verified
A start-mode app (
start+ssr: true, file routes, server functions,@solidjs/meta) on solid-js /@solidjs/web2.0.0-rc.7,@solidjs/router2.0.0-next.21, Vite8.2.2:vite dev3.0.0-next.39lazy() … no asset manifest is set3.0.0-next.40(a810d09)useContextin@solidjs/meta, prod buildnext.40+noExternal: ['@solidjs/meta']by handvite build+vite previewstayed 200 throughout — a build applies nodevelopmentcondition, so nothing splits there. Tested with this branch'sbuilt
dist/esm/index.mjsdropped into that app with nossr.noExternalin itsown config.
pnpm build(rollup +tsc --emitDeclarationOnly) is clean.No regression test added — the suites run examples end to end and I could not
tell where a two-instance assertion belongs.
examples/ssrandexamples/css-matrixwould only catch this with a@solidjs/metadependency inthe fixture; happy to add that if it is the right shape.