forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rsc-auth): Implement serverStore to hold and pass req info to RSC (
redwoodjs#10585) First pass at implementing a per-request store that allows: - access to headers and cookies from requests in server components - access to serverAuthState from server components - maps serverAuthState updated from middleware to the the per request store This PR also implements execution of middleware in the RSC handler. Note that this is done in a "good enough" way currently, because the RSC handler doesn't use Fetch requests (but everything else does) Important things to note: - the store is initialised _again_ in the RSC worker, with the same values on each invocation of renderRsc - we have _not_ tested or tried in Dev because `rw dev` does not work in RSC yet - we have _not_ tested behaviour on initial SSR - because this is not implemented yet in RSC
- Loading branch information
Showing
13 changed files
with
325 additions
and
62 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- feat(rsc-auth): Implement serverStore to hold and pass req info to RSC (#10585) by @dac09 | ||
|
||
First pass at implementing a per-request store that allows: | ||
|
||
- access to headers and cookies from requests in server components | ||
- access to serverAuthState from server components | ||
- maps serverAuthState updated from middleware to the the per request store | ||
|
||
This PR also implements execution of middleware in the RSC handler. Note that this is done in a "good enough" way currently, because the RSC handler doesn't use Fetch requests (but everything else does) | ||
|
||
Important things to note: | ||
- the store is initialised _again_ in the RSC worker, with the same values on each invocation of renderRsc | ||
- we have _not_ tested or tried in Dev because `rw dev` does not work in RSC yet | ||
- we have _not_ tested behaviour on initial SSR - because this is not implemented yet in RSC | ||
|
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
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.