@react-native/dev-middleware 0.78.0-rc.4 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,6 +89,17 @@ function createWrappedEventReporter(reporter, logger) {
89
89
  `Profiling build target "${event.appId}" registered for debugging`
90
90
  );
91
91
  break;
92
+ case "fusebox_console_notice":
93
+ logger?.info(
94
+ "\n" +
95
+ "\u001B[7m" +
96
+ " \u001B[1m💡 JavaScript logs have moved!\u001B[22m They can now be " +
97
+ "viewed in React Native DevTools. Tip: Type \u001B[1mj\u001B[22m in " +
98
+ "the terminal to open (requires Google Chrome or Microsoft Edge)." +
99
+ "\u001B[27m" +
100
+ "\n"
101
+ );
102
+ break;
92
103
  }
93
104
  reporter?.logEvent(event);
94
105
  },
@@ -40,6 +40,7 @@ function _interopRequireDefault(e) {
40
40
  const debug = require("debug")("Metro:InspectorProxy");
41
41
  const PAGES_POLLING_INTERVAL = 1000;
42
42
  const FILE_PREFIX = "file://";
43
+ let fuseboxConsoleNoticeLogged = false;
43
44
  const REACT_NATIVE_RELOADABLE_PAGE_ID = "-1";
44
45
  class Device {
45
46
  #id;
@@ -377,6 +378,7 @@ class Device {
377
378
  }
378
379
  for (const page of this.#pages.values()) {
379
380
  if (this.#pageHasCapability(page, "nativePageReloads")) {
381
+ this.#logFuseboxConsoleNotice();
380
382
  continue;
381
383
  }
382
384
  if (page.title.includes("React")) {
@@ -809,5 +811,12 @@ class Device {
809
811
  dangerouslyGetSocket() {
810
812
  return this.#deviceSocket;
811
813
  }
814
+ #logFuseboxConsoleNotice() {
815
+ if (fuseboxConsoleNoticeLogged) {
816
+ return;
817
+ }
818
+ this.#deviceEventReporter?.logFuseboxConsoleNotice();
819
+ fuseboxConsoleNoticeLogged = true;
820
+ }
812
821
  }
813
822
  exports.default = Device;
@@ -49,6 +49,7 @@ declare class DeviceEventReporter {
49
49
  error: Error,
50
50
  message: string
51
51
  ): void;
52
+ logFuseboxConsoleNotice(): void;
52
53
  }
53
54
  declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof DeviceEventReporter;
54
55
  export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -159,6 +159,11 @@ class DeviceEventReporter {
159
159
  pageId: null,
160
160
  });
161
161
  }
162
+ logFuseboxConsoleNotice() {
163
+ this.#eventReporter.logEvent({
164
+ type: "fusebox_console_notice",
165
+ });
166
+ }
162
167
  #logExpiredCommand(pendingCommand) {
163
168
  this.#eventReporter.logEvent({
164
169
  type: "debugger_command",
@@ -56,6 +56,7 @@ declare class DeviceEventReporter {
56
56
  error: Error,
57
57
  message: string
58
58
  ): void;
59
+ logFuseboxConsoleNotice(): void;
59
60
  }
60
61
 
61
62
  declare export default typeof DeviceEventReporter;
@@ -79,8 +79,9 @@ export type ReportableEvent =
79
79
  * | ^^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
80
80
  **/
81
81
  any
82
+ | { type: "fusebox_console_notice" }
82
83
  | /**
83
- * > 92 | ...DebuggerSessionIDs,
84
+ * > 95 | ...DebuggerSessionIDs,
84
85
  * | ^^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
85
86
  **/
86
87
  any;
@@ -82,6 +82,9 @@ export type ReportableEvent =
82
82
  status: "success",
83
83
  ...DebuggerSessionIDs,
84
84
  }
85
+ | {
86
+ type: "fusebox_console_notice",
87
+ }
85
88
  | {
86
89
  type: "proxy_error",
87
90
  status: "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/dev-middleware",
3
- "version": "0.78.0-rc.4",
3
+ "version": "0.78.0",
4
4
  "description": "Dev server middleware for React Native",
5
5
  "keywords": [
6
6
  "react-native",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@isaacs/ttlcache": "^1.4.1",
26
- "@react-native/debugger-frontend": "0.78.0-rc.4",
26
+ "@react-native/debugger-frontend": "0.78.0",
27
27
  "chrome-launcher": "^0.15.2",
28
28
  "chromium-edge-launcher": "^0.2.0",
29
29
  "connect": "^3.6.5",