Skip to content

chore: get rid of class-replacement hack #13664

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

Merged
merged 2 commits into from
Apr 3, 2025
Merged

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Apr 2, 2025

We previously used a grotesque hack that would ensure the HttpError etc classes would be the same between what Vite imports via its transformation toolchain and what you get from a regular node import.

Turns out we don't need that anymore - since #9242 SvelteKit is guaranteed to always be loaded through the Vite toolchain.

This investigation was triggered by vitest-dev/vitest#7783 - removing this might alleviate the pressure on Vitest, though we still do some vite.ssrLoadModule suspicously close to the configureServer hook, so we'll see.

At first thought we can leverage the imports map of the package.json instead. Through that, Vite would (hopefully?) not load these into its own toolchain, instead defer to the regular node loader to get the module. But then I realized it changed nothing, which lead me to discover this even simpler solution

Copy link

changeset-bot bot commented Apr 2, 2025

🦋 Changeset detected

Latest commit: 8718b5a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@dummdidumm dummdidumm force-pushed the get-rid-of-class-assign-hack branch from 1d81c98 to 8b019e5 Compare April 2, 2025 09:09
@dummdidumm dummdidumm force-pushed the get-rid-of-class-assign-hack branch from 086996f to 6926b2e Compare April 2, 2025 11:27
@dummdidumm dummdidumm merged commit 7fd7bcb into main Apr 3, 2025
16 checks passed
@dummdidumm dummdidumm deleted the get-rid-of-class-assign-hack branch April 3, 2025 12:19
@github-actions github-actions bot mentioned this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants