react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

Webpacker compile time on development

Open rapito opened this issue 3 years ago • 3 comments

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 avatar Aug 25 '21 12:08 rapito

@rapito can you try with shakapacker v6. I suspect that your issues will resolve with that update.

justin808 avatar Feb 01 '22 22:02 justin808

I have the same issue. ¿Is there a way using webpacker?

Thanks!

Nicolasramos411 avatar Apr 21 '22 01:04 Nicolasramos411

@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

justin808 avatar Apr 21 '22 03:04 justin808