-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPA Mode #8338
SPA Mode #8338
Conversation
🦋 Changeset detectedLatest commit: 525e424 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
"@remix-run/node" | ||
); | ||
let handler = createNodeRequestHandler(build, mode); | ||
let response = await handler(new Request("http://localhost/")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider the suggestion documented at #7638 (reply in thread) to allow either an index.html or index.js to be generated. It's the smallest change which allows the generation of a Remix App library file that I could think of but maybe the team has better ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still pondering this, but we're going to get this out as an unstable_ssr
flag without this functionality to start. Hopefully that'll let some folks play around with it and we can gather some feedback and continue to evaluate this use case.
if ( | ||
initialPathname !== hydratedPathname && | ||
!window.__remixContext.isSpaMode | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't perform this check in SPA mode since we want to be able to hydrate any URL via route.lazy
// hydration | ||
hydrationData.loaderData[routeId] = null; | ||
let hydrationData = undefined; | ||
if (!window.__remixContext.isSpaMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a whitespace change - we don't have to prep any hydrationData
in SPA mode
) { | ||
return ( | ||
routeModule.clientLoader != null && | ||
(routeModule.clientLoader.hydrate === true || route.hasLoader !== true) | ||
(isSpaMode && route.id !== "root") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never hydrate below the root in SPA mode
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
e0ae523
to
9fff2ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useId test please :)
Todo:
RFC: #7638
Closes: #7639