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 #19

Open
pcharbon70-leco opened this issue Aug 14, 2023 · 2 comments
Open

Integrating Svelte #19

pcharbon70-leco opened this issue Aug 14, 2023 · 2 comments

Comments

@pcharbon70-leco
Copy link

Good afternoon,

This is not an issue per say but more of a question about integrating a module like Svelte in the build process.
I read a very interesting article a few weeks back about E2E Reactivity using Svelte with Phoenix Liveview that inspired some people to develop an integration between Phoenix Liveview and Svelte.

I know that you can compile Svelte to WASM but that would not let submillisecond-live-view directly interact with it in order to capture the events from Svelt. I don't mind spending the time trying to see how to achieve this but I am not sure if there is any way to actually integrate NPM build process with submillisecond server at the moment? Still totally new to the lunatic way of things to be honest.

Any pointer in the right direction would be appreciated.

Thank you in advance.

Pascal Charbonneau

@bkolobara
Copy link
Contributor

submillisecond-live-view projects use Rust's default package manager/build tool cargo.

Inside of the cargo project you can add a build.rs file that will run arbitrary code on each build and, I assume, can be used to trigger an NPM build. https://doc.rust-lang.org/cargo/reference/build-scripts.html

There are also helper libraries that let you do this https://github.com/UpsettingBoy/npm_rs

@pcharbon70-leco
Copy link
Author

Thanks for the explanation and links, they should help.
Looking forward to trying lunatic as an Elixir developer and Rust newbie.
Its really like eating your cake and having it too :)

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

2 participants