feat: install __r in runtime only if it wasn't yet provided#1714
Open
tjzel wants to merge 1 commit into
Open
Conversation
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
I was thinking about the way of simplifying the amount of config required for the Bundle Mode, removing the need of using
getModulesRunBeforeMainModulesince it's an API difficult to integrate with (see expo/expo#43546) and removing the hack of throwing an error after an entry point is evaluated to block additional entry points, then proceed with a costly catch statement.I came up with an idea that the runtime owner could install his own
__rfunction outside of the bundle. Metro would then not override it but instead write its__ras__eif it were needed.I think it's a better approach than relying on https://metrobundler.dev/docs/configuration/#getrunmodulestatement configuration, as it might again lead to merge issues etc. as for
getModulesRunBeforeMainModule.Changelog: [Feature] install __r in runtime only if it wasn't yet provided
Test plan
I added test cases to cover this feature.