kit
kit copied to clipboard
chore: remove build step for adapter node
todos:
- [x] check paths work on windows
~~maybe this addresses #10040, not sure~~
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [ ] 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
- [ ] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.
Tests
- [ ] Run the tests with
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
- [ ] 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 beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.
🦋 Changeset detected
Latest commit: 1a6ce3e9e33631f77dd40b5521bed5ae3e07af25
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
@sveltejs/adapter-node | Minor |
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
It doesn't work on windows, what a surprise. But only the sverdle page, whyyyyyyyyyy
Nvm, I'm dum and the server on WSL wasn't killed properly
#10040 could be solved by either reading the files directly from outDir/output/server
Are there any downsides to that?
Alternatively copying them to a folder adjacent to outDir/output/server so that the relative paths stay in the correct location.
But both of those require the adpater to know that the files are in outDir/output/server
Ah, I see you've removed undici
in your latest commit. I was going to ask 'Why does the adapter need that directly? Doesn't it get it via @sveltejs/kit/node/polyfills
?'
I think this is an exciting change. When we were running into the memory leak issue in undici, I remember there was confusion arising from how only bumping the version in Kit wasn't enough to get the fix out to people, because adapter-node was bundling it. That's reason enough alone to stop bundling this, I think.
I see that adapter-cloudflare and adapter-netlify also have build steps. I'm not entirely sure that adapter-cloudflare's is doing, but it looks like adapter-netlify's build step is also bundling @sveltejs/kit/node/polyfills
, so it would be great to also stop bundling that (in another PR).
Also updated it to copy files to an adjacent directory, relative paths in sourcemaps should resolve correctly that way. Which should perhaps fix #10040 , @danieldiekmeier can you link to this PR and check?
@gtm-nayan I linked the latest commit of this PR locally and I can confirm that it no longer creates the .svelte-kit/adapter-node
folder, where the source maps get messed up.
The final source maps in build
seem to be correctly pointing directly to the original source files. (This is probably great news for @Lms24, because then Sentry can remove their code that follows the source maps with sorcery
.)
The final source maps in build seem to be correctly pointing directly to the original source files. (This is probably great news for @Lms24, because then Sentry can remove their code that follows the source maps with sorcery.)
Do you have some additional setup for it? For me the sourcemaps in build still point to the generated files in .svelte-kit
, I guess we could use rollup-plugin-sourcemaps
to merge them, esbuild does it by default in other adapters.
Do you have some additional setup for it?
Sorry, you're right: The additional setup is @sentry/sveltekit
which merges the source maps. (So I guess it's not great news for @Lms24 after all.) Really sorry for the confusion (I'm confused about this whole setup myself.)
Thanks for opening this PR @gtm-nayan! While @danieldiekmeier is right that this PR currently won't let us get rid of our flattening workaround with sorcery
, #10069 would do that 😄
(We'll probably still need to keep it around to support already released Node adapter versions but we're auto-detecting adapters anyway already so we can just distinguish based on versions).
Furthermore, iiuc this PR would fix the incorrect source file paths within the maps which is a welcome change either way.
When is this getting merged? Undici's memory leak is annoying to me
Any chance this could get fixed and remerged? It got reverted and still having problems with source maps not working.
Any chance this could get fixed and remerged? It got reverted and still having problems with source maps not working.
Adding to the noise here since I haven't seen any movement! Source maps are still wonky for sveltekit with adapter-node + sentry and it's making them very hard to use.