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

Create dev-middleware package #38194

Closed
wants to merge 1 commit into from
Closed

Conversation

huntie
Copy link
Member

@huntie huntie commented Jul 5, 2023

Summary:

Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

Changes

Inits the @react-native/dev-middleware package. Contains an initial implementation of /open-debugger, migrated from react-native-community/cli@2535dbe.

Motivation + Design

@react-native/dev-middleware is a focused new package to support new HTTP endpoints on React Native dev servers (e.g. RN CLI), initially to implement two planned new endpoints to support debugging actions in the Dev Menu for the One-click Hermes debugger flow.

Logically, this package can be seen as a subset of @react-native-community/cli-server-api — which we are gradually reintegrating into the react-native repo. It implements debugging actions in the Dev Menu, and interfaces as connect middleware, which is plugged in to Metro's server under the hood.

Notes

  • This package requires a build step (targeting Node.js).
    • Upcoming commits (stacked internally) are working to set up a shared build capability across the monorepo to make this more seamless.
  • Currently uses chrome-launcher only.
    • Incoming: We'll support Microsoft Edge too!
    • (In general, this is a first rough version and we'll be hardening + testing soon.)

Attribution

This implementation is greatly inspired by @expo/dev-server: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jul 5, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

@analysis-bot
Copy link

analysis-bot commented Jul 5, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 9,001,686 -2
android hermes armeabi-v7a 8,255,743 -4
android hermes x86 9,510,825 +0
android hermes x86_64 9,356,705 -1
android jsc arm64-v8a 9,614,712 +2
android jsc armeabi-v7a 8,741,346 -1
android jsc x86 9,701,661 +2
android jsc x86_64 9,948,229 +3

Base commit: e075a3f
Branch: main

huntie added a commit to huntie/react-native that referenced this pull request Jul 5, 2023
Summary:
Pull Request resolved: facebook#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 84cd5a958e32d7c20fd3aef56eaa01547e4ae192
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

huntie added a commit to huntie/react-native that referenced this pull request Jul 5, 2023
Summary:
Pull Request resolved: facebook#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 5a6c27082387b5c3ffc0962ebecc6f57ed24b9ed
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

huntie added a commit to huntie/react-native that referenced this pull request Jul 5, 2023
Summary:
Pull Request resolved: facebook#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 4eb8e3e09d0ce05418c98526d5d136e6aad0143e
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

huntie added a commit to huntie/react-native that referenced this pull request Jul 7, 2023
Summary:
Pull Request resolved: facebook#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: c113a773e5f28cfa1723db5a9c51ea4f47fa91bb
Summary:
Pull Request resolved: facebook#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 298ea6cba663b3946c785e2c2220c809cf554978
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46283818

facebook-github-bot pushed a commit to facebook/metro that referenced this pull request Jul 7, 2023
Summary:
X-link: facebook/react-native#38194

## Context

RFC: Decoupling Flipper from React Native core: react-native-community/discussions-and-proposals#641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from react-native-community/cli@2535dbe.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 7b38ad2f6d7346366a7c599d16e289e04b7bd88d
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This pull request was successfully merged by @huntie in a991ff3.

When will my fix make it into a release? | Upcoming Releases

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 7, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a991ff3.

@huntie huntie deleted the export-D46283818 branch August 29, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants