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.
Merge branch 'main' of github.com:redwoodjs/redwood into feat/return-…
…tuples-dbauth-mw * 'main' of github.com:redwoodjs/redwood: fix(deps): update dependency isbot to v5 (redwoodjs#10340) chore(deps): update dependency vscode-languageserver-protocol to v3.17.5 (redwoodjs#10351) chore(deps): update node.js to >=14.17 <=20.13 (redwoodjs#10368) fix(deps): update dependency graphql-sse to v2.5.3 (redwoodjs#10364) chore(deps): update dependency @supabase/supabase-js to v2.43.2 (redwoodjs#10365) chore(deps): update babel monorepo to v7.24.5 (redwoodjs#10614) fix(vite): Rename `serverAuthContext` to `serverAuthState` (redwoodjs#10653) feat(middleware): Add .shortCircuit to MiddlewareResponse (redwoodjs#10586) chore(ssr): Make entry.client.tsx better match standard entry.client (redwoodjs#10652) patch(crwa): Fix small annoyances (formatting, spell-check) (redwoodjs#10651) chore(ci): Update rsc readme (redwoodjs#10650) chore(serverAuth): Rename serverAuthContext to serverAuthState where relevant (redwoodjs#10643) chore(deps): Remove unused deps from prerender (redwoodjs#10649) Add missing rwjs/auth deps (redwoodjs#10648) feat(rsc-auth): Implement serverStore to hold and pass req info to RSC (redwoodjs#10585) chore(deps): Remove unused octokit package (redwoodjs#10645) chore(deps): bump @fastify/reply-from from 9.4.0 to 9.8.0 (redwoodjs#10644)
- Loading branch information
Showing
83 changed files
with
1,060 additions
and
933 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- feat(middleware): Add .shortCircuit to MiddlewareResponse (#10586) by @dac09 | ||
|
||
Adds a helper to generate a intercept/short-circuit response, that will interrupt execution of _all_ middleware and react rendering, and immediately return the response. | ||
|
||
There's a few different ways you can use this, see examples below: | ||
|
||
```ts | ||
const shortCircuitMw: Middleware = (req, res) => { | ||
// A) You can short circuit after building the response (or use the res param) | ||
// This allows you to use all the convenience helpers like cookies of MW Response | ||
if (req.url.includes('create-new-response')) { | ||
const shortCircuitResponse = new MiddlewareResponse('Short-circuiting') | ||
shortCircuitResponse.headers.set('shortCircuit', 'yes') | ||
shortCircuitResponse.cookies.set('shortCircuitCookie', 'do-not-allow', { | ||
expires: new Date(Date.now() + 1000 * 60 * 60), | ||
}) | ||
shortCircuitResponse.shortCircuit() | ||
} | ||
|
||
// B) You can directly construct a new short-circuit response | ||
// (discarding whatever response was built before) | ||
if (req.url.includes('using-existing-res')) { | ||
res.shortCircuit('Short-circuiting directly', { | ||
headers: { shortCircuitDirect: 'yes' }, | ||
}) | ||
} | ||
|
||
} | ||
``` | ||
|
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,9 @@ | ||
- chore(serverAuth): Rename serverAuthContext to serverAuthState where relevant (#10643) by @dac09 | ||
|
||
**Why?** | ||
As we make auth available on RSC, we want to avoid the use of the word "context" | ||
|
||
1. Because context is over used | ||
2. It's confusing because RSCs don't support React.context | ||
|
||
This PR renames `serverAuthContext` -> `serverAuthState`. The only case it doesn't change it is the _actual_ ServerAuthContext which is a React context we use for SSR/Streaming |
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,14 @@ | ||
- patch(crwa): Fix small annoyances (formatting, spell-check) (#10651) by @Tobbe | ||
|
||
cSpell was complaining about "prerendering". I added it to the dictionary in | ||
project workspace settings. This gets rid of the blue squiggles for the RW | ||
project, but not for any user project. I could also have changed it to | ||
"pre-rendering", but we call the feature "prerender", so it didn't feel right | ||
to change it to "pre-rendering". So this will have to do for now. | ||
|
||
Also formatted the source code to me more narrow. | ||
|
||
Honestly this is more of a chore than a fix. But it does affect user projects | ||
(at least new user projects). So I marked it "patch". But no change needed for | ||
existing projects unless they really want (and haven't already done it | ||
themselves). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
"opentelemetry", | ||
"pino", | ||
"Pistorius", | ||
"prerendering", | ||
"redwoodjs", | ||
"rsdw", | ||
"RWJS", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.11.1 | ||
20.13.1 |
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
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.