Vite, Bundlers, etc #717
Replies: 5 comments 14 replies
-
Here's my setup right now. Using v2-alpha, vite + react + typescript. Dev mode and the bridge seem to work fine. I'm currently making my own type declarations, though the ones in the comments along side the autogenerated code are helpful too. For production usage, I'm building in library mode using the "umd" format. I have a second html file for production only that references the umd js file in head. |
Beta Was this translation helpful? Give feedback.
-
This topic is a bit old, but it seemed to be appropriate for some pain points I've come across in the V2 beta. I wanted to introduce a few suggestions, and I'd be happy to help implement them if I'm able to.
These are pretty hefty suggestions, but considering the implications they could have, I feel it would be better to try and suggest them before full release, as they could have big impacts. |
Beta Was this translation helpful? Give feedback.
-
Original Context from @codydbentley:
Fair points, and this makes me consider a number of things. I think As for possible solutions, I think there are two scenarios that might make more sense:
|
Beta Was this translation helpful? Give feedback.
-
Original context from @codydbentley: Reply from @leaanthony:
I'll definitely check the package out and see if I can do anything with it! After working with things a bit more, I realize I was having issues with a few things combined that were minor inconveniences, but ultimately it all comes down to type checking and a chicken/egg problem. If type checking is turned off, this is almost a none issue, which is why the vanilla JS template and svelte template work well out of the box. Some might argue that type checking isn't necessary because the editor should help with that, but even with type checking turned off, I can't import or use objects that haven't been compiled yet, and I can't generate the bindings I need because the frontend fails to compile because the bindings haven't been generated yet. I know this is nitpicky, but even such minor inconveniences could potentially turn off users who want to use TS. I think the simplest and most straight forward way to tackle it is maybe remove frontend compilation from |
Beta Was this translation helpful? Give feedback.
-
I am facing a similar issue as @codydbentley mentioned in point 1. I am trying to use Sveltekit for the frontend which uses vite internally. For now, I have to restart wails dev command for any frontend changes; prior to which I need to run the frontend build command 'npm run build' per se. As a work around, I tried using npm-watch command to trigger frontend build after any frontend updates. This also triggers wails dev restart automatically as expected. However, the changes in index.html within the build directory are not picked up by wails. The issue then is the new js files which are generated by vite using some hash filename are not reflected. I am not sure if I could explain the issue clearly. I will create a separate repo with my set-up i.e. basic sveltekit with wails V2 to support above. -RR |
Beta Was this translation helpful? Give feedback.
-
There's quite a bit of work going on around incorporating Vite into Wails templates. Rather than have a bunch of discussion on different PRs and issues, this discussion will serve as the main place to discuss this.
Beta Was this translation helpful? Give feedback.
All reactions