forked from vercel/next.js
-
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.
Add SRI support for Node.js Runtime (vercel#73891)
> [!NOTE] > This PR is best reviewed with hidden whitespace changes. Support for setting [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) attributes on app router scripts was added in vercel#39729. But this only covered pages using the Edge Runtime. With this PR, we're adding support for app pages using the Node.js Runtime. The only change that's needed for that, and which was probably just an oversight in the original PR, is reading the generated manifest file in `loadComponents`. In a follow-up we should also add support for adding the `integrity` attribute to client component chunks that are injected into the head during server-side rendering, but that needs a change in React first. fixes vercel#66901
- Loading branch information
1 parent
98dc385
commit 56ea9e9
Showing
17 changed files
with
246 additions
and
252 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
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
18 changes: 0 additions & 18 deletions
18
test/production/app-dir/subresource-integrity/fixture/app/dashboard/client-comp-client.jsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/production/app-dir/subresource-integrity/fixture/app/dashboard/client-comp.module.css
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/production/app-dir/subresource-integrity/fixture/app/dashboard/global.css
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
test/production/app-dir/subresource-integrity/fixture/app/dashboard/layout.js
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
test/production/app-dir/subresource-integrity/fixture/app/dashboard/page.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/production/app-dir/subresource-integrity/fixture/app/dashboard/style.css
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/production/app-dir/subresource-integrity/fixture/app/edge/page.tsx
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,3 @@ | ||
export { default } from '../node/page' | ||
|
||
export const runtime = 'edge' |
2 changes: 2 additions & 0 deletions
2
...ubresource-integrity/fixture/app/page.tsx → ...ource-integrity/fixture/app/node/page.tsx
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,3 +1,5 @@ | ||
export const dynamic = 'force-dynamic' | ||
|
||
export default function Page() { | ||
return <p>hello world</p> | ||
} |
Oops, something went wrong.