Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Conversation

@EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Apr 15, 2022

Why

How

  • Import @react-native-community/cli-server-api from the project instead of vendoring. This will ensure the installed version works with the installed metro package.
  • If attachToServer exists, then attach using the legacy API, otherwise use the new API.

Test Plan

  • Sanity: I created a new React Native project using npx react-native init, a couple hours later I was able to run npx react-native run-ios then npx react-native start -- pressing r works but pressing d does not work.
  • Test: in the new project I ran expo start --dev-client then pressed r to reload -- d didn't work in Expo CLI either.
  • In an older Expo project I ran expo start to ensure pressing r and d still worked as expected.
  • Wasn't able to test experimental webpack native support but I imagine it's partially broken now.

@EvanBacon EvanBacon requested a review from brentvatne April 15, 2022 20:45
@EvanBacon EvanBacon marked this pull request as ready for review April 15, 2022 20:46

// The SDK 41 client has web socket support.
if (Versions.gteSdkVersion(exp, '41.0.0')) {
if (!Versions.lteSdkVersion(exp, '40.0.0')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally i think the original version of this read more clearly 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if you ran this in a project without Expo it would default to false whereas the feature is now old enough to default to being true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see. that's an unexpected nuance here.

@EvanBacon EvanBacon merged commit 6e77669 into main Apr 20, 2022
@EvanBacon EvanBacon deleted the @evanbacon/cli/support-new-dev-server-api branch April 20, 2022 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants