Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove encryption of empty props to allow server island cacheability #12956

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaytwo
Copy link
Contributor

@kaytwo kaytwo commented Jan 10, 2025

Changes

This change removes the encryption of {} in the case of a server island with no props. Fixes #12949.

Testing

Added two tests: one test that ensures components with props keep getting them re-encrypted, and one where components without props don't have an empty encryption passed through to them.

Docs

Nominally a bugfix, brings the docs mention of caching in line with reality.

Copy link

changeset-bot bot commented Jan 10, 2025

⚠️ No Changeset found

Latest commit: 3ecb6e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 10, 2025
Copy link

codspeed-hq bot commented Jan 10, 2025

CodSpeed Performance Report

Merging #12956 will not alter performance

Comparing kaytwo:main (3ecb6e2) with main (df0c566)

Summary

✅ 6 untouched benchmarks

@ascorbic
Copy link
Contributor

@kaytwo your tests are failing, because fixture.fetch() doesn't work without a runnign server. Those tests will work in dev but not prod. Take a look at how the other dev and prod tests are implemented in that file. It would be good to have tests for both. You can run the tests locally by running node --test packages/astro/test/server-islands.test.js

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test, thank you!

@matthewp
Copy link
Contributor

Can't really tell from the failures what the problem is with your tests. Looks like the fetches are failing, are you fetching in the same way as the other tests?

@matthewp
Copy link
Contributor

Also this needs a changeset which you can add via pnpm changeset.

@ascorbic
Copy link
Contributor

Can't really tell from the failures what the problem is with your tests. Looks like the fetches are failing, are you fetching in the same way as the other tests?

It's making dev server requests in the build tests, where the dev server isn't running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Islands have their props uniquely encrypted even if they have no props, leading to uncacheability
3 participants