haxe-react-redux icon indicating copy to clipboard operation
haxe-react-redux copied to clipboard

livereload not working?

Open axelhuizinga opened this issue 7 years ago • 8 comments

I followed all steps to set-up the examples with livereload but all I get after a code change and npm run dev are 2 lines on the dev server started with npm run serve: 2017-11-04 16:58:17 - info: skip: index.js.map 2017-11-04 16:58:17 - info: notify: index.js (16 client) s no reaction in the browser - however on the js console in ff or chrome I get error messages related to the ws connection every minute... firewall for 35729 IN is open

axelhuizinga avatar Nov 04 '17 16:11 axelhuizinga

It will depend on what code you change:

  • livereload will only force a react re-render,
  • startup / store configuration or mapState aren't re-evaluated.

I pushed an update of the haxe-modular npm dependency though as it contains fixes. Re-run npm install and npm run libs and it should work better generally.

elsassph avatar Nov 04 '17 22:11 elsassph

Nice to get a quick response - npm install npm WARN [email protected] No repository field.

up to date in 2.838s root@h2410222:/opt/src/sun4.me/haxe-react-redux# npm run libs

[email protected] libs /opt/src/sun4.me/haxe-react-redux browserify src/libs.js -o bin/libs.js -d

but still no luck: I found the menu created in Main.pageWrapper isn't split at all and thus not separately hot reloadable. Changes below the TodoListScreen and AboutScreen classes are reloded as expected. How will I have to refactor this example in order to have the Menu separately reloadable as well?

axelhuizinga avatar Nov 05 '17 00:11 axelhuizinga

The thing with live reload is that it's not magic - only split code can reload. In the case if this sample project, the routes component (TodoList, AboutView) can live-reload.

The only thing we could (and should) do is to reload the page when the index JS changes. But that won't be "live".

elsassph avatar Nov 05 '17 12:11 elsassph

@elsassph, for example, I make changes in Main.hx file and auto reloading of index.html works only without -debug flag. Is it expected behavior?

djaonourside avatar Dec 05 '17 09:12 djaonourside

Hot-reload logic is only included in debug builds.

elsassph avatar Dec 05 '17 11:12 elsassph

Then why livereloadx doesn't reload page after haxe recompile sources with -debug flag on?

djaonourside avatar Dec 05 '17 11:12 djaonourside

Changes in the main bundle can't be live updated, and currently the page doesn't auto-refresh when this happens.

elsassph avatar Dec 05 '17 12:12 elsassph

https://github.com/elsassph/haxe-modular/issues/10

elsassph avatar Dec 05 '17 12:12 elsassph