react-native-macos 0.76.6 → 0.76.7

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 (91) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -5
  2. package/Libraries/AppDelegate/RCTAppSetupUtils.h +1 -1
  3. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +4 -2
  4. package/Libraries/AppDelegate/RCTRootViewFactory.mm +2 -3
  5. package/Libraries/Core/ReactNativeVersion.js +1 -1
  6. package/Libraries/Image/RCTImageLoader.mm +9 -1
  7. package/Libraries/Image/RCTImageView.mm +5 -0
  8. package/Libraries/Image/RCTImageViewManager.mm +4 -0
  9. package/Libraries/Network/RCTDataRequestHandler.mm +10 -3
  10. package/Libraries/Network/RCTFileRequestHandler.mm +11 -4
  11. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +3 -1
  12. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +2 -1
  13. package/Libraries/Utilities/Appearance.js +3 -1
  14. package/React/Base/RCTRootView.m +58 -0
  15. package/React/Base/RCTTouchHandler.m +6 -5
  16. package/React/Base/RCTUIKit.h +4 -1
  17. package/React/Base/RCTVersion.m +1 -1
  18. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +2 -5
  19. package/React/Base/macOS/RCTUIKit.m +9 -2
  20. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2354 -0
  21. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2820 -0
  22. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -1
  23. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +8 -18
  24. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +3 -0
  25. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +17 -18
  26. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +16 -5
  27. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +14 -11
  28. package/React/Views/RCTFont.h +2 -0
  29. package/React/Views/RCTFont.mm +4 -5
  30. package/React/Views/RCTView.m +2 -11
  31. package/React/Views/ScrollView/RCTScrollView.h +3 -1
  32. package/React/Views/ScrollView/RCTScrollView.m +8 -0
  33. package/React/Views/UIView+React.m +5 -2
  34. package/ReactAndroid/api/ReactAndroid.api +4 -0
  35. package/ReactAndroid/cmake-utils/ReactNative-application.cmake +18 -3
  36. package/ReactAndroid/gradle.properties +1 -1
  37. package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java +12 -13
  38. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +8 -2
  39. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +15 -8
  40. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
  41. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  42. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  43. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  44. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  45. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  46. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +11 -3
  48. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +11 -3
  49. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +25 -0
  50. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +16 -2
  51. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +1 -0
  52. package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +17 -19
  53. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  54. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  55. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  56. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  57. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
  58. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +47 -65
  59. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  60. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  61. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  62. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +9 -0
  63. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  64. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  65. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +5 -0
  66. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +2 -0
  67. package/ReactCommon/react/renderer/attributedstring/conversions.h +5 -0
  68. package/ReactCommon/react/renderer/components/rncore/Props.cpp +1 -1
  69. package/ReactCommon/react/renderer/components/rncore/Props.h +16 -12
  70. package/ReactCommon/react/renderer/components/rncore/States.h +0 -26
  71. package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +12 -0
  72. package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +2 -3
  73. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +8 -4
  74. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +31 -11
  75. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +2 -2
  76. package/ReactCommon/react/renderer/uimanager/UIManager.cpp +29 -8
  77. package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
  78. package/ReactCommon/react/runtime/ReactInstance.h +2 -1
  79. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
  80. package/gradle/libs.versions.toml +1 -1
  81. package/jest/setup.js +5 -1
  82. package/package.json +8 -8
  83. package/scripts/cocoapods/new_architecture.rb +1 -1
  84. package/scripts/cocoapods/utils.rb +6 -6
  85. package/scripts/codegen/generate-artifacts-executor.js +68 -7
  86. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
  87. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
  88. package/Libraries/AddressSanitizerCrash/AddressSanitizerCrash.js +0 -13
  89. package/Libraries/AddressSanitizerCrash/NativeAddressSanitizerCrash.js +0 -19
  90. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +0 -12
  91. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +0 -18
@@ -154,6 +154,7 @@ function extractLibrariesFromJSON(configFile, dependencyPath) {
154
154
  const config = configFile.codegenConfig;
155
155
  return [
156
156
  {
157
+ libraryName: configFile.name,
157
158
  config,
158
159
  libraryPath: dependencyPath,
159
160
  },
@@ -253,19 +254,23 @@ function findExternalLibraries(pkgJson, projectRoot) {
253
254
  });
254
255
  }
255
256
 
256
- function findLibrariesFromReactNativeConfig(projectRoot) {
257
+ function readRNConfigJSFile(projectRoot) {
257
258
  const rnConfigFileName = 'react-native.config.js';
258
259
 
259
- console.log(
260
- `\n\n[Codegen] >>>>> Searching for codegen-enabled libraries in ${rnConfigFileName}`,
261
- );
262
-
263
260
  const rnConfigFilePath = path.resolve(projectRoot, rnConfigFileName);
264
261
 
265
262
  if (!fs.existsSync(rnConfigFilePath)) {
266
263
  return [];
267
264
  }
268
- const rnConfig = require(rnConfigFilePath);
265
+ return require(rnConfigFilePath);
266
+ }
267
+
268
+ function findLibrariesFromReactNativeConfig(projectRoot) {
269
+ console.log(
270
+ `\n\n[Codegen] >>>>> Searching for codegen-enabled libraries in react-native.config.js`,
271
+ );
272
+
273
+ const rnConfig = readRNConfigJSFile(projectRoot);
269
274
 
270
275
  if (rnConfig.dependencies == null) {
271
276
  return [];
@@ -291,6 +296,48 @@ function findLibrariesFromReactNativeConfig(projectRoot) {
291
296
  });
292
297
  }
293
298
 
299
+ // Function to look for libraries explicitly unlinked from the app
300
+ // through the react-native.config.js file.
301
+ // If this happens, it might be that the app does not need
302
+ // to generate code for that library as it won't be used by that platform
303
+ // @return { [libraryName: string]: [platform: string] }
304
+ function findNotLinkedLibraries(projectRoot) {
305
+ const rnConfig = readRNConfigJSFile(projectRoot);
306
+
307
+ if (rnConfig.dependencies == null) {
308
+ return {};
309
+ }
310
+
311
+ let notLinkedLibraries = {};
312
+
313
+ Object.keys(rnConfig.dependencies).forEach(name => {
314
+ const dependency = rnConfig.dependencies[name];
315
+ let notLinkedPlatforms = [];
316
+
317
+ // dependency.platforms might not be defined, as the format
318
+ // {
319
+ // "dependencies": {
320
+ // "dependency-name": {
321
+ // "root": "path/to/dependency",
322
+ // }
323
+ // }
324
+ // }
325
+ // is also supported.
326
+ // In this case, we assume that the library is linked to all platforms.
327
+ // We don't consider the case were `dependency-name.root` is equal to `null`, because that
328
+ // means that the library is not linked to the app at all, and in that case the dependency
329
+ // should be removed by the user.
330
+ dependency.platforms &&
331
+ Object.keys(dependency.platforms).forEach(platform => {
332
+ if (dependency.platforms[platform] == null) {
333
+ notLinkedPlatforms.push(platform);
334
+ }
335
+ });
336
+ notLinkedLibraries[name] = notLinkedPlatforms;
337
+ });
338
+ return notLinkedLibraries;
339
+ }
340
+
294
341
  function findProjectRootLibraries(pkgJson, projectRoot) {
295
342
  console.log('[Codegen] Searching for codegen-enabled libraries in the app.');
296
343
 
@@ -696,6 +743,8 @@ function execute(projectRoot, targetPlatform, baseOutputPath) {
696
743
  let platforms =
697
744
  targetPlatform === 'all' ? supportedPlatforms : [targetPlatform];
698
745
 
746
+ const notLinkedLibraries = findNotLinkedLibraries(projectRoot);
747
+
699
748
  for (const platform of platforms) {
700
749
  const outputPath = computeOutputPath(
701
750
  projectRoot,
@@ -704,7 +753,19 @@ function execute(projectRoot, targetPlatform, baseOutputPath) {
704
753
  platform,
705
754
  );
706
755
 
707
- const schemaInfos = generateSchemaInfos(libraries);
756
+ const schemaInfos = generateSchemaInfos(
757
+ libraries.filter(library => {
758
+ const unlinkedPlatforms = notLinkedLibraries[library.libraryName];
759
+ if (unlinkedPlatforms && unlinkedPlatforms.includes(platform)) {
760
+ console.log(
761
+ `[Codegen - ${library.libraryName}] Skipping Codegen on ${platform}`,
762
+ );
763
+ return false;
764
+ }
765
+ return true;
766
+ }),
767
+ );
768
+
708
769
  generateNativeCode(
709
770
  outputPath,
710
771
  schemaInfos.filter(schemaInfo =>
@@ -4,7 +4,7 @@
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
- * @generated SignedSource<<0bff47ec5af8ed96d8b2abe351f318f1>>
7
+ * @generated SignedSource<<cbc00457c9b6f4639083b6fa970683eb>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -46,7 +46,6 @@ export type ReactNativeFeatureFlagsJsOnlyOverrides = Partial<ReactNativeFeatureF
46
46
  export type ReactNativeFeatureFlags = {
47
47
  ...ReactNativeFeatureFlagsJsOnly,
48
48
  commonTestFlag: Getter<boolean>,
49
- allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter<boolean>,
50
49
  batchRenderingUpdatesInEventLoop: Getter<boolean>,
51
50
  completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean>,
52
51
  destroyFabricSurfacesInReactInstanceManager: Getter<boolean>,
@@ -164,10 +163,6 @@ export const useRefsForTextInputState: Getter<boolean> = createJavaScriptFlagGet
164
163
  * Common flag for testing. Do NOT modify.
165
164
  */
166
165
  export const commonTestFlag: Getter<boolean> = createNativeFlagGetter('commonTestFlag', false);
167
- /**
168
- * Adds support for recursively processing commits that mount synchronously (Android only).
169
- */
170
- export const allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter<boolean> = createNativeFlagGetter('allowRecursiveCommitsWithSynchronousMountOnAndroid', false);
171
166
  /**
172
167
  * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
173
168
  */
@@ -4,7 +4,7 @@
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
- * @generated SignedSource<<6d4aa48dfdd3b78ac5f0f8e70eb3895f>>
7
+ * @generated SignedSource<<ac46e3eb810d890a0f8199fe100936cb>>
8
8
  * @flow strict-local
9
9
  */
10
10
 
@@ -24,7 +24,6 @@ import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboMod
24
24
 
25
25
  export interface Spec extends TurboModule {
26
26
  +commonTestFlag?: () => boolean;
27
- +allowRecursiveCommitsWithSynchronousMountOnAndroid?: () => boolean;
28
27
  +batchRenderingUpdatesInEventLoop?: () => boolean;
29
28
  +completeReactInstanceCreationOnBgThreadOnAndroid?: () => boolean;
30
29
  +destroyFabricSurfacesInReactInstanceManager?: () => boolean;
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @format
8
- * @flow strict-local
9
- */
10
-
11
- import NativeAddressSanitizerCrash from './NativeAddressSanitizerCrash';
12
-
13
- module.exports = NativeAddressSanitizerCrash;
@@ -1,19 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @flow strict-local
8
- * @format
9
- */
10
-
11
- import type {TurboModule} from '../TurboModule/RCTExport';
12
-
13
- import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
14
-
15
- export interface Spec extends TurboModule {}
16
-
17
- export default (TurboModuleRegistry.get<Spec>(
18
- 'RCTAddressSanitizerCrash',
19
- ): ?Spec);
@@ -1,12 +0,0 @@
1
- /*
2
- *
3
- * This source code is licensed under the MIT license found in the
4
- * LICENSE file in the root directory of this source tree.
5
- */
6
-
7
- #import <React/RCTUIKit.h>
8
- #import <React/RCTBridge.h>
9
-
10
- @interface RCTAddressSanitizerCrashManager : NSObject <RCTBridgeModule>
11
-
12
- @end
@@ -1,18 +0,0 @@
1
- //
2
- // RCTAddressSanitizerCrashManager.mm
3
- // Pods
4
- //
5
-
6
- #import "RCTAddressSanitizerCrashManager.h"
7
-
8
- @implementation RCTAddressSanitizerCrashManager
9
-
10
- RCT_EXPORT_MODULE(ASANCrash)
11
-
12
- RCT_EXPORT_METHOD(invokeMemoryCrash) {
13
- char *s = (char*)malloc(100);
14
- free(s);
15
- strcpy(s, "Hello world!"); // AddressSanitizer: heap-use-after-free
16
- }
17
-
18
- @end