react-rails
react-rails copied to clipboard
Webpacker compile time on development
Steps to reproduce
-Setup react rails (webpacker) in a rails project. -Access a page with component
- Make a change in the component
- Reload the page
- Notice how webpacker compiles everything again (takes up to 20-30 seconds)
Expected behavior
- Reloading should happen instantly and reflect the changes.
Actual behavior
- Every tiny change you make in any component makes webpacker take up to 20-30 seconds to compile.
System configuration
Sprockets or Webpacker version: 5.4.0 React-Rails version: 2.6.1 Rect_UJS version: 2.6.1 Rails version: 6.0 Ruby version: 2.6.8
In development, When using webpacker, every single change I make in a component takes forever to compile when I reload the page. However, this is not the case if I use the asset pipeline though, every changes I make there I can see them instantly on reload.
Is this a bug with webpacker + react-rails or is it a configuration issue that's not documented?
Note: This still happens if I use webpack-dev-server
, it loads the page faster but you cannot see the changes on the component until the dev server finishes compiling, since it takes the same amount of time it's of no use.
@rapito can you try with shakapacker v6. I suspect that your issues will resolve with that update.
I have the same issue. ¿Is there a way using webpacker?
Thanks!
@Nicolasramos411 you need to update. https://github.com/shakacode/shakapacker/
And we're about to add a huge speed improvement: https://github.com/shakacode/shakapacker/pull/97