-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove encryption of empty props to allow server island cacheability (#…
…12956) * tests for cacheable server islands with no props * changeset * allow server islands to omit encrypted props when they do not have any props * prod and dev tests
- Loading branch information
Showing
6 changed files
with
95 additions
and
2 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,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Removes encryption of empty props to allow server island cacheability |
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
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/server-islands/ssr/src/components/ComponentWithProps.astro
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,11 @@ | ||
--- | ||
await new Promise(resolve => setTimeout(resolve, 1)); | ||
Astro.response.headers.set('X-Works', 'true'); | ||
export type Props = { | ||
greeting?: string; | ||
}; | ||
const greeting = Astro.props?.greeting ? Astro.props.greeting : 'default greeting'; | ||
--- | ||
<div id="islandContent"> | ||
<div id="greeting">{greeting}</div> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/server-islands/ssr/src/pages/includeComponentWithProps.astro
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,11 @@ | ||
--- | ||
import ComponentWithProps from '../components/ComponentWithProps.astro'; | ||
--- | ||
<html> | ||
<head> | ||
<title>Testing</title> | ||
</head> | ||
<body> | ||
<ComponentWithProps server:defer greeting="Hello" /> | ||
</body> | ||
</html> |
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