react-native-tvos 0.71.11-0 → 0.71.12-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.
@@ -161,7 +161,7 @@ const View: React.AbstractComponent<
161
161
  nativeID={id ?? nativeID}
162
162
  style={style}
163
163
  pointerEvents={newPointerEvents}
164
- ref={forwardedRef}
164
+ ref={_setNativeRef}
165
165
  />
166
166
  </TextAncestor.Provider>
167
167
  );
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 11,
15
+ patch: 12,
16
16
  prerelease: '0',
17
17
  };
@@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog';
14
14
  import parseErrorStack from '../../Core/Devtools/parseErrorStack';
15
15
  import UTFSequence from '../../UTFSequence';
16
16
  import stringifySafe from '../../Utilities/stringifySafe';
17
+ import ansiRegex from 'ansi-regex';
18
+
19
+ const ANSI_REGEX = ansiRegex().source;
17
20
 
18
21
  const BABEL_TRANSFORM_ERROR_FORMAT =
19
22
  /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/;
23
+
24
+ // https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184
25
+ const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp(
26
+ [
27
+ // Beginning of a line (per 'm' flag)
28
+ '^',
29
+ // Optional ANSI escapes for colors
30
+ `(?:${ANSI_REGEX})*`,
31
+ // Marker
32
+ '>',
33
+ // Optional ANSI escapes for colors
34
+ `(?:${ANSI_REGEX})*`,
35
+ // Left padding for line number
36
+ ' +',
37
+ // Line number
38
+ '[0-9]+',
39
+ // Gutter
40
+ ' \\|',
41
+ ].join(''),
42
+ 'm',
43
+ );
44
+
20
45
  const BABEL_CODE_FRAME_ERROR_FORMAT =
21
46
  // eslint-disable-next-line no-control-regex
22
47
  /^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u;
48
+
23
49
  const METRO_ERROR_FORMAT =
24
50
  /^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u;
25
51
 
@@ -241,27 +267,31 @@ export function parseLogBoxException(
241
267
  };
242
268
  }
243
269
 
244
- const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
270
+ // Perform a cheap match first before trying to parse the full message, which
271
+ // can get expensive for arbitrary input.
272
+ if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) {
273
+ const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT);
245
274
 
246
- if (babelCodeFrameError) {
247
- // Codeframe errors are thrown from any use of buildCodeFrameError.
248
- const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
249
- return {
250
- level: 'syntax',
251
- stack: [],
252
- isComponentError: false,
253
- componentStack: [],
254
- codeFrame: {
255
- fileName,
256
- location: null, // We are not given the location.
257
- content: codeFrame,
258
- },
259
- message: {
260
- content,
261
- substitutions: [],
262
- },
263
- category: `${fileName}-${1}-${1}`,
264
- };
275
+ if (babelCodeFrameError) {
276
+ // Codeframe errors are thrown from any use of buildCodeFrameError.
277
+ const [fileName, content, codeFrame] = babelCodeFrameError.slice(1);
278
+ return {
279
+ level: 'syntax',
280
+ stack: [],
281
+ isComponentError: false,
282
+ componentStack: [],
283
+ codeFrame: {
284
+ fileName,
285
+ location: null, // We are not given the location.
286
+ content: codeFrame,
287
+ },
288
+ message: {
289
+ content,
290
+ substitutions: [],
291
+ },
292
+ category: `${fileName}-${1}-${1}`,
293
+ };
294
+ }
265
295
  }
266
296
 
267
297
  if (message.match(/^TransformError /)) {
@@ -74,12 +74,13 @@ function LogBoxInspector(props: Props): React.Node {
74
74
  total={logs.length}
75
75
  level={log.level}
76
76
  />
77
- <LogBoxInspectorBody log={log} onRetry={_handleRetry} />
77
+ {/* In the TV repo, place the footer above the body for easier navigation */}
78
78
  <LogBoxInspectorFooter
79
79
  onDismiss={props.onDismiss}
80
80
  onMinimize={props.onMinimize}
81
81
  level={log.level}
82
82
  />
83
+ <LogBoxInspectorBody log={log} onRetry={_handleRetry} />
83
84
  </View>
84
85
  );
85
86
  }
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(11),
26
+ RCTVersionPatch: @(12),
27
27
  RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.11-0
1
+ VERSION_NAME=0.71.12-0
2
2
 
3
3
  # GROUP=com.facebook.react
4
4
  # Group for the TV repo
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 71,
20
- "patch", 11,
20
+ "patch", 12,
21
21
  "prerelease", "0");
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 11;
20
+ int32_t Patch = 12;
21
21
  std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @flow strict
3
+ * @format
4
+ */
5
+
6
+ declare module 'ansi-regex' {
7
+ declare export type Options = {
8
+ /**
9
+ * Match only the first ANSI escape.
10
+ */
11
+ +onlyFirst?: boolean,
12
+ };
13
+ declare export default function ansiRegex(options?: Options): RegExp;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.71.11-0",
3
+ "version": "0.71.12-0",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -126,6 +126,7 @@
126
126
  "@react-native/polyfills": "2.0.0",
127
127
  "abort-controller": "^3.0.0",
128
128
  "anser": "^1.4.9",
129
+ "ansi-regex": "^5.0.0",
129
130
  "base64-js": "^1.1.2",
130
131
  "deprecated-react-native-prop-types": "^3.0.1",
131
132
  "event-target-shim": "^5.0.1",
@@ -196,7 +197,7 @@
196
197
  "mkdirp": "^0.5.1",
197
198
  "mock-fs": "^5.1.4",
198
199
  "prettier": "^2.4.1",
199
- "react-native-core": "npm:react-native@0.71.11",
200
+ "react-native-core": "npm:react-native@0.71.12",
200
201
  "shelljs": "^0.8.5",
201
202
  "signedsource": "^1.0.0",
202
203
  "typescript": "4.1.3",
@@ -352,7 +352,7 @@ class CodegenUtilsTests < Test::Unit::TestCase
352
352
  '[Codegen] warn: using experimental new codegen integration'
353
353
  ])
354
354
  assert_equal(codegen_utils_mock.get_react_codegen_script_phases_params, [{
355
- :app_path => "~/app",
355
+ :app_path => app_path,
356
356
  :config_file_dir => "",
357
357
  :config_key => "codegenConfig",
358
358
  :fabric_enabled => false,
@@ -361,7 +361,7 @@ class CodegenUtilsTests < Test::Unit::TestCase
361
361
  assert_equal(codegen_utils_mock.get_react_codegen_spec_params, [{
362
362
  :fabric_enabled => false,
363
363
  :folly_version=>"2021.07.22.00",
364
- :package_json_file => "../node_modules/react-native/package.json",
364
+ :package_json_file => "#{app_path}/ios/../node_modules/react-native/package.json",
365
365
  :script_phases => "echo TestScript"
366
366
  }])
367
367
  assert_equal(codegen_utils_mock.generate_react_codegen_spec_params, [{
@@ -275,7 +275,7 @@ class CodegenUtils
275
275
  :config_key => config_key
276
276
  )
277
277
  react_codegen_spec = codegen_utils.get_react_codegen_spec(
278
- File.join(react_native_path, "package.json"),
278
+ File.join(relative_installation_root, react_native_path, "package.json"),
279
279
  :folly_version => folly_version,
280
280
  :fabric_enabled => fabric_enabled,
281
281
  :hermes_enabled => hermes_enabled,
Binary file
Binary file
@@ -795,6 +795,8 @@
795
795
  PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOS";
796
796
  PRODUCT_NAME = "$(TARGET_NAME)";
797
797
  SDKROOT = appletvos;
798
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
799
+ SWIFT_VERSION = 5.0;
798
800
  TARGETED_DEVICE_FAMILY = 3;
799
801
  TVOS_DEPLOYMENT_TARGET = 12.4;
800
802
  };
@@ -825,6 +827,7 @@
825
827
  PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOS";
826
828
  PRODUCT_NAME = "$(TARGET_NAME)";
827
829
  SDKROOT = appletvos;
830
+ SWIFT_VERSION = 5.0;
828
831
  TARGETED_DEVICE_FAMILY = 3;
829
832
  TVOS_DEPLOYMENT_TARGET = 12.4;
830
833
  };
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "npm:react-native-tvos@0.71.11-0"
14
+ "react-native": "npm:react-native-tvos@0.71.12-0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
@@ -31,7 +31,7 @@ declare module 'react-native' {
31
31
  nextFocusUp?: number,
32
32
  }
33
33
 
34
- interface View {
34
+ export interface NativeMethods {
35
35
  requestTVFocus(): void;
36
36
  }
37
37