Omit route components from non-SSR builds when ssr: false#1481
Merged
ryansolid merged 4 commits intosolidjs:mainfrom May 20, 2024
Merged
Omit route components from non-SSR builds when ssr: false#1481ryansolid merged 4 commits intosolidjs:mainfrom
ssr: false#1481ryansolid merged 4 commits intosolidjs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: c904644 The changes in this PR will be included in the next version bump. 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 |
ssr: false
3 tasks
Member
|
That's awesome.. Thank you. I was meaning to look at this and I'm pretty stoked that you applied this optimization. |
Member
|
Hmm.. it breaks the notes demo. It is no longer single flight in SSR false. Which suggests something isn't working the way it should. I will see if I can figure it out in the next 30 mins otherwise moving forward with the release I might have to temporarily revert this. |
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When building with
ssr: false, the ssr + server-fn builds still transform + bundle all of the route components in filesystem routes.This doesn't really make sense, since the ssr build will only ever be used during prerendering, which just renders
entry-server.tsxandapp.tsx, andserver-fnonly invokesAppwithdataOnlyset on the router so none of the route components are actually used.What is the new behavior?
This PR adds a
dataOnlyconfig toSolidStartServerFileRouterwhich makes it omit the default exported component from all routes. Non-default exported components work the same andexport const routeis still included since it's needed on the server for SFM.Other information