-
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
chore(dx): Improve errors and warnings during Cell prerendering #6206
chore(dx): Improve errors and warnings during Cell prerendering #6206
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit a1088f2. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 14 targets
Sent with 💌 from NxCloud. |
✅ Deploy Preview for redwoodjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Co-authored-by: Tobbe Lundberg <[email protected]>
…9/redwood into fix/cell-prerender-graphql-fallback * 'fix/cell-prerender-graphql-fallback' of github.com:dac09/redwood: Stylistic suggestions Leverage PROJECT_CWD to set cwd in yarn 3 bin "proxies" (redwoodjs#6199) chore(cli): Add additional tests for sdl generator (redwoodjs#6200)
Fair comment. I'll rename! |
@Tobbe any thoughts on how we could add additional tests jest tests to prevent regression on this behaviour? I'm guessing we have to wrap a cell in the provider and render it after giving it a value? |
@dac09 I added to our smoke tests when I added cell prerendering. Maybe add something there that's testing protected queries? Can we add jest tests for the |
Nah - the runPrerender is too involved, and need webpack, etc. to do it. I was thinking more if we could add unit tests that checks the “prerendered” behaviour of createCell (so just in the react world. without all other stuff) |
Ohh, yeah, that'd be pretty easy. Just prep the context with the required data. |
I won't do it in this PR, because I think we need tests for this anyway, but I'll keep it on my list for later |
What does this PR do?
Better error when there's a routeHook error
![Routehook error](https://user-images.githubusercontent.com/1521877/184356240-43689c51-af82-485f-a2b6-9e8a2c5e37c4.png)
Better error when using a a protected query in a cell that is being prerendered
![Protected query-2](https://user-images.githubusercontent.com/1521877/184356265-cddf05fe-dbb0-4e15-af00-5523ba310241.png)
Only warn when graphql function has been moved, and fallback to Loading state for Cells
Closes #6201