react-native 0.72.7 → 0.72.8
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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +50 -20
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerRegistry.java +22 -6
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/flow-typed/npm/ansi-regex_v5.x.x.js +14 -0
- package/package.json +3 -2
- package/scripts/cocoapods/__tests__/codegen-test.rb +10 -11
- package/scripts/cocoapods/codegen.rb +5 -16
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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 /)) {
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -429,6 +429,7 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
|
|
429
429
|
mEventDispatcher.unregisterEventEmitter(FABRIC);
|
|
430
430
|
|
|
431
431
|
mReactApplicationContext.unregisterComponentCallbacks(mViewManagerRegistry);
|
|
432
|
+
mViewManagerRegistry.invalidate();
|
|
432
433
|
|
|
433
434
|
// Remove lifecycle listeners (onHostResume, onHostPause) since the FabricUIManager is going
|
|
434
435
|
// away. Then stop the mDispatchUIFrameCallback false will cause the choreographer
|
|
@@ -103,12 +103,28 @@ public final class ViewManagerRegistry implements ComponentCallbacks2 {
|
|
|
103
103
|
viewManagers = new ArrayList<>(mViewManagers.values());
|
|
104
104
|
}
|
|
105
105
|
Runnable runnable =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
() -> {
|
|
107
|
+
for (ViewManager viewManager : viewManagers) {
|
|
108
|
+
viewManager.onSurfaceStopped(surfaceId);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
if (UiThreadUtil.isOnUiThread()) {
|
|
112
|
+
runnable.run();
|
|
113
|
+
} else {
|
|
114
|
+
UiThreadUtil.runOnUiThread(runnable);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Called on instance destroy */
|
|
119
|
+
public void invalidate() {
|
|
120
|
+
final List<ViewManager> viewManagers;
|
|
121
|
+
synchronized (this) {
|
|
122
|
+
viewManagers = new ArrayList<>(mViewManagers.values());
|
|
123
|
+
}
|
|
124
|
+
Runnable runnable =
|
|
125
|
+
() -> {
|
|
126
|
+
for (ViewManager viewManager : viewManagers) {
|
|
127
|
+
viewManager.invalidate();
|
|
112
128
|
}
|
|
113
129
|
};
|
|
114
130
|
if (UiThreadUtil.isOnUiThread()) {
|
|
@@ -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",
|
|
3
|
-
"version": "0.72.
|
|
3
|
+
"version": "0.72.8",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@react-native-community/cli-platform-android": "11.3.10",
|
|
84
84
|
"@react-native-community/cli-platform-ios": "11.3.10",
|
|
85
85
|
"@react-native/assets-registry": "^0.72.0",
|
|
86
|
-
"@react-native/codegen": "^0.72.
|
|
86
|
+
"@react-native/codegen": "^0.72.8",
|
|
87
87
|
"@react-native/gradle-plugin": "^0.72.11",
|
|
88
88
|
"@react-native/js-polyfills": "^0.72.1",
|
|
89
89
|
"@react-native/normalize-colors": "^0.72.0",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"anser": "^1.4.9",
|
|
93
93
|
"base64-js": "^1.1.2",
|
|
94
94
|
"deprecated-react-native-prop-types": "^4.2.3",
|
|
95
|
+
"ansi-regex": "^5.0.0",
|
|
95
96
|
"event-target-shim": "^5.0.1",
|
|
96
97
|
"flow-enums-runtime": "^0.0.5",
|
|
97
98
|
"invariant": "^2.2.4",
|
|
@@ -68,7 +68,7 @@ class CodegenTests < Test::Unit::TestCase
|
|
|
68
68
|
assert_equal(Pod::Executable.executed_commands.length, 0)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
def
|
|
71
|
+
def testCheckAndGenerateEmptyThirdPartyProvider_whenHeaderMissingAndCodegenMissing_dontBuildCodegen()
|
|
72
72
|
|
|
73
73
|
# Arrange
|
|
74
74
|
FileMock.mocked_existing_files([
|
|
@@ -76,7 +76,7 @@ class CodegenTests < Test::Unit::TestCase
|
|
|
76
76
|
])
|
|
77
77
|
|
|
78
78
|
# Act
|
|
79
|
-
|
|
79
|
+
assert_nothing_raised {
|
|
80
80
|
checkAndGenerateEmptyThirdPartyProvider!(@prefix, false, dir_manager: DirMock, file_manager: FileMock)
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -84,16 +84,16 @@ class CodegenTests < Test::Unit::TestCase
|
|
|
84
84
|
assert_equal(Pathname.pwd_invocation_count, 1)
|
|
85
85
|
assert_equal(Pod::Config.instance.installation_root.relative_path_from_invocation_count, 1)
|
|
86
86
|
assert_equal(FileMock.exist_invocation_params, [
|
|
87
|
-
@prefix + "/React/Fabric/" + @third_party_provider_header
|
|
87
|
+
@prefix + "/React/Fabric/" + @third_party_provider_header,
|
|
88
|
+
@prefix + "/React/Fabric/tmpSchemaList.txt",
|
|
88
89
|
])
|
|
89
90
|
assert_equal(DirMock.exist_invocation_params, [
|
|
90
91
|
@base_path + "/"+ @prefix + "/../react-native-codegen",
|
|
91
|
-
@base_path + "/"+ @prefix + "/../@react-native/codegen",
|
|
92
92
|
])
|
|
93
|
-
assert_equal(Pod::UI.collected_messages, [])
|
|
93
|
+
assert_equal(Pod::UI.collected_messages, ["[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider"])
|
|
94
94
|
assert_equal($collected_commands, [])
|
|
95
|
-
assert_equal(FileMock.open_files.length,
|
|
96
|
-
assert_equal(Pod::Executable.executed_commands.length,
|
|
95
|
+
assert_equal(FileMock.open_files.length, 1)
|
|
96
|
+
assert_equal(Pod::Executable.executed_commands.length, 1)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def testCheckAndGenerateEmptyThirdPartyProvider_whenImplementationMissingAndCodegenrepoExists_dontBuildCodegen()
|
|
@@ -145,7 +145,7 @@ class CodegenTests < Test::Unit::TestCase
|
|
|
145
145
|
|
|
146
146
|
def testCheckAndGenerateEmptyThirdPartyProvider_whenBothMissing_buildCodegen()
|
|
147
147
|
# Arrange
|
|
148
|
-
codegen_cli_path = @base_path + "/" + @prefix + "
|
|
148
|
+
codegen_cli_path = @base_path + "/" + @prefix + "/../react-native-codegen"
|
|
149
149
|
DirMock.mocked_existing_dirs([
|
|
150
150
|
codegen_cli_path,
|
|
151
151
|
])
|
|
@@ -160,15 +160,14 @@ class CodegenTests < Test::Unit::TestCase
|
|
|
160
160
|
@prefix + "/React/Fabric/" + @tmp_schema_list_file
|
|
161
161
|
])
|
|
162
162
|
assert_equal(DirMock.exist_invocation_params, [
|
|
163
|
-
@base_path + "/" + @prefix + "/../react-native-codegen",
|
|
164
163
|
codegen_cli_path,
|
|
165
164
|
codegen_cli_path + "/lib",
|
|
166
165
|
])
|
|
167
166
|
assert_equal(Pod::UI.collected_messages, [
|
|
168
|
-
"[Codegen] building #{codegen_cli_path}
|
|
167
|
+
"[Codegen] building #{codegen_cli_path}",
|
|
169
168
|
"[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider"
|
|
170
169
|
])
|
|
171
|
-
assert_equal($collected_commands, ["~/app/ios
|
|
170
|
+
assert_equal($collected_commands, ["~/app/ios/../../../react-native-codegen/scripts/oss/build.sh"])
|
|
172
171
|
assert_equal(FileMock.open_files[0].collected_write, ["[]"])
|
|
173
172
|
assert_equal(FileMock.open_files[0].fsync_invocation_count, 1)
|
|
174
173
|
assert_equal(Pod::Executable.executed_commands[0], {
|
|
@@ -11,23 +11,12 @@
|
|
|
11
11
|
# - dir_manager: a class that implements the `Dir` interface. Defaults to `Dir`, the Dependency can be injected for testing purposes.
|
|
12
12
|
# @throws an error if it could not find the codegen folder.
|
|
13
13
|
def build_codegen!(react_native_path, relative_installation_root, dir_manager: Dir)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
codegen_cli_path = ""
|
|
14
|
+
codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen";
|
|
15
|
+
return unless dir_manager.exist?(codegen_repo_path) && !dir_manager.exist?("#{codegen_repo_path}/lib")
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
codegen_cli_path = codegen_npm_path
|
|
22
|
-
else
|
|
23
|
-
raise "[codegen] Could not find react-native-codegen."
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
if !dir_manager.exist?("#{codegen_cli_path}/lib")
|
|
27
|
-
Pod::UI.puts "[Codegen] building #{codegen_cli_path}."
|
|
28
|
-
system("#{codegen_cli_path}/scripts/oss/build.sh")
|
|
29
|
-
end
|
|
30
|
-
end
|
|
17
|
+
Pod::UI.puts "[Codegen] building #{codegen_repo_path}"
|
|
18
|
+
system("#{codegen_repo_path}/scripts/oss/build.sh")
|
|
19
|
+
end
|
|
31
20
|
|
|
32
21
|
# It generates an empty `ThirdPartyProvider`, required by Fabric to load the components
|
|
33
22
|
#
|
|
Binary file
|
|
Binary file
|