-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(router): Implement routing with Suspense #8392
Conversation
@KrisCoulson this looks like a legit failure. Only happens on build (currently only checking with Webpack). To reproduce: |
@dac09 looking into this today |
All tests from the old router are now passing. There are two things to look into currently we are skipping 1 test that handles page loading delay. We sort of solved this with a temporary fix with release of React 18 but now we are using two Suspense boundaries so we are seeing some regressions. |
There is an issue with prerendering cell content that causes a mismatch. We can fix this issue by storing the cell prerender data in the head of a prerendered page and then prepopulate the apollo cache before page loads. Current limitation is the cache that is being stored on the server during prerender is slightly different then the cache that is used client side. We need to figure out a way to use the same cache object |
I figured out how to actually get pre-render working. We can restore the Apollo cache to preload the data on the initial render this will make sure the first pre-rendered page you go to is server rendered and there are no React errors for mismatched data. Note pre-render isn't actually 100% working on the main branch so this isn't technically Suspense router specific. On thing this does include would be injecting a global variable in the head of pre-rendered pages. We should discuss naming conventions of this variable. and if we want to move forward with this implementation here in the Suspense Router PR or break this out into its own issue. |
d60d966
to
7350273
Compare
447e863
to
3fa68d8
Compare
57f6084
to
545d982
Compare
packages/internal/src/build/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts
Outdated
Show resolved
Hide resolved
packages/internal/src/build/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Kris Coulson <kriscoulson@gmail.com>
Working with @KrisCoulson to pull in the Suspense router into main.
Tasks:
replace
instead of push (e.g. logout then go back)?Spec
type def in utils.ts