Repository navigation
Conversation
…use them The store runtime has import-time state, so the bundler treats each generated store's `extends` as a side effect and hoists every store reachable through the stores barrel, plus its artifact, into one shared chunk. Marking the generated stores and artifacts side-effect free lets them follow the routes that use them.
Production codegen runs with sortKeys off, so the input types and their fields, the abstract type map, and the enum and input-type imports came out in Go's randomized map order. Sort them unconditionally. Selections keep source order, so persisted query hashes don't change.
🦋 Changeset detectedLatest commit: 0715a7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
Contributor
Author
|
I have another branch ready that I intended to stack on this PR, but it turns out stacked PRs don't support cross-fork PRs. Basically the reason for the test-only |
This branch has not been deployed
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.
Generated Svelte stores extend runtime classes that hold import-time state, so the bundler treats every store reachable through the stores barrel file as having side-effects. Every store and its artifact ends up in one shared chunk. This marks the generated stores and artifacts as side-effect free, so each one is split into the route chunk that uses it.
This also makes artifact codegen deterministic. Input types, input fields, abstract type maps, and enum/input imports were emitted in the order they were in within the Go map, resulting in chunk hash changes on every build with no source change. They're now always sorted. Selections stay in source order, so persisted query hashes don't change.
Between these two changes, most of our routes got ~40% smaller on first visit and all chunks names (and cache entries as a result) became stable across builds/deployments.
To help everyone out, please make sure your PR does the following:
pnpm run testsandcd integration && pnpm run testspnpm changeset