Conversation
Summary: Reverts #58350, restoring the long-standing `Platform.select` inlining behavior. Per robhogan and vonovak: Metro has inlined Platform.select() (in release builds only, not configurable) forever really - it goes back to at least 2017, before the start of the Metro repo, eg: react/metro@a317b9d It's always had that behaviour where it collapses side-effects of inactive branches. Recently, the plugin was copied/re-implemented into RN. Right now (RN 0.88, Metro 0.87) they both have their own version of the plugin and Metro's runs after RN's, but Metro's shouldn't find anything left to inline and should be a no-op. I couldn't remove it from Metro immediately only because it'd need a major Metro release, but I plan to remove it soon. So RN's is effectively a continuation of Metro's 8 year old behaviour - we just moved the implementation. Changelog: [General][Fixed] - Restore long-standing Platform.select inlining behavior that collapses side effects of inactive branches See discussion: #58442 Differential Revision: D120147924
|
@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D120147924. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Reverts #58350, restoring the
long-standing
Platform.selectinlining behavior.Per robhogan and vonovak:
Metro has inlined Platform.select() (in release builds only, not configurable) forever really - it goes back to at least 2017, before the start of the Metro repo, eg: react/metro@a317b9d It's always had that behaviour where it collapses side-effects of inactive branches.
Recently, the plugin was copied/re-implemented into RN.
Right now (RN 0.88, Metro 0.87) they both have their own version of the plugin and Metro's runs after RN's, but Metro's shouldn't find anything left to inline and should be a no-op. I couldn't remove it from Metro immediately only because it'd need a major Metro release, but I plan to remove it soon.
So RN's is effectively a continuation of Metro's 8 year old behaviour - we just moved the implementation.
Changelog:
[General][Fixed] - Restore long-standing Platform.select inlining behavior that collapses side effects of inactive branches
See discussion: #58442
Differential Revision: D120147924