-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prepare for Fabric / TurboModules #650
Conversation
try { | ||
return await CameraModule.takePhoto(this.handle, options ?? {}); | ||
return await this.handle.takePhoto(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tsc] <2339> reported by reviewdog 🐶
Property 'takePhoto' does not exist on type 'RefType'.
if (Platform.OS !== 'android') | ||
throw new CameraCaptureError('capture/capture-type-not-supported', `'takeSnapshot()' is not available on ${Platform.OS}!`); | ||
|
||
try { | ||
return await CameraModule.takeSnapshot(this.handle, options ?? {}); | ||
return await this.handle.takeSnapshot(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tsc] <2339> reported by reviewdog 🐶
Property 'takeSnapshot' does not exist on type 'RefType'.
try { | ||
CameraModule.startRecording(this.handle, passThroughOptions, onRecordCallback); | ||
await this.handle.startRecording(passThroughOptions, onRecordCallback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tsc] <2339> reported by reviewdog 🐶
Property 'startRecording' does not exist on type 'RefType'.
@@ -205,7 +204,7 @@ export class Camera extends React.PureComponent<CameraProps> { | |||
*/ | |||
public async stopRecording(): Promise<void> { | |||
try { | |||
return await CameraModule.stopRecording(this.handle); | |||
return await this.handle.stopRecording(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tsc] <2339> reported by reviewdog 🐶
Property 'stopRecording' does not exist on type 'RefType'.
@@ -231,7 +230,7 @@ export class Camera extends React.PureComponent<CameraProps> { | |||
*/ | |||
public async focus(point: Point): Promise<void> { | |||
try { | |||
return await CameraModule.focus(this.handle, point); | |||
return await this.handle.focusPoint(point); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tsc] <2339> reported by reviewdog 🐶
Property 'focusPoint' does not exist on type 'RefType'.
Hi @marc Rousavy any Idea by when this PR will be merged ? |
Got the champagne on ice for this being merged, will finally be able to ditch all other camera libraries and use only this 🥳 |
Why only after this PR is merged? |
Unfortunately I've got an issue with needing to use a camera in a modal, see #500. Making do with expo-camera in that case. |
I personally never use |
Yeah that's a possibility but then I have to deal with passing data back to the parent screen either by using global state, callbacks or via navigation params, none of which are particularly desirable for my use case. |
Hi @steffisturm, I'm not sure if you understand what the goal of this PR is. Is your app already running on Fabric and TurboModules? |
Please don't stop it here :) keep going. |
I don't have any budget for this right now. Don't have the free time to work on this either 🤷♂️ |
… Module (1/3)
What
Prepares VisionCamera for Fabric and TurboModules. Some notable changes:
Fabric
findNodeHandle(...)
) to a static function. This ensures that the native view is always referenced, and even works if referenced under a separate React Root (e.g. in RN Modals)setFrameProcessor
andunsetFrameProcessor
to the native HostComponent and access directly via a Ref/HandleTurboModules
setFrameProcessor
andunsetFrameProcessor
by binding directly to native C++ HostComponent instead of manually injecting via JSI.Changes
whole lotta changes.
Tested on