[0.77] Restore Metro log streaming via CLI flag#49356
Merged
robhogan merged 1 commit intofacebook:0.77-stablefrom Feb 12, 2025
Merged
[0.77] Restore Metro log streaming via CLI flag#49356robhogan merged 1 commit intofacebook:0.77-stablefrom
robhogan merged 1 commit intofacebook:0.77-stablefrom
Conversation
Summary: This change adds an opt-in to restore JavaScript log streaming via the Metro dev server, [removed from React Native core in 0.77](https://reactnative.dev/blog/2025/01/21/version-0.77#removal-of-consolelog-streaming-in-metro). Users can opt into this legacy behaviour by adding the `--client-logs` flag to `npx react-native-community/cli start`. - The default experience remains without streamed JS logs. - The existing "JavaScript logs have moved! ..." notice is printed in all cases, and we do not advertise the new flag for new users. - Under non-Community CLI dev servers (i.e. Expo), log streaming is restored implicitly. We will clean up this functionality again when we eventually remove JS log streaming over `HMRClient`, tasked in T214991636. **Implementation notes** - Logs are always sent over `HMRClient` (previous status quo), even with log streaming off in the dev server. This is a necessary evil to be able to flag this functionality in a user-accessible place, and to move fast for 0.78. - Necessarily, emitting `fusebox_console_notice` moves to the dev server itself, on first device (Fusebox) connection. Changelog: [General][Added] - Add opt in for legacy Metro log streaming via `--client-logs` flag
376c2e1 to
453a2b8
Compare
Contributor
|
Picks 0d66c52 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Note
This is a separate version of #49353 / D69469039 targeting the
0.77-stablebranch.This change adds an opt-in to restore JavaScript log streaming via the Metro dev server, removed from React Native core in 0.77.
Users can opt into this legacy behaviour by adding the
--client-logsflag tonpx @react-native-community/cli start.We will clean up this functionality again when we eventually remove JS log streaming over
HMRClient, tasked in T214991636.Implementation notes
HMRClient(previous status quo), even with log streaming off in the dev server. This is a necessary evil to be able to flag this functionality in a user-accessible place, and to move fast for 0.78.fusebox_console_noticemoves to the dev server itself, on first device (Fusebox) connection.Changelog:
[General][Added] - Add opt in for legacy Metro log streaming via
--client-logsflagTest Plan
Default
✅ RNDT logs warning notice is emitted in dev server
✅ Logs are not visible in dev server
✅ Logs are visible in DevTools
✅ RNDT logs warning is shown once
With
--client-logs✅ RNDT logs warning notice is emitted in dev server
✅ Logs are visible in dev server
✅ Logs are visible in DevTools
✅ RNDT logs warning is shown once