I made significant updates to figwheel-bridge.js so that it works
better with figwheel and hopefully better overall. Removed most hacky
integrations using hooks that will be permanently available in
figwheel.
By adding a listener that listens to all of Figwheels internal messages
the groundwork for a more figwheel like feedback system in the top
level figwheel react component has been started.
Update it to latest version 0.5.8. Latest versions of lein-figwheel
generate the "figwheel.connect" including the build id, so I updated
figwheel-bridge to concat the platform id.
Figwheel logs compilation exception in several log messages, so need to buffer them to show in YellowBox.
- buffering starts on "Fighweel: Compile Exception"
- buffering stops on "Error on file"
- using latest available version of lein-figwheel [0.5.0-6]
- figwheel now 'thinks' it is running in node.js environment (thanks @artemyarulin for hints)
- figwheel :heads-up-display is now disabled. Compilation warnings are still logged and shown in yellow box on screen. (thanks @seantempesta for hint)
Bug description:
figwheel-bridge tracks the js file evaluation and when /env/<platform>/main.js script is evaluated it means that all app code is loaded and can be started. But in case user code contains custom namespace called *.main, then figwheel-bridge interpret the evaluation of this namespace incorrectly and tries to start app too early.
- do not use AppRegistry.registerRunnable for mounting component to id 1, this prevents warning to be shown in yellow box. Instead use AppRegistry.registerComponent
- shim some document functions so that enabled figwheel heads-up-display works without errors and logs warnings to console (that will be shown on screen in yellow box)
- figwheel splash component now loads real app and renders root component. That has to be done to avoid using AppRegistry.registerRunnable to render real app
- new CLI command use-component <name> which save name in .re-natal config for later use in use-figwheel command
- use-figwheel now generates a map of cached 'require' calls
- figwheel-bridge.js shims require function to lookup for components by name falls back to original if nothing found
- Removed REPL based on ambly for now, need to find a good solution for both iOS and Android
- Added figwheel based on great work found in https://github.com/decker405/figwheel-react-native
- Android still does not work with figwheel, but reload works very fast