-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[cli] Fix @react-native/dev-middleware types #25513
[cli] Fix @react-native/dev-middleware types #25513
Conversation
44dfecb
to
72b8358
Compare
72b8358
to
982fab2
Compare
// _mapToDevicePageId | ||
} | ||
declare module '@react-native/dev-middleware' { | ||
type DebuggerInfo = NonNullable<unstable_Device['_debuggerConnection']>; |
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.
Note to self, check if this is still necessary, or if we can use it in a better way (more @react-native/dev-middleware
-contract compliant way)
newDevice.handleDebuggerConnection(oldDebugger.socket, oldDebugger.pageId, { | ||
userAgent: oldDebugger.userAgent, | ||
}); |
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.
Not 100% set on the userAgent
name, it works like a user agent, but its not implemented as such (so probably something needs to change on that -- not sure what yet)
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.
It's the name used by @react-native/dev-middleware so we might need to live with it
# Why When upgrading to react-native 0.73 a few things changed inside the @react-native/dev-middleware, but as we were overwriting the module types with our own declarations a few errors went unnoticed # How Refactor @react-native/dev-middleware type declaration to be as simple as possible # Test Plan Typescript check should be green # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
Why
When upgrading to react-native 0.73 a few things changed inside the @react-native/dev-middleware, but as we were overwriting the module types with our own declarations a few errors went unnoticed
How
Refactor @react-native/dev-middleware type declaration to be as simple as possible
Test Plan
Typescript check should be green
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).