The Wayback Machine - https://web.archive.org/web/20220723135347/https://github.com/ionic-team/ionic-framework/issues/22345
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

feat: Svelte support #22345

Open
g5becks opened this issue Oct 18, 2020 · 11 comments
Open

feat: Svelte support #22345

g5becks opened this issue Oct 18, 2020 · 11 comments
Labels
type: feature request

Comments

@g5becks
Copy link

@g5becks g5becks commented Oct 18, 2020

Feature Request

Ionic version:
5.x

Describe the Feature Request
Official support for Svelte framework

Describe Preferred Solution
Official support for Svelte framework from the ionic team.
Describe Alternatives

Svelte can already be used with ionic without official support, but there are a few caveats.

Related Code
https://github.com/Tommertom/svelte-ionic-app
https://ionicsvelte.firebaseapp.com/ionic/Slides

@ionitron-bot ionitron-bot bot added the triage label Oct 18, 2020
@liamdebeasi liamdebeasi added the type: feature request label Oct 19, 2020
@ionitron-bot ionitron-bot bot removed the triage label Oct 19, 2020
@PatrickG
Copy link

@PatrickG PatrickG commented Nov 26, 2020

I was trying to use the @ionic/core components in svelte (and maybe build Svelte components around them), but I am not able to configure rollup to import the components.

I've tried every possible combination of rollup output options and tsconfig options, but the defineCustomElements function from @ionic/core/loader tries to import the components from the directory where my rollup-bundle is (e.g.: /<my-bundle-dir>/ion-app-8.entry.js).
image

Does anybody have a solution for that?
I do not want to use the cdn version.

@g5becks
Copy link
Author

@g5becks g5becks commented Nov 26, 2020

I’ve personally switched to using framework7 for now, which has official svelte support.

@vladrusu
Copy link

@vladrusu vladrusu commented Feb 24, 2021

+1

Please add Svelte support.

@Zerotask
Copy link

@Zerotask Zerotask commented Mar 25, 2021

Are there any plans about supporting Svelte in the (near) future yet?

@willmartian
Copy link
Contributor

@willmartian willmartian commented Sep 3, 2021

Hey everyone! We are well aware of how much folks want official Svelte framework support. We need to do some more research, so we’re going to make this ticket the primary Svelte ticket. Please try to react and share your perspective on this ticket for this feature.

We have a few questions as well:

  1. Could folks look at the most recent Framework 6 beta in Svelte and let us know if the lazy loading issue still exists? Any documentation and updates to the reproduction repo will help.
  2. Please help us by sharing more about what “caveats” the issue’s description is referring to.

The more signal we get on this, and the more information folks can provide to us, the sooner we may be able to give you a heads up on timing and plans for Framework support. Right now, we’re focused on releasing Framework v6.

@raymondboswel
Copy link

@raymondboswel raymondboswel commented Nov 19, 2021

@willmartian I tried using 6.0.0-rc.3 in a test project here: https://github.com/raymondboswel/svelte-capacitor.

The project uses vite 2.2.3 to build.

When I build the project I get: ​[vite]: Rollup failed to resolve import "node_modules/@ionic/core/dist/ionic/ionic.esm.js" from "index.html".

I have also encountered the same error when running, which I could "solve" by only adding in the ionic references in index.html after the project is running.

I'm not sure if I used the correct approach to instantiate Ionic, there isn't much guidance on how to do it when not using a supported framework / CDN. Hope this helps!

@yuliankarapetkov
Copy link

@yuliankarapetkov yuliankarapetkov commented Jan 8, 2022

It's been more than a year since the issue was opened. When are we going to see support for Svelte?

@raymondboswel
Copy link

@raymondboswel raymondboswel commented Jan 11, 2022

I wrote a short piece about my experience with Ionic v6 in Svelte. All in all I'd say it's quite usable at this stage, although the documentation hasn't caught up quite yet.

https://medium.com/@raymondboswel/ionic-6-svelte-ae904caa82df

@akvadrako
Copy link

@akvadrako akvadrako commented Feb 22, 2022

It looks like stencil can already output svelte components 1, so couldn't a ionic-svelte package be created fairly easily?

Footnotes

  1. https://github.com/ionic-team/stencil-ds-output-targets

@Tommertom
Copy link

@Tommertom Tommertom commented Jun 4, 2022

I started working on ionic 6 & svelte integration, using vite (so using npm create vite@latest).

https://github.com/Tommertom/svelte-ionic-app

With a nice demo app to showcase how cool Ionic is as an framework - https://ionicsvelte.firebaseapp.com/components/Splash

Hopefully this will inspire Ionic's team to create official one :)

@Tommertom
Copy link

@Tommertom Tommertom commented Jul 23, 2022

See comment by Rich Harris on integration of Ionic with SvelteKIT (not svelte) - sveltejs/kit#5143
Would we need to raise on "hydration" support by Ionic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request
10 participants