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

Remove _setGloalConsole JSI method #3853

Merged
merged 2 commits into from
Dec 13, 2022
Merged

Conversation

kmagiera
Copy link
Member

Summary

After #3838 we can now access the main global object via global variable. This eliminates a need for _setGlobalConsole JSI method that we'd install in the UI runtime only so that we can set the console object as global on the UI runtime. In this PR we change the call to _setGlobalConsole with just reassigning global.console.

Test plan

Add some logs in worklets, run the app, see the logs appear on the output, also that console.warn displays in the log box.

src/reanimated2/core.ts Outdated Show resolved Hide resolved
Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
@kmagiera kmagiera merged commit 120957f into main Dec 13, 2022
@kmagiera kmagiera deleted the cleanup-console-after-dummy-global branch December 13, 2022 08:40
kmagiera added a commit that referenced this pull request Dec 13, 2022
After #3838 we can now access the main global object via `global`
variable. This eliminates a need for _setGlobalConsole JSI method that
we'd install in the UI runtime only so that we can set the console
object as global on the UI runtime. In this PR we change the call to
_setGlobalConsole with just reassigning global.console.

Add some logs in worklets, run the app, see the logs appear on the
output, also that console.warn displays in the log box.

Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Summary

After software-mansion#3838 we can now access the main global object via `global`
variable. This eliminates a need for _setGlobalConsole JSI method that
we'd install in the UI runtime only so that we can set the console
object as global on the UI runtime. In this PR we change the call to
_setGlobalConsole with just reassigning global.console.

## Test plan

Add some logs in worklets, run the app, see the logs appear on the
output, also that console.warn displays in the log box.

Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
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.

2 participants