-
Notifications
You must be signed in to change notification settings - Fork 324
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
Consume RSC response in the server #463
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
57bb5f0
wip: Create custom flight renderer with local version of react-server
frandiox 7ed7a73
wip: mock client manifest and add module reference to client components
frandiox e1eba5f
wip: hack RSC resolution
frandiox a119de6
wip: wrap component in Proxy to access original properties
frandiox 46c9e06
refactor: rename RSC server files
frandiox 31a1d58
wip: add official RSC hydrator
frandiox 0bada32
fix: Rename response.readRoot and remove explicit hydration
frandiox a498942
wip: remove RR and Helmet providers from the server
frandiox 4bdac0f
wip: Add test app
frandiox 7406bf2
wip: remove hydration providers
frandiox 81e4548
wip: add renderToReadableStream for RSC
frandiox 2640a8c
refactor: cleanup custom RSC code
frandiox 46dea47
refactor: move and rename files
frandiox f7f6b51
wip: fix test app
frandiox 2019a6e
refactor: cleanup custom RSC code
frandiox fc7c30d
refactor: do not pass named boolean in RSC
frandiox 593e6e6
refactor: simplify ClientMarker
frandiox 548b227
test: fix ClientMarker tests
frandiox b5c1674
fix: delay throwing error when client component is missing
frandiox 6c56da7
refactor: simplify import globs code
frandiox 8c30c09
feat: provide request object to rendering tree
frandiox 2837bef
wip: example of useServerRequest
frandiox 00462a9
feat: inline RSC response in the SSR HTML response
frandiox ff72d26
fix: add default value to the SSR provider
frandiox c8e5efb
feat: stream rsc in script tags
frandiox 4a84948
feat: update the starter template to work
blittle 67a11a5
fix: lint errors
blittle 83854c8
refactor: move code around and cleanup
frandiox 2105049
Merge branch 'fd-vite-rsc' into fd-vite-rsc-request-provider
frandiox c8382dd
chore: upgrade Vite to 2.7.0
frandiox 131a99a
chore: add react-server-dom-vite as vendor
frandiox 6e9cbc7
feat: replace local react-server and react-client with react-server-d…
frandiox 2fa783f
fix: react-server-dom-vite allow exporting hooks from client componen…
frandiox 977d8db
Merge branch 'main' into fd-vite-rsc
blittle 01a534d
fix: move the server logging locations
blittle cd59155
feat: Implement ReadableStream branch in SSR and RSC
frandiox 67bc790
test: fix playground apps
frandiox f2fd900
fix: avoid importing undefined exports depending on the running envir…
frandiox 52bdbfe
feat: Buffer RSC response if it cannot be streamed
frandiox b032e80
fix: tests
blittle a4d09e5
fix: e2e test
blittle a4cf4f8
fix: linting
blittle e106036
Merge branch 'main' into fd-vite-rsc
blittle c2ac384
fix: rename test helper
blittle f0b7b3e
fix: update hydrogen template files
blittle ff0088f
feat: remove react-ssr-prepass. RSC already makes ReadableStream requ…
frandiox ad17ac8
refactor: simplify hydration calls
frandiox a60a557
Merge branch 'fd-vite-rsc' of https://github.com/Shopify/hydrogen int…
frandiox 8650188
feat: remove old dependencies
frandiox 7163866
feat: enable tree shaking in worker build
frandiox bcc4bfc
fix: Release stream lock before piping
frandiox 3bf918c
chore: fix formatting
frandiox a89af2c
refactor: move code to entry-server to be consistent
frandiox b32f0f7
refactor: remove HydrationWriter in favor of Node native PassThrough
frandiox 247296e
Merge branch 'fd-vite-rsc' into fd-vite-rsc-request-provider
frandiox 0f25305
fix: move constant to a separate file to avoid importing app logic in…
frandiox 026eb4b
refactor: remove old code
frandiox 990fb66
Merge branch 'fd-vite-rsc' into fd-vite-rsc-request-provider
frandiox e42b297
fix: maybe fix tests for windows
frandiox cd1c9b7
Merge branch 'main' into fd-vite-rsc
frandiox 737944b
fix: stream import in workers
frandiox 6bfb3b9
Merge branch 'fd-vite-rsc' into fd-vite-rsc-request-provider
frandiox b7043ce
fix: flush RSC right after writing head
frandiox 04f20a1
feat: replace RenderCacheProvider with new ServerRequestProvider cache
frandiox bd04b70
refactor: cleanup
frandiox 6f1e8e7
fix: suspense breaking hydration
frandiox c56d374
fix: normalize RSC chunks
frandiox 2548619
Merge pull request #390 from Shopify/fd-vite-rsc-request-provider
frandiox b7fb5fc
refactor: simplify customBody check
frandiox a185166
feat: minor tree-shaking improvements
frandiox da7ddb6
fix: enable browser hydration
frandiox 3862b4d
fix: replace TransformStream with ReadableStream to support Firefox
frandiox 0d7e878
refactor: cleanup and rename variables
frandiox 9c373fd
feat: Make ReadableStream globally available
frandiox 3806f8b
wip: consume RSC response in server
frandiox 593d1db
wip: do not close stream connection
frandiox f7adeb8
chore: Merge branch 'experimental' into fd-vite-rsc-consume-response
jplhomer 2ea3f3a
wip: fix reentrant error with ReadableStreams in RSC
jplhomer fccfd91
fix: import Node RSC logic dynamically
frandiox 8f52e4a
fix: rename Cache.client.js to avoid bundling it in workers build
frandiox d5aef68
fix: add temporary monkey patch for React Fizz in workers build
frandiox d3d64c2
feat: Combine SSR and RSC responses in Node
frandiox 3192734
fix: write RSC before ending response when not streaming
frandiox e17da24
feat: Combine SSR and RSC responses in Worker
frandiox f8b0fc7
feat: Use ReadableStream in CFW and stream if supported
frandiox 1474e15
fix: add another temporary monkey patch for React Fizz/Flight in work…
frandiox d50ffc6
fix: close writable on redirects
frandiox 4c95e02
fix: Fix hydration during dev by using more Suspense boundaries
jplhomer c3290b2
fix: add back response.socket listener
frandiox 6138b03
feat: support script nonce and shorten access to __flight
frandiox ec4d678
feat: avoid writing fractional chunks in SSR
frandiox 48836f3
fix: initialize flight container in buffered rendering
frandiox 8bf6c7b
fix: ensure flight container is added in Node
frandiox c60ed19
refactor: `readable` to `ssrReadable` for clarity
jplhomer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Note: This was the culprit causing issues in Vite dev server for Hydration, on the homepage only. I refactored this to use multiple Suspense boundaries, etc.
Now it breaks in Workers 😭 seeing quite a bit of this with react-helmet-async:
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.
Thanks for the fix!
The only way I can reproduce this is:
If I start from a new tab or just refresh, it seems to work well. I've also deployed it to CFW and works 🤔
Edit: ahh, it is happening randomly in the development server as well...
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.
I could look into this