react-native 0.79.2 → 0.79.3

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.
@@ -16,6 +16,6 @@ export const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 2,
19
+ patch: 3,
20
20
  prerelease: null,
21
21
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(2),
26
+ RCTVersionPatch: @(3),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
170
170
 
171
171
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
172
172
  {
173
- [_viewsToBeMounted addObject:@{
174
- kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
175
- kRCTLegacyInteropChildComponentKey : childComponentView
176
- }];
173
+ if (_adapter && index == _adapter.paperView.reactSubviews.count) {
174
+ // This is a new child view that is being added to the end of the children array.
175
+ // After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
176
+ // Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
177
+ // called and the `finalizeUpdate` is not invoked.
178
+ if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
179
+ UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
180
+ [_adapter.paperView insertReactSubview:target atIndex:index];
181
+ } else {
182
+ [_adapter.paperView insertReactSubview:childComponentView atIndex:index];
183
+ }
184
+ [_adapter.paperView didUpdateReactSubviews];
185
+ } else {
186
+ [_viewsToBeMounted addObject:@{
187
+ kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
188
+ kRCTLegacyInteropChildComponentKey : childComponentView
189
+ }];
190
+ }
177
191
  }
178
192
 
179
193
  - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
@@ -60,7 +60,7 @@ using namespace facebook::react;
60
60
  const auto &newSwitchProps = static_cast<const SwitchProps &>(*props);
61
61
 
62
62
  // `value`
63
- if (oldSwitchProps.value != newSwitchProps.value) {
63
+ if (!_isInitialValueSet || oldSwitchProps.value != newSwitchProps.value) {
64
64
  BOOL shouldAnimate = _isInitialValueSet == YES;
65
65
  [_switchView setOn:newSwitchProps.value animated:shouldAnimate];
66
66
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.79.2
1
+ VERSION_NAME=0.79.3
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 79,
20
- "patch", 2,
20
+ "patch", 3,
21
21
  "prerelease", null);
22
22
  }
@@ -136,10 +136,10 @@ internal data class BorderRadiusStyle(
136
136
  (startStart ?: topStart ?: topLeft ?: uniform)?.resolve(width, height)
137
137
  ?: zeroRadii,
138
138
  bottomLeft =
139
- (endEnd ?: bottomStart ?: bottomRight ?: uniform)?.resolve(width, height)
139
+ (endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.resolve(width, height)
140
140
  ?: zeroRadii,
141
141
  bottomRight =
142
- (startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.resolve(width, height)
142
+ (startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.resolve(width, height)
143
143
  ?: zeroRadii,
144
144
  width = width,
145
145
  height = height,
@@ -588,9 +588,6 @@ public class ReactViewGroup extends ViewGroup
588
588
  UiThreadUtil.assertOnUiThread();
589
589
  checkViewClippingTag(child, Boolean.TRUE);
590
590
  if (!customDrawOrderDisabled()) {
591
- if (indexOfChild(child) == -1) {
592
- return;
593
- }
594
591
  getDrawingOrderHelper().handleRemoveView(child);
595
592
  setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
596
593
  } else {
@@ -14,14 +14,14 @@
14
14
 
15
15
  #define REACT_NATIVE_VERSION_MAJOR 0
16
16
  #define REACT_NATIVE_VERSION_MINOR 79
17
- #define REACT_NATIVE_VERSION_PATCH 2
17
+ #define REACT_NATIVE_VERSION_PATCH 3
18
18
 
19
19
  namespace facebook::react {
20
20
 
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 79;
24
- int32_t Patch = 2;
24
+ int32_t Patch = 3;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
@@ -32,6 +32,6 @@ Pod::Spec.new do |s|
32
32
  s.dependency "React-jsi", version
33
33
 
34
34
  s.subspec "Fabric" do |ss|
35
- ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)" }
35
+ ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)", "DEFINES_MODULE" => "YES" }
36
36
  end
37
37
  end
@@ -242,8 +242,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
242
242
  }
243
243
 
244
244
  if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
245
- // Do not throw any error to match web spec
246
- return timerIndex_++;
245
+ // Do not throw any error to match web spec; instead return 0, an
246
+ // invalid timer id
247
+ return 0;
247
248
  }
248
249
 
249
250
  auto callback = args[0].getObject(rt).getFunction(rt);
@@ -300,8 +301,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
300
301
  }
301
302
 
302
303
  if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
303
- throw jsi::JSError(
304
- rt, "The first argument to setInterval must be a function.");
304
+ // Do not throw any error to match web spec; instead return 0, an
305
+ // invalid timer id
306
+ return 0;
305
307
  }
306
308
  auto callback = args[0].getObject(rt).getFunction(rt);
307
309
  auto delay = count > 1
@@ -93,7 +93,9 @@ class TimerManager {
93
93
 
94
94
  // Each timeout that is registered on this queue gets a sequential id. This
95
95
  // is the global count from which those are assigned.
96
- TimerHandle timerIndex_{0};
96
+ // As per WHATWG HTML 8.6.1 (Timers) ids must be greater than zero, i.e. start
97
+ // at 1
98
+ TimerHandle timerIndex_{1};
97
99
 
98
100
  // The React Native microtask queue is used to back public APIs including
99
101
  // `queueMicrotask`, `clearImmediate`, and `setImmediate` (which is used by
@@ -474,7 +474,6 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
474
474
 
475
475
  if (error) {
476
476
  [strongSelf handleBundleLoadingError:error];
477
- [strongSelf invalidate];
478
477
  return;
479
478
  }
480
479
  // DevSettings module is needed by _loadScriptFromSource's callback so prior initialization is required
@@ -267,7 +267,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithoutDelay) {
267
267
  EXPECT_CALL(
268
268
  *mockRegistry_,
269
269
  createTimer(_, 0)); // If delay is not provided, it should use 0
270
- eval("setTimeout(() => {});");
270
+ auto val = eval("setTimeout(() => {});");
271
+ expectNoError();
272
+ EXPECT_EQ(val.asNumber(), 1); // First timer id should start at 1
271
273
  }
272
274
 
273
275
  TEST_F(ReactInstanceTest, testSetTimeoutWithPassThroughArgs) {
@@ -299,8 +301,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithInvalidArgs) {
299
301
  getErrorMessage("setTimeout();"),
300
302
  "setTimeout must be called with at least one argument (the function to call).");
301
303
 
302
- eval("setTimeout('invalid');");
304
+ auto val = eval("setTimeout('invalid')");
303
305
  expectNoError();
306
+ EXPECT_EQ(val.asNumber(), 0);
304
307
 
305
308
  eval("setTimeout(() => {}, 'invalid');");
306
309
  expectNoError();
@@ -417,9 +420,10 @@ TEST_F(ReactInstanceTest, testSetIntervalWithInvalidArgs) {
417
420
  EXPECT_EQ(
418
421
  getErrorMessage("setInterval();"),
419
422
  "setInterval must be called with at least one argument (the function to call).");
420
- EXPECT_EQ(
421
- getErrorMessage("setInterval('invalid', 100);"),
422
- "The first argument to setInterval must be a function.");
423
+
424
+ auto val = eval("setInterval('invalid', 100)");
425
+ expectNoError();
426
+ EXPECT_EQ(val.asNumber(), 0);
423
427
  }
424
428
 
425
429
  TEST_F(ReactInstanceTest, testClearInterval) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.79.2",
3
+ "version": "0.79.3",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -108,13 +108,13 @@
108
108
  },
109
109
  "dependencies": {
110
110
  "@jest/create-cache-key-function": "^29.7.0",
111
- "@react-native/assets-registry": "0.79.2",
112
- "@react-native/codegen": "0.79.2",
113
- "@react-native/community-cli-plugin": "0.79.2",
114
- "@react-native/gradle-plugin": "0.79.2",
115
- "@react-native/js-polyfills": "0.79.2",
116
- "@react-native/normalize-colors": "0.79.2",
117
- "@react-native/virtualized-lists": "0.79.2",
111
+ "@react-native/assets-registry": "0.79.3",
112
+ "@react-native/codegen": "0.79.3",
113
+ "@react-native/community-cli-plugin": "0.79.3",
114
+ "@react-native/gradle-plugin": "0.79.3",
115
+ "@react-native/js-polyfills": "0.79.3",
116
+ "@react-native/normalize-colors": "0.79.3",
117
+ "@react-native/virtualized-lists": "0.79.3",
118
118
  "abort-controller": "^3.0.0",
119
119
  "anser": "^1.4.9",
120
120
  "ansi-regex": "^5.0.0",
@@ -325,22 +325,13 @@ function findExternalLibraries(pkgJson, projectRoot) {
325
325
  });
326
326
  }
327
327
 
328
- function findLibrariesFromReactNativeConfig(projectRoot) {
329
- const rnConfigFileName = 'react-native.config.js';
330
-
328
+ function findLibrariesFromReactNativeConfig(projectRoot, rnConfig) {
331
329
  codegenLog(
332
- `Searching for codegen-enabled libraries in ${rnConfigFileName}`,
330
+ `Searching for codegen-enabled libraries in react-native.config.js`,
333
331
  true,
334
332
  );
335
333
 
336
- const rnConfigFilePath = path.resolve(projectRoot, rnConfigFileName);
337
-
338
- if (!fs.existsSync(rnConfigFilePath)) {
339
- return [];
340
- }
341
- const rnConfig = require(rnConfigFilePath);
342
-
343
- if (rnConfig.dependencies == null) {
334
+ if (!rnConfig.dependencies) {
344
335
  return [];
345
336
  }
346
337
  return Object.keys(rnConfig.dependencies).flatMap(name => {
@@ -364,6 +355,19 @@ function findLibrariesFromReactNativeConfig(projectRoot) {
364
355
  });
365
356
  }
366
357
 
358
+ /**
359
+ * Finds all disabled libraries by platform based the react native config.
360
+ *
361
+ * This is needed when selectively disabling libraries in react-native.config.js since codegen should exclude those libraries as well.
362
+ */
363
+ function findDisabledLibrariesByPlatform(reactNativeConfig, platform) {
364
+ const dependencies = reactNativeConfig.dependencies ?? {};
365
+
366
+ return Object.keys(dependencies).filter(
367
+ dependency => dependencies[dependency].platforms?.[platform] === null,
368
+ );
369
+ }
370
+
367
371
  function findProjectRootLibraries(pkgJson, projectRoot) {
368
372
  codegenLog('Searching for codegen-enabled libraries in the app.', true);
369
373
 
@@ -592,7 +596,7 @@ function mustGenerateNativeCode(includeLibraryPath, schemaInfo) {
592
596
  );
593
597
  }
594
598
 
595
- function findCodegenEnabledLibraries(pkgJson, projectRoot) {
599
+ function findCodegenEnabledLibraries(pkgJson, projectRoot, reactNativeConfig) {
596
600
  const projectLibraries = findProjectRootLibraries(pkgJson, projectRoot);
597
601
  if (pkgJsonIncludesGeneratedCode(pkgJson)) {
598
602
  return projectLibraries;
@@ -600,11 +604,21 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
600
604
  return [
601
605
  ...projectLibraries,
602
606
  ...findExternalLibraries(pkgJson, projectRoot),
603
- ...findLibrariesFromReactNativeConfig(projectRoot),
607
+ ...findLibrariesFromReactNativeConfig(projectRoot, reactNativeConfig),
604
608
  ];
605
609
  }
606
610
  }
607
611
 
612
+ function readReactNativeConfig(projectRoot) {
613
+ const rnConfigFilePath = path.resolve(projectRoot, 'react-native.config.js');
614
+
615
+ if (!fs.existsSync(rnConfigFilePath)) {
616
+ return {};
617
+ }
618
+
619
+ return require(rnConfigFilePath);
620
+ }
621
+
608
622
  function generateCustomURLHandlers(libraries, outputDir) {
609
623
  const customImageURLLoaderClasses = libraries
610
624
  .flatMap(
@@ -833,8 +847,11 @@ function findFilesWithExtension(filePath, extension) {
833
847
  return null;
834
848
  }
835
849
 
836
- // Skip hidden folders, that starts with `.`
837
- if (absolutePath.includes(`${path.sep}.`)) {
850
+ // Skip hidden folders, that starts with `.` but allow `.pnpm`
851
+ if (
852
+ absolutePath.includes(`${path.sep}.`) &&
853
+ !absolutePath.includes(`${path.sep}.pnpm`)
854
+ ) {
838
855
  return null;
839
856
  }
840
857
 
@@ -1053,9 +1070,14 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
1053
1070
 
1054
1071
  buildCodegenIfNeeded();
1055
1072
 
1056
- const libraries = findCodegenEnabledLibraries(pkgJson, projectRoot);
1073
+ const reactNativeConfig = readReactNativeConfig(projectRoot);
1074
+ const codegenEnabledLibraries = findCodegenEnabledLibraries(
1075
+ pkgJson,
1076
+ projectRoot,
1077
+ reactNativeConfig,
1078
+ );
1057
1079
 
1058
- if (libraries.length === 0) {
1080
+ if (codegenEnabledLibraries.length === 0) {
1059
1081
  codegenLog('No codegen-enabled libraries found.', true);
1060
1082
  return;
1061
1083
  }
@@ -1064,6 +1086,19 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
1064
1086
  targetPlatform === 'all' ? supportedPlatforms : [targetPlatform];
1065
1087
 
1066
1088
  for (const platform of platforms) {
1089
+ const disabledLibraries = findDisabledLibrariesByPlatform(
1090
+ reactNativeConfig,
1091
+ platform,
1092
+ );
1093
+
1094
+ const libraries = codegenEnabledLibraries.filter(
1095
+ ({name}) => !disabledLibraries.includes(name),
1096
+ );
1097
+
1098
+ if (!libraries.length) {
1099
+ continue;
1100
+ }
1101
+
1067
1102
  const outputPath = computeOutputPath(
1068
1103
  projectRoot,
1069
1104
  baseOutputPath,
@@ -1 +1 @@
1
- hermes-2025-03-03-RNv0.79.0-bc17d964d03743424823d7dd1a9f37633459c5c5
1
+ hermes-2025-06-04-RNv0.79.3-7f9a871eefeb2c3852365ee80f0b6733ec12ac3b
Binary file
Binary file
Binary file
package/types/index.d.ts CHANGED
@@ -68,7 +68,7 @@
68
68
  /// <reference path="modules/BatchedBridge.d.ts" />
69
69
  /// <reference path="modules/Codegen.d.ts" />
70
70
  /// <reference path="modules/Devtools.d.ts" />
71
- /// <reference types="../src/types/globals.d.ts" />
71
+ /// <reference path="../src/types/globals.d.ts" />
72
72
  /// <reference path="modules/LaunchScreen.d.ts" />
73
73
 
74
74
  export * from '../Libraries/ActionSheetIOS/ActionSheetIOS';
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictFunctionTypes": true,
8
+ "strictNullChecks": true,
9
+ "types": [],
10
+ "jsx": "react",
11
+ "noEmit": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "paths": {"react-native": ["."]}
14
+ },
15
+ "include": ["../**/*.d.ts", "__typetests__/**/*"]
16
+ }