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 "Use Svelte in your plugin" for Svelte 4 #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

inhumantsar
Copy link

Note that this includes an upgrade to Typescript 5. This is working fine on my simple plugin but I'm not sure what kind of breaking changes might be lurking deeper down the stack.

Closes #92

Note that this includes an upgrade to Typescript 5. This is working fine on my simple plugin but I'm not sure what kind of breaking changes might be lurking deeper down the stack.
@bhavers
Copy link

bhavers commented Apr 25, 2024

Can confirm that these changes worked for me (typescript 5 and the changes in commit).
Only get a warning on compilerOptions.css. But doesn't seem to do harm.

> node esbuild.config.mjs
[watch] build finished, watching for changes...
compilerOptions.css as a boolean is deprecated. Use 'injected' instead of true.

@San7o
Copy link

San7o commented Jul 4, 2024

These changes worked for me as well and resolved some confusion about how to add Svelte to the plugins, given that the Obsidian sample plugin code has changed ("6. Add Svelte to the list of plugins.")

"include": [ "**/*.ts", "**/*.svelte" ]
```

5. In `esbuild.config.mjs`, add the following imports to the top of the file:

```js
import esbuildSvelte from "esbuild-svelte";
import sveltePreprocess from "svelte-preprocess";

Choose a reason for hiding this comment

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

This should be changed to import { sveltePreprocess } from 'svelte-preprocess'; as the current way it is, is a deprecated symbol.

It's shown here in the first code block below this header

@dj-sf
Copy link

dj-sf commented Sep 3, 2024

@inhumantsar @hemstreet just confirming that this fixed svelte store issues that I was having as well.

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.

"Use Svelte in your plugin" is outdated
5 participants