react-native-tvos 0.85.0-0rc5 → 0.85.2-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.
Files changed (54) hide show
  1. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
  2. package/Libraries/Components/ScrollView/ScrollView.d.ts +7 -0
  3. package/Libraries/Components/ScrollView/ScrollView.js +6 -0
  4. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -0
  5. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -0
  6. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +5 -1
  7. package/Libraries/Components/TextInput/TextInput.flow.js +1 -0
  8. package/Libraries/Core/ReactNativeVersion.js +2 -2
  9. package/README.md +52 -0
  10. package/React/Base/RCTVersion.m +2 -2
  11. package/React/CoreModules/RCTDevLoadingView.mm +17 -0
  12. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +1 -0
  13. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +78 -0
  14. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +32 -6
  15. package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
  16. package/ReactAndroid/build.gradle.kts +2 -0
  17. package/ReactAndroid/gradle.properties +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +2 -2
  19. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +5 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +8 -0
  21. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.kt +2 -0
  22. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  23. package/ReactAndroid/src/main/java/com/facebook/react/views/common/UiModeUtils.kt +20 -0
  24. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +57 -8
  25. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +5 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +48 -2
  27. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +5 -0
  28. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +28 -3
  29. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +5 -0
  30. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSubmitEditingEvent.kt +6 -1
  31. package/ReactCommon/React-Fabric.podspec +1 -0
  32. package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
  33. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +2 -2
  34. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +9 -1
  35. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +3 -1
  36. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +4 -1
  37. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +58 -25
  38. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +9 -0
  39. package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +5 -0
  40. package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +10 -0
  41. package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.h +1 -0
  42. package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +1 -0
  43. package/package.json +9 -9
  44. package/scripts/codegen/generate-artifacts-executor/generateAppDependencyProvider.js +4 -4
  45. package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +3 -3
  46. package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +2 -3
  47. package/scripts/codegen/generate-artifacts-executor/generatePackageSwift.js +2 -2
  48. package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +3 -2
  49. package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +3 -2
  50. package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +2 -2
  51. package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +3 -3
  52. package/scripts/codegen/generate-artifacts-executor/utils.js +48 -0
  53. package/src/private/featureflags/ReactNativeFeatureFlags.js +2 -2
  54. package/types/public/ReactNativeTVTypes.d.ts +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.85.0-0rc5",
3
+ "version": "0.85.2-0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -154,7 +154,7 @@
154
154
  "featureflags-check": "node ./scripts/featureflags/index.js --verify-unchanged"
155
155
  },
156
156
  "peerDependencies": {
157
- "@react-native/jest-preset": "0.85.0-rc.5",
157
+ "@react-native/jest-preset": "0.85.2",
158
158
  "@types/react": "^19.1.1",
159
159
  "react": "^19.2.3"
160
160
  },
@@ -167,12 +167,12 @@
167
167
  }
168
168
  },
169
169
  "dependencies": {
170
- "@react-native/assets-registry": "0.85.0-rc.5",
171
- "@react-native/codegen": "0.85.0-rc.5",
172
- "@react-native/community-cli-plugin": "0.85.0-rc.5",
173
- "@react-native/gradle-plugin": "0.85.0-rc.5",
174
- "@react-native/js-polyfills": "0.85.0-rc.5",
175
- "@react-native/normalize-colors": "0.85.0-rc.5",
170
+ "@react-native/assets-registry": "0.85.2",
171
+ "@react-native/codegen": "0.85.2",
172
+ "@react-native/community-cli-plugin": "0.85.2",
173
+ "@react-native/gradle-plugin": "0.85.2",
174
+ "@react-native/js-polyfills": "0.85.2",
175
+ "@react-native/normalize-colors": "0.85.2",
176
176
  "abort-controller": "^3.0.0",
177
177
  "anser": "^1.4.9",
178
178
  "ansi-regex": "^5.0.0",
@@ -198,7 +198,7 @@
198
198
  "whatwg-fetch": "^3.0.0",
199
199
  "ws": "^7.5.10",
200
200
  "yargs": "^17.6.2",
201
- "@react-native-tvos/virtualized-lists": "0.85.0-0rc5"
201
+ "@react-native-tvos/virtualized-lists": "0.85.2-0"
202
202
  },
203
203
  "codegenConfig": {
204
204
  "libraries": [
@@ -10,7 +10,7 @@
10
10
 
11
11
  'use strict';
12
12
  const {TEMPLATES_FOLDER_PATH, packageJson} = require('./constants');
13
- const {codegenLog} = require('./utils');
13
+ const {codegenLog, writeFileSyncIfChanged} = require('./utils');
14
14
  const fs = require('fs');
15
15
  const path = require('path');
16
16
 
@@ -38,7 +38,7 @@ function generateAppDependencyProvider(outputDir /*: string */) {
38
38
  'utf8',
39
39
  );
40
40
  const finalPathH = path.join(outputDir, 'RCTAppDependencyProvider.h');
41
- fs.writeFileSync(finalPathH, templateH);
41
+ writeFileSyncIfChanged(finalPathH, templateH);
42
42
  codegenLog(`Generated artifact: ${finalPathH}`);
43
43
 
44
44
  const templateMM = fs.readFileSync(
@@ -46,7 +46,7 @@ function generateAppDependencyProvider(outputDir /*: string */) {
46
46
  'utf8',
47
47
  );
48
48
  const finalPathMM = path.join(outputDir, 'RCTAppDependencyProvider.mm');
49
- fs.writeFileSync(finalPathMM, templateMM);
49
+ writeFileSyncIfChanged(finalPathMM, templateMM);
50
50
  codegenLog(`Generated artifact: ${finalPathMM}`);
51
51
 
52
52
  // Generate the podspec file
@@ -58,7 +58,7 @@ function generateAppDependencyProvider(outputDir /*: string */) {
58
58
  outputDir,
59
59
  'ReactAppDependencyProvider.podspec',
60
60
  );
61
- fs.writeFileSync(finalPathPodspec, templatePodspec);
61
+ writeFileSyncIfChanged(finalPathPodspec, templatePodspec);
62
62
  codegenLog(`Generated podspec: ${finalPathPodspec}`);
63
63
  }
64
64
 
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  const {TEMPLATES_FOLDER_PATH} = require('./constants');
14
- const {parseiOSAnnotations} = require('./utils');
14
+ const {parseiOSAnnotations, writeFileSyncIfChanged} = require('./utils');
15
15
  const fs = require('fs');
16
16
  const path = require('path');
17
17
 
@@ -105,13 +105,13 @@ function generateCustomURLHandlers(
105
105
 
106
106
  fs.mkdirSync(outputDir, {recursive: true});
107
107
 
108
- fs.writeFileSync(
108
+ writeFileSyncIfChanged(
109
109
  path.join(outputDir, 'RCTModulesConformingToProtocolsProvider.mm'),
110
110
  finalMMFile,
111
111
  );
112
112
 
113
113
  const templateH = fs.readFileSync(MODULES_PROTOCOLS_H_TEMPLATE_PATH, 'utf8');
114
- fs.writeFileSync(
114
+ writeFileSyncIfChanged(
115
115
  path.join(outputDir, 'RCTModulesConformingToProtocolsProvider.h'),
116
116
  templateH,
117
117
  );
@@ -12,7 +12,7 @@
12
12
 
13
13
  const generateSpecsCLIExecutor = require('../generate-specs-cli-executor');
14
14
  const {CORE_LIBRARIES_WITH_OUTPUT_FOLDER} = require('./constants');
15
- const {codegenLog} = require('./utils');
15
+ const {codegenLog, cpSyncRecursiveIfChanged} = require('./utils');
16
16
  const fs = require('fs');
17
17
  const os = require('os');
18
18
  const path = require('path');
@@ -63,8 +63,7 @@ function generateCode(
63
63
  const outputDir =
64
64
  reactNativeCoreLibraryOutputPath(libraryName, platform) ?? outputPath;
65
65
  fs.mkdirSync(outputDir, {recursive: true});
66
- // $FlowFixMe[prop-missing] - `fs.cpSync` is missing in Flow libdefs.
67
- fs.cpSync(tmpOutputDir, outputDir, {recursive: true});
66
+ cpSyncRecursiveIfChanged(tmpOutputDir, outputDir);
68
67
  codegenLog(`Generated artifacts: ${outputDir}`);
69
68
  }
70
69
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  'use strict';
12
12
  const {TEMPLATES_FOLDER_PATH} = require('./constants');
13
- const {codegenLog} = require('./utils');
13
+ const {codegenLog, writeFileSyncIfChanged} = require('./utils');
14
14
  const fs = require('fs');
15
15
  const path = require('path');
16
16
 
@@ -35,7 +35,7 @@ function generatePackageSwift(
35
35
  path.relative(fullOutputPath, reactNativePath),
36
36
  );
37
37
  const finalPathH = path.join(outputDir, 'Package.swift');
38
- fs.writeFileSync(finalPathH, templateH);
38
+ writeFileSyncIfChanged(finalPathH, templateH);
39
39
  codegenLog(`Generated artifact: ${finalPathH}`);
40
40
  }
41
41
 
@@ -14,6 +14,7 @@ const {
14
14
  codegenLog,
15
15
  isReactNativeCoreLibrary,
16
16
  parseiOSAnnotations,
17
+ writeFileSyncIfChanged,
17
18
  } = require('./utils');
18
19
  const fs = require('fs');
19
20
  const path = require('path');
@@ -39,7 +40,7 @@ function generateRCTModuleProviders(
39
40
  codegenLog('Generating RCTModulesProvider.h');
40
41
  const templateH = fs.readFileSync(MODULE_PROVIDERS_H_TEMPLATE_PATH, 'utf8');
41
42
  const finalPathH = path.join(outputDir, 'RCTModuleProviders.h');
42
- fs.writeFileSync(finalPathH, templateH);
43
+ writeFileSyncIfChanged(finalPathH, templateH);
43
44
  codegenLog(`Generated artifact: ${finalPathH}`);
44
45
 
45
46
  codegenLog('Generating RCTModuleProviders.mm');
@@ -112,7 +113,7 @@ function generateRCTModuleProviders(
112
113
  .readFileSync(MODULE_PROVIDERS_MM_TEMPLATE_PATH, 'utf8')
113
114
  .replace(/{moduleMapping}/, modulesMapping);
114
115
  const finalPathMM = path.join(outputDir, 'RCTModuleProviders.mm');
115
- fs.writeFileSync(finalPathMM, templateMM);
116
+ writeFileSyncIfChanged(finalPathMM, templateMM);
116
117
  codegenLog(`Generated artifact: ${finalPathMM}`);
117
118
  }
118
119
 
@@ -15,6 +15,7 @@ const {
15
15
  codegenLog,
16
16
  isReactNativeCoreLibrary,
17
17
  parseiOSAnnotations,
18
+ writeFileSyncIfChanged,
18
19
  } = require('./utils');
19
20
  const fs = require('fs');
20
21
  const path = require('path');
@@ -41,7 +42,7 @@ function generateRCTThirdPartyComponents(
41
42
  'utf8',
42
43
  );
43
44
  const finalPathH = path.join(outputDir, 'RCTThirdPartyComponentsProvider.h');
44
- fs.writeFileSync(finalPathH, templateH);
45
+ writeFileSyncIfChanged(finalPathH, templateH);
45
46
  codegenLog(`Generated artifact: ${finalPathH}`);
46
47
 
47
48
  codegenLog('Generating RCTThirdPartyComponentsProvider.mm');
@@ -150,7 +151,7 @@ function generateRCTThirdPartyComponents(
150
151
  outputDir,
151
152
  'RCTThirdPartyComponentsProvider.mm',
152
153
  );
153
- fs.writeFileSync(finalPathMM, templateMM);
154
+ writeFileSyncIfChanged(finalPathMM, templateMM);
154
155
  codegenLog(`Generated artifact: ${finalPathMM}`);
155
156
  }
156
157
 
@@ -15,7 +15,7 @@ const {
15
15
  TEMPLATES_FOLDER_PATH,
16
16
  packageJson,
17
17
  } = require('./constants');
18
- const {codegenLog} = require('./utils');
18
+ const {codegenLog, writeFileSyncIfChanged} = require('./utils');
19
19
  const {execSync} = require('child_process');
20
20
  const fs = require('fs');
21
21
  const path = require('path');
@@ -39,7 +39,7 @@ function generateReactCodegenPodspec(
39
39
  .replace(/{input-files}/, inputFiles)
40
40
  .replace(/{codegen-script}/, codegenScript);
41
41
  const finalPathPodspec = path.join(outputPath, 'ReactCodegen.podspec');
42
- fs.writeFileSync(finalPathPodspec, finalPodspec);
42
+ writeFileSyncIfChanged(finalPathPodspec, finalPodspec);
43
43
  codegenLog(`Generated podspec: ${finalPathPodspec}`);
44
44
  }
45
45
 
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  const {TEMPLATES_FOLDER_PATH} = require('./constants');
14
- const {parseiOSAnnotations} = require('./utils');
14
+ const {parseiOSAnnotations, writeFileSyncIfChanged} = require('./utils');
15
15
  const fs = require('fs');
16
16
  const path = require('path');
17
17
 
@@ -70,7 +70,7 @@ function generateUnstableModulesRequiringMainQueueSetupProvider(
70
70
 
71
71
  fs.mkdirSync(outputDir, {recursive: true});
72
72
 
73
- fs.writeFileSync(
73
+ writeFileSyncIfChanged(
74
74
  path.join(
75
75
  outputDir,
76
76
  'RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
@@ -82,7 +82,7 @@ function generateUnstableModulesRequiringMainQueueSetupProvider(
82
82
  UNSTABLE_MODULES_REQUIRING_MAIN_QUEUE_SETUP_PROVIDER_H_TEMPLATE_PATH,
83
83
  'utf8',
84
84
  );
85
- fs.writeFileSync(
85
+ writeFileSyncIfChanged(
86
86
  path.join(outputDir, 'RCTUnstableModulesRequiringMainQueueSetupProvider.h'),
87
87
  templateH,
88
88
  );
@@ -499,6 +499,52 @@ function findReactNativeRootPath(projectRoot /* : string */) /* : string */ {
499
499
  }
500
500
  }
501
501
 
502
+ function writeFileSyncIfChanged(
503
+ targetPath /*: string */,
504
+ contents /*: string */,
505
+ ) {
506
+ try {
507
+ const oldContents = fs.readFileSync(targetPath, 'utf8');
508
+ if (oldContents === contents) {
509
+ return;
510
+ }
511
+ } catch (error) {
512
+ if (error.code !== 'ENOENT') {
513
+ throw error;
514
+ }
515
+ }
516
+ fs.writeFileSync(targetPath, contents);
517
+ }
518
+
519
+ function cpSyncRecursiveIfChanged(
520
+ sourcePath /*: string */,
521
+ targetPath /*: string */,
522
+ ) {
523
+ fs.cpSync(sourcePath, targetPath, {
524
+ recursive: true,
525
+ force: true,
526
+ preserveTimestamps: true,
527
+ filter(src /*: string */, dest /*: string */) {
528
+ try {
529
+ const stat = fs.statSync(src);
530
+ if (!stat.isFile()) {
531
+ return true;
532
+ } else {
533
+ const oldContents = fs.readFileSync(dest, 'utf8');
534
+ const newContents = fs.readFileSync(src, 'utf8');
535
+ return oldContents !== newContents;
536
+ }
537
+ } catch (error) {
538
+ if (error.code !== 'ENOENT' && error.code !== 'EISDIR') {
539
+ throw error;
540
+ } else {
541
+ return true;
542
+ }
543
+ }
544
+ },
545
+ });
546
+ }
547
+
502
548
  module.exports = {
503
549
  buildCodegenIfNeeded,
504
550
  pkgJsonIncludesGeneratedCode,
@@ -513,4 +559,6 @@ module.exports = {
513
559
  readReactNativeConfig,
514
560
  findDisabledLibrariesByPlatform,
515
561
  findReactNativeRootPath,
562
+ writeFileSyncIfChanged,
563
+ cpSyncRecursiveIfChanged,
516
564
  };
@@ -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<<03688450419694f6d3f4fc709df4de9a>>
7
+ * @generated SignedSource<<d6dc08325764e3acb135a95ae923710b>>
8
8
  * @flow strict
9
9
  * @noformat
10
10
  */
@@ -275,7 +275,7 @@ export const enableCppPropsIteratorSetter: Getter<boolean> = createNativeFlagGet
275
275
  /**
276
276
  * This enables the fabric implementation of focus search so that we can focus clipped elements
277
277
  */
278
- export const enableCustomFocusSearchOnClippedElementsAndroid: Getter<boolean> = createNativeFlagGetter('enableCustomFocusSearchOnClippedElementsAndroid', true);
278
+ export const enableCustomFocusSearchOnClippedElementsAndroid: Getter<boolean> = createNativeFlagGetter('enableCustomFocusSearchOnClippedElementsAndroid', false);
279
279
  /**
280
280
  * Enables destructor calls for ShadowTreeRevision in the background to reduce UI thread work.
281
281
  */
@@ -11,6 +11,14 @@ declare module 'react-native' {
11
11
  * Only used when `snapToAlignment` is set to `'item'`.
12
12
  */
13
13
  snapToItemPadding?: number | undefined;
14
+
15
+ /**
16
+ * When false, the scroll view will jump to the correct offset without animation
17
+ * when focus changes. Defaults to true.
18
+ *
19
+ * @platform tv
20
+ */
21
+ scrollAnimationEnabled?: boolean | undefined;
14
22
  }
15
23
 
16
24
  interface ViewProps {