mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
08baec61c2
Summary: This is a revamp of how we decide whether to stop at a refresh boundary or to bubble to the next one. We used to decide that at module initialization. However, that's both unnecessary overhead on start (for modules you don't plan to edit), and is actually insufficient. In particular, even if a module only exports components (and thus is a Refresh Boundary), consecutive versions of that module might not be compatible. For example, any of these changes should trigger reevaluation of parents: - Adding or removing exports - Renaming the exported component (which probably means you exported a different one, and we shouldn't preserve state) - Converting from a class to a function, or back - Wrapping something in a HOC The new system handles these cases by comparing the Refresh "families" corresponding to exports, and bubbling the update up if some of them don't match up. The tests have been rewritten from the webpack-inspired `module.hot` API (which we no longer use directly) to the Refresh API. Reviewed By: rubennorte Differential Revision: D16036044 fbshipit-source-id: 18018548d4aaa05877ae6fbaffe40c993c77cdf0