Hey thanks for the quick response. No, I think it was just the default compiler. Despite removing that line it’s still giving me issues. Is there a repo/files that you can share so I can see the setup since you’re also using tailwind?
I do think you’re right that there’s another rebuild running but I’m not sure how else it would fire if the watcher isn’t there. Any ideas? This is probably due to how new I am to elixir and phoenix
I think I managed to fix the issue - for some reason, the node path dependency wasn’t being loaded in the internal svonixesbuild 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.
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).
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.
So I took a look at this just now - good news and bad news.
Good news: npm packages work just fine.
Bad news: Svelte component packages don’t work.
If you take a look at your browser console, you’ll see it’s throwing an error to do with reading an undefined $$ value. My best guess is that this is happening because carbon-components-svelte is a set of pre-compiled Svelte components that, upon being imported into our Svelte components, inadvertently results in duplicate versions of Svelte. The Svelte lib is stateful, and therefore this results in errors because having multiple copies of Svelte in one component is technically not allowed.
For those who might be interested, this only happens because of how (out of necessity), I’ve implemented the Svelte rendering pipeline. More information on these nuances is available in this fantastic answer to a stackoverflow question.
There might be a way around the issue you’re facing, but I’m really short on time for the near future - if you’re willing to give it a shot, please feel free to submit a pull request! Sorry I couldn’t be more helpful. I’ll amend the documentation to reflect this issue.
This has a lot of potentials IMO. Making some of the things can be really powerful such as TipTap. However, I’m hitting some issues where the rendering doesn’t work when you trigger a modal. Any idea what could be the issue?
Loading directly to the modal works, but clicking to it doesn’t (when I click “new profile”)
Here’s the code context.
I think it has something to do with how do we mount the component on update?