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

Integrating Svelte? #351

Open
levitabris opened this issue Feb 9, 2023 · 8 comments
Open

Integrating Svelte? #351

levitabris opened this issue Feb 9, 2023 · 8 comments
Labels
good first issue Good for newcomers plugin/integration Integrating Civet with other tools

Comments

@levitabris
Copy link

Svelte is gaining popularity among people who appreciate simplicity and easy composability. Since its functionality is not based on a js import, would you consider making Civet compatible with .svelte components?

I would recommend a syntax like the following:

<script lang="civet"> 'hello world!' |> console.log </script>

@edemaine
Copy link
Collaborator

edemaine commented Feb 9, 2023

Sounds like a great idea! Perhaps we can mimic svelte-add/coffeescript? Or is svelte-add still active / the right approach?

Let us know if you'd like to work on this; it doesn't look too difficult.

@STRd6
Copy link
Contributor

STRd6 commented Feb 9, 2023

We'll need to add support for $: labels too. Should be straightforward.

@edemaine
Copy link
Collaborator

edemaine commented Feb 9, 2023

Looking at Svelte's TypeScript support, the transpilation may be possible now with our existing Vite plugin which should also work as a Rollup plugin. But obviously this needs testing.

@STRd6 STRd6 added good first issue Good for newcomers plugin/integration Integrating Civet with other tools labels Feb 12, 2023
@levitabris
Copy link
Author

Sounds like a great idea! Perhaps we can mimic svelte-add/coffeescript? Or is svelte-add still active / the right approach?

Let us know if you'd like to work on this; it doesn't look too difficult.

Not sure if it is the right approach. But I can experiment with mimicing the svelte-add coffeescript and see what happens.

@edemaine
Copy link
Collaborator

Great! Feel free to suggest a better approach as well if you find one.

FYI, we've added support for $: to Civet already.

@levitabris
Copy link
Author

There is a bit learning curve here. My WIP version:

https://github.com/levitabris/svelte-add

@levitabris
Copy link
Author

Update:
It seems that svelte-add coffee script support is just a wrapper around svelte-proprocess(feel free to correct me if wrong), which implemets the original coffee support for svelte. I'm looking into how it was done in the svelte-preprocess.

BTW, the svelte-preprocess seems to be straight forward to config itself🦦

@STRd6
Copy link
Contributor

STRd6 commented Sep 5, 2023

@levitabris Have you taken a look at our new Rollup and Vite plugins? https://github.com/DanielXMoore/Civet/tree/main/integration/unplugin/examples please try them out and let us know if you have any questions or encounter any errors, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers plugin/integration Integrating Civet with other tools
Projects
None yet
Development

No branches or pull requests

3 participants