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

Update compiler, tests and examples to use Svelte 5 #233

Closed
wants to merge 10 commits into from

Conversation

Greenheart
Copy link

This is based on findings in #230 (review).

Updating the main devDependencies in package.json to Svelte 5 and re-building the plugin was what I needed to get my app to build properly with Svelte 5.

Also updated tests to work for Svelte 5, as well as type errors in the plugin (due to changed imports and compiler options) and finally updated examples to show usage with Svelte 5 (since mounting a Svelte component will be a breaking change compared to Svelte 4).

fixes #232

@EMH333 EMH333 self-requested a review May 18, 2024 00:53
@@ -202,7 +201,7 @@ export default function sveltePlugin(options?: esbuildSvelteOptions): Plugin {
dependencyModifcationTimes.set(args.path, statSync(args.path).mtime); // add the target file

let compilerOptions = {
css: (svelteVersion < 3 ? false : "external") as boolean | "external",
css: (svelteVersion < 3 ? undefined : "external") as CompileOptions["css"],
Copy link
Owner

@EMH333 EMH333 May 18, 2024

Choose a reason for hiding this comment

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

After looking at this a bit more, I'm fairly sure this logic is broken for everything between Svelte 3.43.0 and 3.53.0 (when support for "external" was added). And actually, false is never returned at all since the version lock requires Svelte >3.43.0. Fun.

Probably not a huge deal, but all the more reason to tear it out soon!

@EMH333 EMH333 deleted the branch EMH333:svelte-5-compat May 19, 2024 18:03
@EMH333 EMH333 closed this May 19, 2024
@EMH333
Copy link
Owner

EMH333 commented May 19, 2024

Whoops! Could you reopen or create a new PR pointing at main please? I definitely want to use this as a start for the changes coming in v1.0.0

@EMH333 EMH333 mentioned this pull request May 21, 2024
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.

None yet

2 participants