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

[cli] Fix @react-native/dev-middleware types #25513

Merged

Conversation

gabrieldonadel
Copy link
Member

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

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Nov 22, 2023
@gabrieldonadel gabrieldonadel force-pushed the @gabrieldonadel/react-native-dev-middleware-types branch 2 times, most recently from 44dfecb to 72b8358 Compare November 22, 2023 11:25
@gabrieldonadel gabrieldonadel marked this pull request as ready for review November 24, 2023 09:25
@gabrieldonadel gabrieldonadel force-pushed the @gabrieldonadel/react-native-dev-middleware-types branch from 72b8358 to 982fab2 Compare November 24, 2023 09:25
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Nov 27, 2023
// _mapToDevicePageId
}
declare module '@react-native/dev-middleware' {
type DebuggerInfo = NonNullable<unstable_Device['_debuggerConnection']>;
Copy link
Member

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)

Comment on lines +68 to +70
newDevice.handleDebuggerConnection(oldDebugger.socket, oldDebugger.pageId, {
userAgent: oldDebugger.userAgent,
});
Copy link
Member

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)

Copy link
Member Author

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

@gabrieldonadel gabrieldonadel merged commit f183253 into main Nov 28, 2023
6 checks passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/react-native-dev-middleware-types branch November 28, 2023 16:27
onizam95 pushed a commit to onizam95/expo-av-drm that referenced this pull request Jan 15, 2024
# 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants