nikokozak

nikokozak OP

I think I managed to fix the issue - for some reason, the node path dependency wasn’t being loaded in the internal svonix esbuild plugin. I added a new release on github, v0.5.1, adding it to your project should fix your issue (make sure to remove the build.js file and run the mix action again so that it gets replaced with the new version from this new release, otherwise just copy it over directly from your deps/svonix/assets folder.

1
Post #21
Morzaram

Morzaram

That does the trick!! Thank you so much for your help! I really appreciate how fast you are at fixing this

image
image1800×318 23.8 KB

1
Post #22
DevotionGeo

DevotionGeo

I’ll read this thread later, but only the title made me so much excited! :slight_smile:

Svelte and Phoenix are at the top of my favorites. Making both work together will be the next best thing happening to web development.

1
Post #23
Allyedge

Allyedge

Hey, this is a really cool project, will try it out soon!

Though, what are the advantages of using Svelte in Phoenix when we have classic controllers or LiveView?

Thanks!

1
Post #24
saleyn

saleyn

There seems quite a bit of overlap between Svelte and Alpinejs. Any feedback on using one vs another in Phoenix projects?

1
Post #25
nikokozak

nikokozak OP

It really depends - I tend to reach for Svelte when I need a level of granularity in my interactivity that I feel is harder to achieve with LiveView (after all, there is an advantage to JS-based solutions in certain cases). Think games, heavy client-side stuff, etc. I also happen to like the way Svelte is written.

That said, LiveView is fantastic at what it does, and I don’t necessarily think it has to always be an either-or situation. What I like about the approach of this library is that it’s fairly low-headspace in terms of implementing a Svelte component here or there (but can scale to larger examples as well if necessary).

2
Post #26
nikokozak

nikokozak OP

I’d suggest Alpine if all you need is some basic state management to happen in the client, in small doses, and don’t want to be bothered with writing JS.

I think the use case for something like Svonix is for more complex, interaction-heavy components that you might not want to implement in LiveView, as well as things you want to relegate to the client exclusively.

1
Post #27
Allyedge

Allyedge

Oh, I see!

I guess I’ll use it whenever I need client-side code over server side.

Thanks!

0
Post #28
Allyedge

Allyedge

So, I’m trying it out and I installed a component library called “carbon-components-svelte” just to have some free components to play around with the library.

And for some reason, it doesn’t work.

I’ve just did the npm install required and then added it to my file like this

<script>
  import { CopyButton } from "carbon-components-svelte";
</script>

<CopyButton text="Carbon svelte" />

And nothing shows up on the screen (everything works without any component libraries etc.)

Is there a way to fix this? Thanks!

0
Post #29
nikokozak

nikokozak OP

I haven’t tested the library with pre-built components, I’ll take a look at it.

My guess is that it’s something to do with the esbuild pipeline in build.js, and having to add a node-resolve plugin or something of the sort.

Are any errors thrown in the terminal?

1
Post #30