-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add config option to disable lazy route discovery #13451
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
Conversation
🦋 Changeset detectedLatest commit: 81ac2da The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
2470cb5
to
1766db9
Compare
version: "", | ||
}, | ||
}; | ||
let context = mockFrameworkContext(); |
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.
Added some helpers for these things so we can add new fields in one spot and not have to go around and touch all tests that mock out a context
import { createRequestHandler } from "../../lib/server-runtime/server"; | ||
import { mockServerBuild } from "./utils"; |
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.
Updated tests to use this existing utility which now includes the routeDiscovery
config
} = {} | ||
) { | ||
): ServerBuild { |
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.
Now strongly typed so we know we have all fields
future: FutureConfig; | ||
ssr: boolean; | ||
isSpaMode: boolean; | ||
export type WindowReactRouterContext = ServerHandoff & { |
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.
Now that we collapsed @remix-run/react
and @remix-run/server-runtime
we can share some of these types better. The window context is exactly the server handoff plus the state/stream stuff we append to it after the fact
// The number of active deferred keys rendered on the server | ||
a?: number; | ||
dev?: { | ||
port?: number; | ||
hmrRuntime?: string; | ||
}; |
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.
Unused in the repo. I believe a
was from the defer
implementation and I think the dev
stuff was from the classic compiler?
let entryContext: EntryContext = { | ||
manifest: build.assets, | ||
routeModules: createEntryRouteModules(build.routes), | ||
staticHandlerContext: context, | ||
criticalCss, | ||
serverHandoffString: createServerHandoffString({ | ||
basename: build.basename, | ||
...baseServerHandoff, | ||
criticalCss, |
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.
criticalCss
is the only thing we add to the handoff on the first render pass
type ValidateShape<T, Shape> = | ||
// If it extends T | ||
T extends Shape | ||
? // and there are no leftover props after removing the base | ||
Exclude<keyof T, keyof Shape> extends never | ||
? // we are good | ||
T | ||
: // otherwise it's either too many or too few props | ||
never | ||
: never; |
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.
No longer needed because state
is never included in the handoff string now - that was leftover from pre-turbo-stream
🤖 Hello there, We just published version Thanks! |
Closes #12656
Closes #12767