Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor IS_NATIVE and global._IS_FABRIC #5250

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

bartlomiejbloniarz
Copy link
Contributor

Summary

This PR removes IS_NATIVE in favor of SHOULD_BE_USE_WEB to be more consistent with PlatformChecker. Additionally isFabric() was added to PlatformChecker.

Test plan

@bartlomiejbloniarz bartlomiejbloniarz marked this pull request as ready for review October 16, 2023 15:15
Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👏

After reading this PR, I would say that sometimes it's convenient to have IS_NATIVE because it's easier to understand than !SHOULD_BE_USE_WEB but I think it's a step in the right direction anyway.

BTW Does it mean that we no longer need global._IS_FABRIC on the UI runtime? Technically, we could remove injecting it but is it safe to do so? Also, if we leave it and add 'worklet'; directive in the isFabric function, this will also work. Are there any use cases where we need to check if Fabric is enabled on the UI thread?

src/reanimated2/PropsRegistry.ts Outdated Show resolved Hide resolved
@bartlomiejbloniarz
Copy link
Contributor Author

bartlomiejbloniarz commented Oct 18, 2023

@tomekzaw as mentioned offline, global._IS_FABRIC is currently not used on the UI thread but I think we should keep it around until at least we are done with layout animations on Fabric

@bartlomiejbloniarz bartlomiejbloniarz added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit be0a9b2 Oct 18, 2023
7 checks passed
@bartlomiejbloniarz bartlomiejbloniarz deleted the @bartlomiejbloniarz/remove-is-native branch October 18, 2023 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants