react-native-macos 0.0.0-5ad4444cf → 0.0.0-5cd43232a

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.
Files changed (88) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  3. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  4. package/Libraries/Components/Button.js +1 -1
  5. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  6. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  7. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  8. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  9. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  10. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  11. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  12. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  13. package/Libraries/Components/View/View.js +8 -10
  14. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  15. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  16. package/Libraries/Core/ReactNativeVersion.js +5 -1
  17. package/Libraries/Image/RCTImageView.mm +2 -8
  18. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  19. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  20. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  21. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  22. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  23. package/Libraries/Text/Text/RCTTextView.m +8 -4
  24. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  25. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  26. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  27. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +9 -0
  28. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  29. package/README.md +19 -43
  30. package/React/Base/RCTBridgeModule.h +1 -1
  31. package/React/Base/RCTConvert.m +23 -6
  32. package/React/Base/RCTImageSource.m +2 -0
  33. package/React/Base/RCTJSStackFrame.m +2 -0
  34. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  35. package/React/Base/RCTKeyCommands.m +2 -0
  36. package/React/Base/RCTModuleData.mm +2 -0
  37. package/React/Base/RCTModuleMethod.mm +2 -0
  38. package/React/Base/RCTTouchEvent.m +2 -0
  39. package/React/Base/RCTVersion.m +5 -1
  40. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  41. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  42. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  43. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  44. package/React/CoreModules/RCTAlertController.m +8 -4
  45. package/React/CoreModules/RCTAppearance.mm +22 -23
  46. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  47. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  48. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  49. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  50. package/React/Modules/RCTEventEmitter.h +2 -2
  51. package/React/Modules/RCTLayoutAnimation.m +2 -0
  52. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  53. package/React/Views/RCTShadowView.m +3 -1
  54. package/React/Views/RCTSwitch.h +1 -1
  55. package/React/Views/RCTSwitch.m +0 -15
  56. package/React/Views/RCTView.h +5 -2
  57. package/React/Views/RCTView.m +22 -10
  58. package/React/Views/RCTViewManager.m +9 -15
  59. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  60. package/React-Core.podspec +0 -11
  61. package/ReactAndroid/gradle.properties +1 -1
  62. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  63. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  64. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  65. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  66. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  67. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
  68. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  69. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  70. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  71. package/jest/preprocessor.js +7 -75
  72. package/local-cli/cli.js +0 -0
  73. package/local-cli/generator-macos/templates/macos/Podfile +2 -7
  74. package/package.json +18 -23
  75. package/scripts/react-native-xcode.sh +1 -1
  76. package/scripts/react_native_pods.rb +1 -1
  77. package/template/package.json +4 -2
  78. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  79. package/CHANGELOG.json +0 -500
  80. package/CHANGELOG.md +0 -240
  81. package/Libraries/.npmignore +0 -1
  82. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  83. package/React/Base/macOS/RCTDynamicColor.m +0 -219
  84. package/ReactAndroid/.npmignore +0 -5
  85. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  86. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  87. package/scripts/fixmacscripts.sh +0 -9
  88. package/scripts/postInstall.js +0 -6
@@ -14,11 +14,15 @@
14
14
 
15
15
  namespace facebook::react {
16
16
 
17
+ // [TODO(macOS GH#944)
18
+ // Note: Be careful not to override these version numbers
19
+ // when we merge upstream stable branches into main
20
+ // TODO(macOS GH#944)]
17
21
  constexpr struct {
18
22
  int32_t Major = 0;
19
23
  int32_t Minor = 0;
20
24
  int32_t Patch = 0;
21
- std::string_view Prerelease = "5ad4444cf";
25
+ std::string_view Prerelease = "5cd43232a";
22
26
  } ReactNativeVersion;
23
27
 
24
28
  } // namespace facebook::react
@@ -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 importDefault = '__importDefault__';
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
- let {ast} = transformer.transform({
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: true,
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
- # To use Hermes, install the `hermes-engine-darwin` npm package, e.g.:
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-5ad4444cf",
3
+ "version": "0.0.0-5cd43232a",
4
4
  "bin": "./cli.js",
5
- "description": "[Microsoft Fork] A framework for building native apps using React",
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": ">=12"
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,8 +121,6 @@
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",
@@ -137,37 +133,36 @@
137
133
  "clang-format": "^1.2.4",
138
134
  "connect": "^3.6.5",
139
135
  "coveralls": "^3.0.2",
140
- "detox": "16.7.2",
141
- "eslint": "7.12.0",
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": "^6.0.0",
140
+ "eslint-config-prettier": "^8.3.0",
145
141
  "eslint-plugin-babel": "^5.3.0",
146
- "eslint-plugin-eslint-comments": "^3.1.1",
147
- "eslint-plugin-flowtype": "2.50.3",
148
- "eslint-plugin-jest": "22.4.1",
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": "2.6.2",
151
- "eslint-plugin-react": "7.21.5",
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.10.0",
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",
155
+ "metro-babel-register": "0.66.2",
158
156
  "metro-transform-plugins": "^0.66.0",
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.7.8",
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",
@@ -83,7 +83,7 @@ fi
83
83
 
84
84
  # Find path to Node
85
85
  # shellcheck source=/dev/null
86
- source "$RN_DIR/scripts/find-node.sh"
86
+ source "$REACT_NATIVE_DIR/scripts/find-node.sh"
87
87
 
88
88
  # check and assign NODE_BINARY env
89
89
  # shellcheck source=/dev/null
@@ -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 - set `__IPHONE_10_0` to our iOS target + 1.
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
@@ -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": "0.0.0-5ad4444cf"
15
+ "react-native-macos": "1000.0.0",
16
+ "react-native": "0.0.0-5cd43232a"
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.14.0",
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
- # 'folly/lang/Exception.cpp', # TODO(macOS GH#214) later versions of boost don't support macOS, revert this back to upstream when fixed
43
+ 'folly/lang/Exception.cpp',
44
44
  'folly/memory/detail/MallocImpl.cpp',
45
45
  'folly/net/NetOps.cpp',
46
46
  'folly/portability/SysUio.cpp',