react-native-macos 0.0.0-a45ffbd53 → 0.0.0-a818b5ac1
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/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
- package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
- package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
- package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
- package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
- package/Libraries/Components/View/View.js +8 -10
- package/Libraries/Components/View/ViewAccessibility.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +1 -7
- package/Libraries/Core/ExceptionsManager.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +5 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -0
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/Image/RCTImageView.mm +2 -8
- package/Libraries/LogBox/Data/LogBoxData.js +18 -18
- package/Libraries/Pressability/Pressability.js +1 -0
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
- package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
- package/Libraries/Text/Text/RCTTextView.m +8 -4
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -1
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Types/RootTagTypes.js~merged +23 -0
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
- package/README.md +19 -43
- package/React/Base/RCTBridgeModule.h +1 -1
- package/React/Base/RCTConvert.m +23 -6
- package/React/Base/RCTImageSource.m +2 -0
- package/React/Base/RCTJSStackFrame.m +2 -0
- package/React/Base/RCTJavaScriptLoader.mm +2 -0
- package/React/Base/RCTKeyCommands.m +2 -0
- package/React/Base/RCTModuleData.mm +2 -0
- package/React/Base/RCTModuleMethod.mm +2 -0
- package/React/Base/RCTTouchEvent.m +2 -0
- package/React/Base/RCTVersion.m +5 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
- package/React/CoreModules/RCTActionSheetManager.mm +4 -0
- package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
- package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
- package/React/CoreModules/RCTAlertController.m +8 -4
- package/React/CoreModules/RCTAppearance.mm +22 -23
- package/React/CoreModules/RCTDevLoadingView.mm +14 -9
- package/React/CxxModule/RCTCxxMethod.mm +2 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +12 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
- package/React/Modules/RCTEventEmitter.h +2 -2
- package/React/Modules/RCTLayoutAnimation.m +2 -0
- package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
- package/React/Views/RCTFont.mm +58 -47
- package/React/Views/RCTShadowView.m +3 -1
- package/React/Views/RCTSwitch.h +1 -1
- package/React/Views/RCTSwitch.m +0 -15
- package/React/Views/RCTView.h +5 -2
- package/React/Views/RCTView.m +22 -23
- package/React/Views/RCTViewManager.m +12 -17
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
- package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
- package/React/Views/ScrollView/RCTScrollView.m +1 -5
- package/React-Core.podspec +0 -11
- package/ReactAndroid/build.gradle +9 -3
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
- package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +47 -15
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +2 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
- package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1225 -1481
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +20 -28
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
- package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
- package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
- package/ReactCommon/react/test_utils/BUCK +3 -0
- package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
- package/ReactCommon/react/utils/ContextContainer.h +0 -27
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/jest/preprocessor.js +7 -75
- package/local-cli/cli.js +0 -0
- package/local-cli/generator-macos/templates/macos/Podfile +2 -7
- package/package.json +28 -25
- package/scripts/generate-specs.sh +62 -29
- package/scripts/react-native-xcode.sh +1 -1
- package/scripts/react_native_pods.rb +30 -30
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +2 -0
- package/template/package.json +4 -2
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/CHANGELOG.json +0 -500
- package/CHANGELOG.md +0 -240
- package/Libraries/.npmignore +0 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/React/Base/macOS/RCTDynamicColor.h +0 -28
- package/React/Base/macOS/RCTDynamicColor.m +0 -219
- package/ReactAndroid/.npmignore +0 -5
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
- package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
- package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
- package/scripts/fixmacscripts.sh +0 -9
- package/scripts/postInstall.js +0 -6
package/jest/preprocessor.js
CHANGED
|
@@ -13,42 +13,10 @@
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
15
|
const babelRegisterOnly = require('metro-babel-register');
|
|
16
|
-
const nullthrows = require('nullthrows');
|
|
17
16
|
const createCacheKeyFunction = require('@jest/create-cache-key-function')
|
|
18
17
|
.default;
|
|
19
|
-
const t = require('@babel/types');
|
|
20
|
-
const {statements} = require('@babel/template').default;
|
|
21
18
|
|
|
22
|
-
const
|
|
23
|
-
const importAll = '__importAll__';
|
|
24
|
-
|
|
25
|
-
// prelude
|
|
26
|
-
const importPrelude = statements(`
|
|
27
|
-
function ${importDefault}(moduleId) {
|
|
28
|
-
const exports = require(moduleId);
|
|
29
|
-
|
|
30
|
-
if (exports && exports.__esModule) {
|
|
31
|
-
return exports.default;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return exports;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function ${importAll}(moduleId) {
|
|
38
|
-
const exports = require(moduleId);
|
|
39
|
-
|
|
40
|
-
if (exports && exports.__esModule) {
|
|
41
|
-
return exports;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return Object.assign({}, exports, {default: exports});
|
|
45
|
-
};
|
|
46
|
-
`);
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
transformSync: babelTransformSync,
|
|
50
|
-
transformFromAstSync: babelTransformFromAstSync,
|
|
51
|
-
} = require('@babel/core');
|
|
19
|
+
const {transformSync: babelTransformSync} = require('@babel/core');
|
|
52
20
|
const generate = require('@babel/generator').default;
|
|
53
21
|
|
|
54
22
|
const nodeFiles = new RegExp(
|
|
@@ -73,13 +41,13 @@ module.exports = {
|
|
|
73
41
|
}).code;
|
|
74
42
|
}
|
|
75
43
|
|
|
76
|
-
|
|
44
|
+
const {ast} = transformer.transform({
|
|
77
45
|
filename: file,
|
|
78
46
|
options: {
|
|
79
47
|
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
|
80
48
|
dev: true,
|
|
81
49
|
enableBabelRuntime: false,
|
|
82
|
-
experimentalImportSupport:
|
|
50
|
+
experimentalImportSupport: false,
|
|
83
51
|
globalPrefix: '',
|
|
84
52
|
hot: false,
|
|
85
53
|
inlineRequires: true,
|
|
@@ -111,6 +79,10 @@ module.exports = {
|
|
|
111
79
|
[require('@babel/plugin-transform-regenerator')],
|
|
112
80
|
[require('@babel/plugin-transform-sticky-regex')],
|
|
113
81
|
[require('@babel/plugin-transform-unicode-regex')],
|
|
82
|
+
[
|
|
83
|
+
require('@babel/plugin-transform-modules-commonjs'),
|
|
84
|
+
{strict: false, allowTopLevelThis: true},
|
|
85
|
+
],
|
|
114
86
|
[require('@babel/plugin-transform-classes')],
|
|
115
87
|
[require('@babel/plugin-transform-arrow-functions')],
|
|
116
88
|
[require('@babel/plugin-transform-spread')],
|
|
@@ -127,46 +99,6 @@ module.exports = {
|
|
|
127
99
|
],
|
|
128
100
|
});
|
|
129
101
|
|
|
130
|
-
// We're not using @babel/plugin-transform-modules-commonjs so
|
|
131
|
-
// we need to add 'use strict' manually
|
|
132
|
-
const directives = ast.program.directives;
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
ast.program.sourceType === 'module' &&
|
|
136
|
-
(directives == null ||
|
|
137
|
-
directives.findIndex(d => d.value.value === 'use strict') === -1)
|
|
138
|
-
) {
|
|
139
|
-
ast.program.directives = [
|
|
140
|
-
...(directives || []),
|
|
141
|
-
t.directive(t.directiveLiteral('use strict')),
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Postprocess the transformed module to handle ESM and inline requires.
|
|
146
|
-
// We need to do this in a separate pass to avoid issues tracking references.
|
|
147
|
-
const babelTransformResult = babelTransformFromAstSync(ast, src, {
|
|
148
|
-
ast: true,
|
|
149
|
-
retainLines: true,
|
|
150
|
-
plugins: [
|
|
151
|
-
[
|
|
152
|
-
require('metro-transform-plugins').importExportPlugin,
|
|
153
|
-
{importDefault, importAll},
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
require('babel-preset-fbjs/plugins/inline-requires.js'),
|
|
157
|
-
{inlineableCalls: [importDefault, importAll]},
|
|
158
|
-
],
|
|
159
|
-
],
|
|
160
|
-
sourceType: 'module',
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
ast = nullthrows(babelTransformResult.ast);
|
|
164
|
-
|
|
165
|
-
// Inject import helpers *after* running the inline-requires transform,
|
|
166
|
-
// because otherwise it will assume they are user code and bail out of
|
|
167
|
-
// inlining calls to them.
|
|
168
|
-
ast.program.body.unshift(...importPrelude());
|
|
169
|
-
|
|
170
102
|
return generate(
|
|
171
103
|
ast,
|
|
172
104
|
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
package/local-cli/cli.js
CHANGED
|
File without changes
|
|
@@ -6,12 +6,8 @@ target 'HelloWorld-macOS' do
|
|
|
6
6
|
use_native_modules!
|
|
7
7
|
use_react_native!(
|
|
8
8
|
:path => '../node_modules/react-native-macos',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# $ yarn add 'hermes-engine-darwin@~0.5.3'
|
|
12
|
-
#
|
|
13
|
-
# Then enable this option:
|
|
14
|
-
# :hermes_enabled => true
|
|
9
|
+
# to enable hermes on macOS, change `false` to `true` and then install pods
|
|
10
|
+
:hermes_enabled => false
|
|
15
11
|
)
|
|
16
12
|
|
|
17
13
|
# Pods specifically for macOS target
|
|
@@ -29,7 +25,6 @@ target 'HelloWorld-iOS' do
|
|
|
29
25
|
use_flipper!
|
|
30
26
|
|
|
31
27
|
post_install do |installer|
|
|
32
|
-
flipper_post_install(installer)
|
|
33
28
|
react_native_post_install(installer)
|
|
34
29
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
35
30
|
end
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-a818b5ac1",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "React Native for macOS",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "git@github.com:microsoft/react-native-macos.git",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=14"
|
|
10
10
|
},
|
|
11
11
|
"jest-junit": {
|
|
12
12
|
"outputDirectory": "reports/junit",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"scripts/launchPackager.command",
|
|
48
48
|
"scripts/node-binary.sh",
|
|
49
49
|
"scripts/packager.sh",
|
|
50
|
-
"scripts/postInstall.js",
|
|
51
50
|
"scripts/react_native_pods.rb",
|
|
52
51
|
"scripts/react-native-xcode.sh",
|
|
53
52
|
"template.config.js",
|
|
@@ -83,8 +82,7 @@
|
|
|
83
82
|
"test-android-e2e": "yarn run docker-build-android && yarn run test-android-run-e2e",
|
|
84
83
|
"build-ios-e2e": "detox build -c ios.sim.release",
|
|
85
84
|
"test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
|
|
86
|
-
"test-ios": "./scripts/objc-test.sh test"
|
|
87
|
-
"postinstall": "node scripts/postInstall.js"
|
|
85
|
+
"test-ios": "./scripts/objc-test.sh test"
|
|
88
86
|
},
|
|
89
87
|
"peerDependencies": {
|
|
90
88
|
"react": "17.0.2"
|
|
@@ -123,51 +121,48 @@
|
|
|
123
121
|
"ws": "^6.1.4"
|
|
124
122
|
},
|
|
125
123
|
"devDependencies": {
|
|
126
|
-
"flow-bin": "^0.158.0",
|
|
127
|
-
"react": "17.0.2",
|
|
128
124
|
"@babel/core": "^7.14.0",
|
|
129
125
|
"@babel/generator": "^7.14.0",
|
|
130
126
|
"@babel/template": "^7.0.0",
|
|
131
127
|
"@babel/types": "^7.0.0",
|
|
132
128
|
"@react-native-community/eslint-plugin": "*",
|
|
133
129
|
"@reactions/component": "^2.0.2",
|
|
134
|
-
"async": "^2.
|
|
130
|
+
"async": "^3.2.2",
|
|
135
131
|
"babel-eslint": "^10.1.0",
|
|
136
132
|
"babel-preset-fbjs": "^3.4.0",
|
|
137
133
|
"clang-format": "^1.2.4",
|
|
138
134
|
"connect": "^3.6.5",
|
|
139
135
|
"coveralls": "^3.0.2",
|
|
140
|
-
"detox": "
|
|
141
|
-
"eslint": "7.
|
|
136
|
+
"detox": "18.10.0",
|
|
137
|
+
"eslint": "7.32.0",
|
|
142
138
|
"eslint-config-fb-strict": "^24.9.0",
|
|
143
139
|
"eslint-config-fbjs": "2.1.0",
|
|
144
|
-
"eslint-config-prettier": "^
|
|
140
|
+
"eslint-config-prettier": "^8.3.0",
|
|
145
141
|
"eslint-plugin-babel": "^5.3.0",
|
|
146
|
-
"eslint-plugin-eslint-comments": "^3.
|
|
147
|
-
"eslint-plugin-flowtype": "
|
|
148
|
-
"eslint-plugin-jest": "
|
|
142
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
143
|
+
"eslint-plugin-flowtype": "^7.0.0",
|
|
144
|
+
"eslint-plugin-jest": "^25.2.4",
|
|
149
145
|
"eslint-plugin-jsx-a11y": "6.2.1",
|
|
150
|
-
"eslint-plugin-prettier": "
|
|
151
|
-
"eslint-plugin-react": "7.
|
|
146
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
147
|
+
"eslint-plugin-react": "7.28.0",
|
|
152
148
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
153
|
-
"eslint-plugin-react-native": "3.
|
|
149
|
+
"eslint-plugin-react-native": "^3.11.0",
|
|
154
150
|
"eslint-plugin-relay": "1.8.1",
|
|
151
|
+
"flow-bin": "^0.158.0",
|
|
155
152
|
"jest": "^26.6.3",
|
|
156
153
|
"jest-junit": "^10.0.0",
|
|
157
154
|
"jscodeshift": "^0.11.0",
|
|
158
|
-
"metro-
|
|
155
|
+
"metro-babel-register": "0.66.2",
|
|
156
|
+
"metro-transform-plugins": "^0.66.2",
|
|
159
157
|
"mkdirp": "^0.5.1",
|
|
160
158
|
"prettier": "1.19.1",
|
|
159
|
+
"react": "17.0.2",
|
|
161
160
|
"react-shallow-renderer": "16.14.1",
|
|
162
161
|
"react-test-renderer": "17.0.2",
|
|
163
|
-
"shelljs": "^0.
|
|
162
|
+
"shelljs": "^0.8.5",
|
|
164
163
|
"signedsource": "^1.0.0",
|
|
165
164
|
"ws": "^6.1.4",
|
|
166
|
-
"yargs": "^15.3.1"
|
|
167
|
-
"@typescript-eslint/eslint-plugin": "4.30.0",
|
|
168
|
-
"@typescript-eslint/parser": "4.30.0",
|
|
169
|
-
"hermes-engine-darwin": "~0.5.0",
|
|
170
|
-
"typescript": "4.4.2"
|
|
165
|
+
"yargs": "^15.3.1"
|
|
171
166
|
},
|
|
172
167
|
"detox": {
|
|
173
168
|
"test-runner": "jest",
|
|
@@ -208,5 +203,13 @@
|
|
|
208
203
|
},
|
|
209
204
|
"beachball": {
|
|
210
205
|
"shouldPublish": false
|
|
206
|
+
},
|
|
207
|
+
"resolutions": {
|
|
208
|
+
"async": "^3.2.2",
|
|
209
|
+
"es5-ext": "0.10.53"
|
|
210
|
+
},
|
|
211
|
+
"_justification": {
|
|
212
|
+
"async": "Versions of async prior to 3.2.2 are vulnerable to prototype pollution",
|
|
213
|
+
"es5-ext": "Packages after 0.10.54 and at the moment up until 0.10.59 contain a protest message. A policy prevents us from using packages with protestware, therefore downgrading to the latest release without the message."
|
|
211
214
|
}
|
|
212
215
|
}
|
|
@@ -4,20 +4,12 @@
|
|
|
4
4
|
# This source code is licensed under the MIT license found in the
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
|
-
# This script collects the JavaScript spec definitions for
|
|
7
|
+
# This script collects the JavaScript spec definitions for
|
|
8
8
|
# native modules and components, then uses react-native-codegen
|
|
9
9
|
# to generate native code.
|
|
10
10
|
#
|
|
11
|
-
# Optionally, set these envvars to override defaults:
|
|
12
|
-
# - SRCS_DIR: Path to JavaScript sources
|
|
13
|
-
# - MODULES_LIBRARY_NAME: Defaults to FBReactNativeSpec
|
|
14
|
-
# - MODULES_OUTPUT_DIR: Defaults to React/$MODULES_LIBRARY_NAME/$MODULES_LIBRARY_NAME
|
|
15
|
-
# - COMPONENTS_LIBRARY_NAME: Defaults to rncore
|
|
16
|
-
# - COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$COMPONENTS_LIBRARY_NAME
|
|
17
|
-
#
|
|
18
11
|
# Usage:
|
|
19
12
|
# ./scripts/generate-specs.sh
|
|
20
|
-
# SRCS_DIR=myapp/js MODULES_LIBRARY_NAME=MySpecs MODULES_OUTPUT_DIR=myapp/MySpecs ./scripts/generate-specs.sh
|
|
21
13
|
#
|
|
22
14
|
|
|
23
15
|
# shellcheck disable=SC2038
|
|
@@ -44,27 +36,45 @@ describe () {
|
|
|
44
36
|
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1" >&2
|
|
45
37
|
}
|
|
46
38
|
|
|
39
|
+
print_usage () {
|
|
40
|
+
printf "\\nNAME\\n\\t%s -- generate specs\\n" "$1" >&2
|
|
41
|
+
printf "\\nSYNOPSIS\\n" >&2
|
|
42
|
+
printf "\\t%s javascript_sources_directory specs_library_name output_directory\\n" "$1" >&2
|
|
43
|
+
printf "\\t%s javascript_sources_directory specs_library_name output_directory component_library_name [component_output_directory]\\n" "$1" >&2
|
|
44
|
+
printf "\\n\\nDESCRIPTION\\n\\tIn the first synopsis form, this script collects native module and native component JavaScript spec definitions in javascript_sources_directory, then uses react-native-codegen to generate the native interface code into a library named specs_library_name, which is copied to the destination output_directory.\\n" >&2
|
|
45
|
+
printf "\\n\\tIn the second synopsis form, the component_library_name will be used as the name of the component native interface code library. If provided, the component output will be copied to the component_output_directory, otherwise it will be copied to the output_directory.\\n" >&2
|
|
46
|
+
}
|
|
47
|
+
|
|
47
48
|
main() {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
MIN_ARG_NUM=3
|
|
50
|
+
if [ "$#" -eq 0 ]; then
|
|
51
|
+
print_usage "$0"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
if [ -z "$NODE_BINARY" ]; then
|
|
56
|
+
echo "Error: Could not find node. Make sure it is in bash PATH or set the NODE_BINARY environment variable." 1>&2
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
if [ "$#" -lt "$MIN_ARG_NUM" ]; then
|
|
61
|
+
echo "Error: Expected $MIN_ARG_NUM arguments, got $# instead. Run $0 with no arguments to learn more." 1>&2
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
50
64
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
SRCS_DIR=$1
|
|
66
|
+
LIBRARY_NAME=$2
|
|
67
|
+
OUTPUT_DIR=$3
|
|
68
|
+
COMPONENT_LIBRARY_NAME_OVERRIDE=$4
|
|
69
|
+
COMPONENT_OUTPUT_DIR_OVERRIDE=$5
|
|
56
70
|
|
|
71
|
+
PLATFORM="ios"
|
|
57
72
|
TEMP_OUTPUT_DIR="$TEMP_DIR/out"
|
|
58
73
|
SCHEMA_FILE="$TEMP_DIR/schema.json"
|
|
59
74
|
|
|
60
75
|
CODEGEN_REPO_PATH="$RN_DIR/packages/react-native-codegen"
|
|
61
76
|
CODEGEN_NPM_PATH="$RN_DIR/../react-native-codegen"
|
|
62
77
|
|
|
63
|
-
if [ -z "$NODE_BINARY" ]; then
|
|
64
|
-
echo "Error: Could not find node. Make sure it is in bash PATH or set the NODE_BINARY environment variable." 1>&2
|
|
65
|
-
exit 1
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
78
|
if [ -d "$CODEGEN_REPO_PATH" ]; then
|
|
69
79
|
CODEGEN_PATH=$(cd "$CODEGEN_REPO_PATH" && pwd)
|
|
70
80
|
elif [ -d "$CODEGEN_NPM_PATH" ]; then
|
|
@@ -82,15 +92,38 @@ main() {
|
|
|
82
92
|
describe "Generating schema from Flow types"
|
|
83
93
|
"$NODE_BINARY" "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
|
|
84
94
|
|
|
85
|
-
describe "Generating native code from schema (
|
|
86
|
-
pushd "$RN_DIR" >/dev/null
|
|
87
|
-
"$NODE_BINARY" scripts/generate-specs-cli.js
|
|
88
|
-
popd >/dev/null
|
|
95
|
+
describe "Generating native code from schema ($PLATFORM)"
|
|
96
|
+
pushd "$RN_DIR" >/dev/null
|
|
97
|
+
"$NODE_BINARY" scripts/generate-specs-cli.js "$PLATFORM" "$SCHEMA_FILE" "$TEMP_OUTPUT_DIR" "$LIBRARY_NAME"
|
|
98
|
+
popd >/dev/null
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
mkdir -p "$OUTPUT_DIR"
|
|
89
102
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
103
|
+
if [ -z "$COMPONENT_LIBRARY_NAME_OVERRIDE" ]; then
|
|
104
|
+
# Copy all output to output_dir
|
|
105
|
+
cp -R "$TEMP_OUTPUT_DIR/" "$OUTPUT_DIR"
|
|
106
|
+
echo >&2 "$LIBRARY_NAME output has been written to $OUTPUT_DIR:"
|
|
107
|
+
ls -1 "$OUTPUT_DIR" 2>&1
|
|
108
|
+
else
|
|
109
|
+
# Copy modules output to output_dir
|
|
110
|
+
cp "$TEMP_OUTPUT_DIR/$LIBRARY_NAME.h" "$TEMP_OUTPUT_DIR/$LIBRARY_NAME-generated.mm" "$OUTPUT_DIR"
|
|
111
|
+
echo >&2 "$LIBRARY_NAME output has been written to $OUTPUT_DIR:"
|
|
112
|
+
ls -1 "$OUTPUT_DIR" 2>&1
|
|
113
|
+
|
|
114
|
+
# Rename library name used in components output files
|
|
115
|
+
find "$TEMP_OUTPUT_DIR" -type f | xargs sed -i.bak "s/$LIBRARY_NAME/$COMPONENT_LIBRARY_NAME_OVERRIDE/g"
|
|
116
|
+
|
|
117
|
+
if [ -n "$COMPONENT_OUTPUT_DIR_OVERRIDE" ]; then
|
|
118
|
+
# Components codegen output to be moved to separate directory
|
|
119
|
+
mkdir -p "$COMPONENT_OUTPUT_DIR_OVERRIDE"
|
|
120
|
+
OUTPUT_DIR="$COMPONENT_OUTPUT_DIR_OVERRIDE"
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
find "$TEMP_OUTPUT_DIR" -type f -not -iname "$LIBRARY_NAME.h" -not -iname "$LIBRARY_NAME-generated.mm" -not -iname "*.bak" -exec cp '{}' "$OUTPUT_DIR/" ';'
|
|
124
|
+
echo >&2 "$COMPONENT_LIBRARY_NAME_OVERRIDE output has been written to $OUTPUT_DIR:"
|
|
125
|
+
ls -1 "$OUTPUT_DIR" 2>&1
|
|
126
|
+
fi
|
|
94
127
|
|
|
95
128
|
echo >&2 'Done.'
|
|
96
129
|
}
|
|
@@ -164,38 +164,38 @@ def use_react_native_codegen!(spec, options={})
|
|
|
164
164
|
js_srcs = options[:js_srcs_dir] ||= "#{prefix}/Libraries"
|
|
165
165
|
|
|
166
166
|
# Library name (e.g. FBReactNativeSpec)
|
|
167
|
-
|
|
167
|
+
library_name = options[:library_name] ||= "#{spec.name}Spec"
|
|
168
168
|
|
|
169
169
|
# Output dir, relative to podspec that invoked this method
|
|
170
|
-
|
|
170
|
+
output_dir = options[:output_dir] ||= "#{prefix}/React/#{library_name}"
|
|
171
171
|
|
|
172
|
-
generated_dirs = [
|
|
173
|
-
generated_filenames = [ "#{
|
|
174
|
-
generated_files = generated_filenames.map { |filename| "#{
|
|
172
|
+
generated_dirs = [ "#{output_dir}/#{library_name}" ]
|
|
173
|
+
generated_filenames = [ "#{library_name}.h", "#{library_name}-generated.mm" ]
|
|
174
|
+
generated_files = generated_filenames.map { |filename| "#{output_dir}/#{library_name}/#{filename}" }
|
|
175
175
|
|
|
176
176
|
# Run the codegen as part of the Xcode build pipeline.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
177
|
+
codegen_script_args = [ "'${PODS_TARGET_SRCROOT}/#{js_srcs}'" ]
|
|
178
|
+
codegen_script_args.push "'#{library_name}'"
|
|
179
|
+
codegen_script_args.push "'${PODS_TARGET_SRCROOT}/#{output_dir}/#{library_name}'"
|
|
180
|
+
|
|
181
|
+
# We use a different library name for components, as well as an additional set of files.
|
|
182
|
+
# Eventually, we want these to be part of the same library as #{library_name} above.
|
|
183
|
+
component_library_name = options[:component_library_name] ||= library_name
|
|
184
|
+
component_output_dir = options[:component_output_dir] ||= output_dir
|
|
185
|
+
generated_dirs.push "#{component_output_dir}/#{component_library_name}"
|
|
186
|
+
codegen_script_args.push "'#{component_library_name}'"
|
|
187
|
+
codegen_script_args.push "'${PODS_TARGET_SRCROOT}/#{component_output_dir}/#{component_library_name}'"
|
|
188
|
+
components_generated_filenames = [
|
|
189
|
+
"ComponentDescriptors.h",
|
|
190
|
+
"EventEmitters.cpp",
|
|
191
|
+
"EventEmitters.h",
|
|
192
|
+
"Props.cpp",
|
|
193
|
+
"Props.h",
|
|
194
|
+
"RCTComponentViewHelpers.h",
|
|
195
|
+
"ShadowNodes.cpp",
|
|
196
|
+
"ShadowNodes.h"
|
|
197
|
+
]
|
|
198
|
+
generated_files = generated_files.concat(components_generated_filenames.map { |filename| "#{component_output_dir}/#{component_library_name}/#{filename}" })
|
|
199
199
|
|
|
200
200
|
# Prepare filesystem by creating empty files that will be picked up as references by CocoaPods.
|
|
201
201
|
prepare_command = "mkdir -p #{generated_dirs.join(" ")} && touch -a #{generated_files.join(" ")}"
|
|
@@ -205,11 +205,11 @@ def use_react_native_codegen!(spec, options={})
|
|
|
205
205
|
spec.script_phase = {
|
|
206
206
|
:name => 'Generate Specs',
|
|
207
207
|
:input_files => [ "${PODS_TARGET_SRCROOT}/#{js_srcs}" ], # This also needs to be relative to Xcode
|
|
208
|
-
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{
|
|
208
|
+
:output_files => ["${DERIVED_FILE_DIR}/codegen-#{library_name}.log"].concat(generated_files.map { |filename| " ${PODS_TARGET_SRCROOT}/#{filename}"} ),
|
|
209
209
|
# The final generated files will be created when this script is invoked at Xcode build time.
|
|
210
210
|
:script => %{set -o pipefail
|
|
211
211
|
|
|
212
|
-
bash -l -c '
|
|
212
|
+
bash -l -c '$\{PODS_TARGET_SRCROOT\}/#{prefix}/scripts/generate-specs.sh #{codegen_script_args.join(" ")}' 2>&1 | tee "${SCRIPT_OUTPUT_FILE_0}"
|
|
213
213
|
},
|
|
214
214
|
:execution_position => :before_compile,
|
|
215
215
|
:show_env_vars_in_log => true
|
|
@@ -246,7 +246,7 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer)
|
|
|
246
246
|
|
|
247
247
|
# But... doing so caused another issue in Flipper:
|
|
248
248
|
# "Time.h:52:17: error: typedef redefinition with different types"
|
|
249
|
-
# We need to make a patch to RCT-Folly -
|
|
249
|
+
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
|
|
250
250
|
# See https://github.com/facebook/flipper/issues/834 for more details.
|
|
251
251
|
`sed -i -e $'s/VERSION_MIN_REQUIRED </VERSION_MIN_REQUIRED >=/' #{installer.sandbox.root}/RCT-Folly/folly/portability/Time.h`
|
|
252
252
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
@@ -439,6 +439,7 @@
|
|
|
439
439
|
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
|
440
440
|
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
|
|
441
441
|
"\"$(inherited)\"",
|
|
442
|
+
"\"$(SDKROOT)/usr/lib/swift\"",
|
|
442
443
|
);
|
|
443
444
|
MTL_ENABLE_DEBUG_INFO = YES;
|
|
444
445
|
ONLY_ACTIVE_ARCH = YES;
|
|
@@ -497,6 +498,7 @@
|
|
|
497
498
|
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
|
|
498
499
|
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
|
|
499
500
|
"\"$(inherited)\"",
|
|
501
|
+
"\"$(SDKROOT)/usr/lib/swift\"",
|
|
500
502
|
);
|
|
501
503
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
502
504
|
SDKROOT = iphoneos;
|
package/template/package.json
CHANGED
|
@@ -5,20 +5,22 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "react-native run-android",
|
|
7
7
|
"ios": "react-native run-ios",
|
|
8
|
+
"macos": "react-native run-macos",
|
|
8
9
|
"start": "react-native start",
|
|
9
10
|
"test": "jest",
|
|
10
11
|
"lint": "eslint ."
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"react": "17.0.2",
|
|
14
|
-
"react-native": "
|
|
15
|
+
"react-native-macos": "1000.0.0",
|
|
16
|
+
"react-native": "0.0.0-a818b5ac1"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
17
19
|
"@babel/core": "^7.12.9",
|
|
18
20
|
"@babel/runtime": "^7.12.5",
|
|
19
21
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
20
22
|
"babel-jest": "^26.6.3",
|
|
21
|
-
"eslint": "7.
|
|
23
|
+
"eslint": "^7.32.0",
|
|
22
24
|
"jest": "^26.6.3",
|
|
23
25
|
"metro-react-native-babel-preset": "^0.66.2",
|
|
24
26
|
"react-test-renderer": "17.0.2"
|
|
@@ -40,7 +40,7 @@ Pod::Spec.new do |spec|
|
|
|
40
40
|
'folly/hash/SpookyHashV2.cpp',
|
|
41
41
|
'folly/lang/Assume.cpp',
|
|
42
42
|
'folly/lang/CString.cpp',
|
|
43
|
-
|
|
43
|
+
'folly/lang/Exception.cpp',
|
|
44
44
|
'folly/memory/detail/MallocImpl.cpp',
|
|
45
45
|
'folly/net/NetOps.cpp',
|
|
46
46
|
'folly/portability/SysUio.cpp',
|