Conversation
andrewbranch
approved these changes
Mar 6, 2024
Member
|
I just merge conflicted this via #57668; you'll have to merge main to delete some of these baselines. (sorry!) |
|
@rbuckton Is there an option to disable this behavior while generating CommonJS? |
Merged
2 tasks
github-merge-queue bot
pushed a commit
to software-mansion/react-native-reanimated
that referenced
this pull request
Jul 23, 2024
## Summary Since Reanimated Babel Plugin breaks hoisting and [newer Typescript hoists CommonJS exports by default](microsoft/TypeScript#57669) we sometimes need to dehoist those exports. ## Test plan - [x] Add unit test suite. - [x] Runtime tests pass.
Contributor
Author
No, there is not. It's there a reason you would need to disable it? |
|
Reanimated Babel plugin does code transformations that break hoisting - function declarations become variable declarations with assignments. Therefore with this change we also have to move the exports to the bottom of file so the values are not exported as |
r0h0gg6
pushed a commit
to r0h0gg6/react-native-reanimated
that referenced
this pull request
Jul 28, 2025
…6316) ## Summary Since Reanimated Babel Plugin breaks hoisting and [newer Typescript hoists CommonJS exports by default](microsoft/TypeScript#57669) we sometimes need to dehoist those exports. ## Test plan - [x] Add unit test suite. - [x] Runtime tests pass.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This changes our emit for CommonJS, AMD, and UMD so that exports for exported function declarations are hoisted to the top of the transformed module body. There is a minor impact on the order of keys in the
exportedNames_1map synthesized for SystemJS modules as a consequence of this change, but it has no impact to runtime behavior.Fixes #39853