-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: Add console
logging support for Frame Processors
#297
Merged
Conversation
This file contains 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
console
logging supportconsole
logging support for Frame Processors
d3fc10a
to
ece0fc5
Compare
Waiting for software-mansion/react-native-reanimated#2219 |
Possibly also waiting for software-mansion/react-native-reanimated#2220 |
4 tasks
d8015d2
to
b5c8f49
Compare
isaaccolson
pushed a commit
to isaaccolson/deliveries-mobile
that referenced
this pull request
Oct 30, 2024
* Try to log to console via runOnJS * Call `console.log` * Create custom `VisionCameraScheduler` * Fix scheduler call * Call with this * Fix console setting * Move J---- to `java-bindings` * c++ style * Android: 1/2 Create custom Scheduler * Android: 2/2 Use custom Scheduler * Don't use `runOnJS`, use `__callAsync` directly
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
What
Until now you could not log something to the Metro JS console. The only way to log something was through the native HostFunction
_log
, which only logged to Xcode Logs/Android Logcat.This PR changes this and adds support for using
console
to log messages to the Metro console. (e.g.console.log
,console.debug
, etc)When trying to add support for this, I noticed that there were a few threading issues with the way Frame Processors are currently implemented - mainly that they use the reanimated UI Thread Scheduler for scheduling stuff, which (afaik) should only be a problem when you passed a function to a FP Plugin. But this PR fixes this by implementing a custom Scheduler.
console
support to the VisionCamera Frame Processor runtime so you can useconsole.log
inside ofuseFrameProcessor
StoreUser
(JSIStoreValueUser
) on a per-RuntimeManager
-basis software-mansion/react-native-reanimated#2219Changes
Tested on
Related issues