From afa8e85ad5fbce024dfb5b4fd47a4726b8e0cf9a Mon Sep 17 00:00:00 2001 From: Edmond Chui <1967998+EdmondChuiHW@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:32:26 +0000 Subject: [PATCH 1/2] gen types and init stub --- .eslintignore | 1 + .../core/react_native/RNReliabilityMetrics.ts | 19 ++++++++++ ...ativeChromeDevToolsDebuggerEventTypes.d.ts | 36 +++++++++++++++++++ .../ReactNativeChromeDevToolsEventTypes.d.ts | 20 +++++++++++ .../eslint_rules/lib/check_license_header.js | 1 + 5 files changed, 77 insertions(+) create mode 100644 front_end/core/react_native/RNReliabilityMetrics.ts create mode 100644 front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts create mode 100644 front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts diff --git a/.eslintignore b/.eslintignore index b4ea39c9900..9a116465c05 100644 --- a/.eslintignore +++ b/.eslintignore @@ -10,6 +10,7 @@ front_end/javascript_metadata/DOMPinnedProperties.ts // All of the scripts in this folder are auto-generated so don't lint them. front_end/generated/ +front_end/core/react_native/generated/ // Any third_party addition has its source code checked out into // third_party/X/package, so we ignore that code as it's not code we author or diff --git a/front_end/core/react_native/RNReliabilityMetrics.ts b/front_end/core/react_native/RNReliabilityMetrics.ts new file mode 100644 index 00000000000..9461b18a7a6 --- /dev/null +++ b/front_end/core/react_native/RNReliabilityMetrics.ts @@ -0,0 +1,19 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {type ReactNativeChromeDevToolsEvent} from './generated/type_defs/ReactNativeChromeDevToolsEventTypes.js'; + +type RNReliabilityMetrics = { + sendEvent: (event: ReactNativeChromeDevToolsEvent) => void, +}; + +export const RNReliabilityMetrics = ((): RNReliabilityMetrics => { + function sendEvent(_event: ReactNativeChromeDevToolsEvent): void { + } + + return { + sendEvent, + }; +})(); diff --git a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts new file mode 100644 index 00000000000..cde4af4832a --- /dev/null +++ b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * Copyright 2024 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * @generated by xplat/js/react-native-github/scripts/debugger-frontend/gen-type-defs.js + */ + +export type SetBreakpointEventEntryPoint = + | "fileGutterClicked" + | "savedStateRestored"; +export type SetBreakpointEventType = + | "logpoint" + | "unconditionalBreakpoint" + | "conditionalBreakpoint"; +export type SetBreakpointRequestEvent = Readonly<{ + event: "Debugger.SetBreakpoint.Request"; + params: Readonly<{ + entryPoint: SetBreakpointEventEntryPoint; + requestID: string; + type: SetBreakpointEventType; + }>; +}>; +export type SetBreakpointResponseEvent = Readonly<{ + event: "Debugger.SetBreakpoint.Response"; + params: Readonly<{ breakpointID: string; requestID: string }>; +}>; +export type BreakpointResolvedEvent = Readonly<{ + event: "Debugger.BreakpointResolved"; + params: Readonly<{ breakpointID: string }>; +}>; +export type DebuggerPausedEvent = Readonly<{ + event: "Debugger.Paused"; + params: Readonly<{ breakpointID: null | undefined | string }>; +}>; diff --git a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts new file mode 100644 index 00000000000..1fc9ee97386 --- /dev/null +++ b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * Copyright 2024 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * @generated by xplat/js/react-native-github/scripts/debugger-frontend/gen-type-defs.js + */ + +import type { + BreakpointResolvedEvent, + DebuggerPausedEvent, + SetBreakpointRequestEvent, + SetBreakpointResponseEvent, +} from "ReactNativeChromeDevToolsDebuggerEventTypes"; +export type ReactNativeChromeDevToolsEvent = + | SetBreakpointRequestEvent + | SetBreakpointResponseEvent + | BreakpointResolvedEvent + | DebuggerPausedEvent; diff --git a/scripts/eslint_rules/lib/check_license_header.js b/scripts/eslint_rules/lib/check_license_header.js index 16517112aa3..0bbd9e3002f 100644 --- a/scripts/eslint_rules/lib/check_license_header.js +++ b/scripts/eslint_rules/lib/check_license_header.js @@ -69,6 +69,7 @@ const EXCLUDED_FILES = [ const META_CODE_PATHS = [ 'entrypoints/rn_inspector', 'panels/rn_welcome', + 'core/react_native' ]; const OTHER_LICENSE_HEADERS = [ From 21710b106209a97d1142c0ed6aa9b3f3b403e17f Mon Sep 17 00:00:00 2001 From: Edmond Chui <1967998+EdmondChuiHW@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:16:55 +0000 Subject: [PATCH 2/2] gen --- .../type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts | 2 +- .../type_defs/ReactNativeChromeDevToolsEventTypes.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts index cde4af4832a..47054a8d368 100644 --- a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts +++ b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsDebuggerEventTypes.d.ts @@ -4,7 +4,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * @generated by xplat/js/react-native-github/scripts/debugger-frontend/gen-type-defs.js + * @generated by WWW D54582949 */ export type SetBreakpointEventEntryPoint = diff --git a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts index 1fc9ee97386..26280e6493e 100644 --- a/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts +++ b/front_end/core/react_native/generated/type_defs/ReactNativeChromeDevToolsEventTypes.d.ts @@ -4,7 +4,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * @generated by xplat/js/react-native-github/scripts/debugger-frontend/gen-type-defs.js + * @generated by WWW D54582949 */ import type {