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

Support for Svelte 5 #220

Open
dshook opened this issue Nov 11, 2024 · 5 comments
Open

Support for Svelte 5 #220

dshook opened this issue Nov 11, 2024 · 5 comments
Assignees

Comments

@dshook
Copy link

dshook commented Nov 11, 2024

Hi there, thanks for the project!

The big new version of Svelte came out a few weeks ago and was wondering if there's plans to upgrade to support it.

Looks like svelte-preprocess will need to be upgraded.

I was able to get it working by adding the resolution in package.json

  "resolutions": {
    "svelte-preprocess": "6.0.3"
  }

And updating the scripts.ts in the svelte example to use the new mount syntax.

@cezaraugusto
Copy link
Member

hey @dshook, totally want this.

cc @akadotsh - interested to take this one?

@cezaraugusto
Copy link
Member

@dshook could you share a sample web app using Svelte 5 so I can take a look? not a Svelte dev myself

@dshook
Copy link
Author

dshook commented Dec 2, 2024

You should be able to find plenty of other examples online, but for extension-js you can just mount one in a content script:

import { mount } from "svelte";
import Test from "../Test.svelte";

const container = document.querySelector('.wherever');

const app = mount(Test, {
  target: container,
});

Where Test.svelte is something like

<script>
	let count = $state(0);
</script>

<button onclick={() => count++}>
	clicks: {count}
</button>

@dandv
Copy link

dandv commented Dec 20, 2024

could you share a sample web app using Svelte 5

https://github.com/NekitCorp/chrome-extension-svelte-typescript-boilerplate is good Svelte boilerplate, just not cross-browser. The emitted background prop in manifest.json has a type: "module" for instance (even though the generated service_worker is vanilla JS), which Firefox complains about.

@cezaraugusto cezaraugusto self-assigned this Dec 21, 2024
@cezaraugusto
Copy link
Member

working on it

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

No branches or pull requests

3 participants