feat: add support for read in edge environments - #13859
Conversation
🦋 Changeset detectedLatest commit: 3f0328e The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for this PR! Is there any chance you could continue the work from #11674 so that it's implemented in the Netlify and Vercel adapters too? I think if the reusable
I re-ran the test in CI and it passes. Probably just a flaky test that failed. |
|
Ah yes. Sorry I missed Rich's PR in my search. Will look into it. Thanks for the input! |
dc18769 to
6da55ed
Compare
|
@eltigerchino extracted into a
Also, I haven't added I can spawn up some projects in netlify & vercel and do some manual tests, but I feel like i shouldn't block progress here. How about I do that in a separate PR? Thanks |
…t util for server read
|
Thank you!
Yeah, manual testing for those are fine. There is no local environment for Vercel and like you said, Netlify's edge doesn't work locally. |
|
Can this be prioritized? It's very cumbersome to use static assets with Cloudflare with unexpected outcome. Vercel and other can be added later |
dummdidumm
left a comment
There was a problem hiding this comment.
@eltigerchino I found a solution that avoids adding a new export: tweak SvelteKit's read implementation to handle async values. Could you take another look?
(all SvelteKit tests fail currently but it was the only solution to make the adapter tests succed with the checks; annoying interim failures, which is why we should merge and release this in one go)
| ] | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Does Netlify require this or why do we have a deno.lock here? (same for the other test)
There was a problem hiding this comment.
This is a build artifact from running the app with the Netlify CLI. I think it does another bundle at that point. I'll add it to to the .gitignore
Thanks! That's a really nice solution. |
|
I'm happy we have tests for the Netlify adapter now. However, adding |
|
I think eventually we wanna turn these into "deploy to prod, do playwright stuff against prod url" tests. Slower but more reliable and fully replicates the environment |
|
In the meantime I wonder if we could just invoke |
I'm not sure how sirv would work with the Netlify build output. At least in #12296 the CLI's serve is important for testing the split functions functionality with the Netlify middleware. The Environment API integration is still far off, otherwise we could use the Netlify Vite plugin instead. I think Simon's idea might be a lot better and something we can implement sooner. cc: @serhalp |
|
I shared another idea here: e18e/ecosystem-issues#156 (comment) |
closes sveltejs#12446 closes sveltejs#11674 --------- Co-authored-by: Chew Tee Ming <chew.tee.ming@nindatech.com> Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
#15161 fixed a cold-start race in adapter-cloudflare, where a concurrent second request could reach `server.respond` before `server.init` finished. The pattern came from #13859 in all three edge adapters, but only cloudflare got the fix. This applies the same change to the Vercel and Netlify edge entries. --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

closes #12446
closes #11674
This PR helps with the cloudflare part of #12446. Added a test case and I also tested in a project bootstrapped with
create cloudflare@latest. Hope i didn't miss anything 🤞.Thanks all.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits