boot-react-native icon indicating copy to clipboard operation
boot-react-native copied to clipboard

[RN 0.39] JS updates not picked up by react packager

Open vikeri opened this issue 9 years ago • 3 comments

When I updated to RN 0.39.0 my changes in the code are not visible anymore, this is probably the issue: https://github.com/facebook/react-native/issues/11301

A possible solution would be to not have the compiled js files being written to node_modules, not sure if that would affect other parts of the build system though.

vikeri avatar Dec 06 '16 10:12 vikeri

Latest update, I have now very crudely changed the folder from node_modules to cljs_output and then replaced goog.require(' with require(./cljs_output/'. This adds about 450ms in build time for the example project :disappointed:. But at least it seems to work with 0.39. Going to polish it a bit and then I'll submit a PR. A positive outcome of this is that the patch-rn script is not needed anymore 👍

vikeri avatar Dec 28 '16 12:12 vikeri

Investigated this with RN 0.42. The packager now seems to notice that the cljs files are updated, but those changes aren't shown in the final js-bundle. I’m going back to the approach of rewriting the file to add the normal require statement, see #84 . This will break hot-reload, but it doesn’t work very robustly for us anyway. If I would have had more time I’d investigated how the dependency tree is calculated by the react-packager and tried to feed the Closure dependency tree to that packager, which ideally would have made the step of copying all files to node_modules obsolete (that step is required for react-packager find those files and include them in the js-bundle).

vikeri avatar Mar 20 '17 08:03 vikeri

For a version that works with RN 0.42 but boot-reload is broken: https://github.com/vikeri/boot-react-native/tree/rn42

vikeri avatar Mar 20 '17 16:03 vikeri