- 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