react-native 0.76.0-rc.1 → 0.76.0-rc.2

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.
@@ -104,6 +104,7 @@ const RCTTextInputViewConfig = {
104
104
  textTransform: true,
105
105
  textAlign: true,
106
106
  fontFamily: true,
107
+ lineBreakModeIOS: true,
107
108
  lineHeight: true,
108
109
  isHighlighted: true,
109
110
  writingDirection: true,
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 76,
19
19
  patch: 0,
20
- prerelease: 'rc.1',
20
+ prerelease: 'rc.2',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(76),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.1",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -723,6 +723,29 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
723
723
  [self _handleFinishedScrolling:scrollView];
724
724
  }
725
725
 
726
+ - (void)didMoveToWindow
727
+ {
728
+ [super didMoveToWindow];
729
+
730
+ if (!self.window) {
731
+ // The view is being removed, ensure that the scroll end event is dispatched
732
+ [self _handleScrollEndIfNeeded];
733
+ }
734
+ }
735
+
736
+ - (void)_handleScrollEndIfNeeded
737
+ {
738
+ if (_scrollView.isDecelerating || !_scrollView.isTracking) {
739
+ if (!_eventEmitter) {
740
+ return;
741
+ }
742
+ static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onMomentumScrollEnd([self _scrollViewMetrics]);
743
+
744
+ [self _updateStateWithContentOffset];
745
+ _isUserTriggeredScrolling = NO;
746
+ }
747
+ }
748
+
726
749
  - (void)_handleFinishedScrolling:(UIScrollView *)scrollView
727
750
  {
728
751
  [self _forceDispatchNextScrollEvent];
@@ -848,6 +848,26 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
848
848
  RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndZooming : scrollView withView : view atScale : scale);
849
849
  }
850
850
 
851
+ - (void)didMoveToWindow
852
+ {
853
+ [super didMoveToWindow];
854
+ if (self.window == nil) {
855
+ // Check if the ScrollView was in motion
856
+ if (_scrollView.isDecelerating || !_scrollView.isTracking) {
857
+ // Trigger the onMomentumScrollEnd event manually
858
+ RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil);
859
+ // We can't use the RCT_FORWARD_SCROLL_EVENT here beacuse the `_cmd` parameter passed
860
+ // to `respondsToSelector` is the current method - so it will be `didMoveToWindow` - and not
861
+ // `scrollViewDidEndDecelerating` that is passed.
862
+ for (NSObject<UIScrollViewDelegate> *scrollViewListener in _scrollListeners) {
863
+ if ([scrollViewListener respondsToSelector:@selector(scrollViewDidEndDecelerating:)]) {
864
+ [scrollViewListener scrollViewDidEndDecelerating:_scrollView];
865
+ }
866
+ }
867
+ }
868
+ }
869
+ }
870
+
851
871
  - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
852
872
  {
853
873
  // Fire a final scroll event
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.76.0-rc.1
1
+ VERSION_NAME=0.76.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 76,
20
20
  "patch", 0,
21
- "prerelease", "rc.1");
21
+ "prerelease", "rc.2");
22
22
  }
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 76;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.1";
21
+ std::string_view Prerelease = "rc.2";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
package/cli.js CHANGED
@@ -109,7 +109,7 @@ function warnWithDeprecationSchedule() {
109
109
  ${chalk.yellow('⚠️')} The \`init\` command is deprecated.
110
110
  The behavior will be changed on ${chalk.white.bold(CLI_DEPRECATION_DATE.toLocaleDateString())} ${emphasis(`(${daysRemaining} day${daysRemaining > 1 ? 's' : ''})`)}.
111
111
 
112
- - Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior.
112
+ - Switch to ${chalk.grey.bold('npx @react-native-community/cli init')} for the identical behavior.
113
113
  - Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`);
114
114
  }
115
115
 
@@ -117,11 +117,10 @@ function warnWithDeprecated() {
117
117
  if (!isInitCommand) {
118
118
  return;
119
119
  }
120
-
121
120
  console.warn(`
122
121
  🚨️ The \`init\` command is deprecated.
123
122
 
124
- - Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior.
123
+ - Switch to ${chalk.grey.bold('npx @react-native-community/cli init')} for the identical behavior.
125
124
  - Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`);
126
125
  }
127
126
 
@@ -174,7 +173,7 @@ async function main() {
174
173
 
175
174
  const isDeprecated =
176
175
  CLI_DEPRECATION_DATE.getTime() <= new Date().getTime() ||
177
- currentVersion.startsWith('0.76');
176
+ currentVersion.startsWith('0.77');
178
177
 
179
178
  /**
180
179
  * This command is now deprecated. We will continue to proxy commands to @react-native-community/cli, but it
@@ -191,8 +190,13 @@ async function main() {
191
190
  warnWithDeprecated();
192
191
  // We only exit if the user calls `init` and it's deprecated. All other cases should proxy to to @react-native-community/cli.
193
192
  // Be careful with this as it can break a lot of users.
193
+ console.warn(`${chalk.green('Exiting...')}`);
194
194
  process.exit(1);
195
- } else if (currentVersion.startsWith('0.75')) {
195
+ } else if (
196
+ currentVersion.startsWith('0.75') ||
197
+ currentVersion.startsWith('0.76')
198
+ ) {
199
+ // We check deprecation schedule only for 0.75 and 0.76 and 0.77 is expected to land in Jan 2025.
196
200
  warnWithDeprecationSchedule();
197
201
  }
198
202
  warnWhenRunningInit();
package/jest-preset.js CHANGED
@@ -15,7 +15,11 @@ module.exports = {
15
15
  platforms: ['android', 'ios', 'native'],
16
16
  },
17
17
  transform: {
18
- '^.+\\.(js|ts|tsx)$': 'babel-jest',
18
+ '^.+\\.(js)$': [
19
+ 'babel-jest',
20
+ {plugins: ['babel-plugin-syntax-hermes-parser']},
21
+ ],
22
+ '^.+\\.(ts|tsx)$': 'babel-jest',
19
23
  '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
20
24
  './jest/assetFileTransformer.js',
21
25
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.76.0-rc.1",
3
+ "version": "0.76.0-rc.2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -109,16 +109,18 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@jest/create-cache-key-function": "^29.6.3",
112
- "@react-native/assets-registry": "0.76.0-rc.1",
113
- "@react-native/codegen": "0.76.0-rc.1",
114
- "@react-native/community-cli-plugin": "0.76.0-rc.1",
115
- "@react-native/gradle-plugin": "0.76.0-rc.1",
116
- "@react-native/js-polyfills": "0.76.0-rc.1",
117
- "@react-native/normalize-colors": "0.76.0-rc.1",
118
- "@react-native/virtualized-lists": "0.76.0-rc.1",
112
+ "@react-native/assets-registry": "0.76.0-rc.2",
113
+ "@react-native/codegen": "0.76.0-rc.2",
114
+ "@react-native/community-cli-plugin": "0.76.0-rc.2",
115
+ "@react-native/gradle-plugin": "0.76.0-rc.2",
116
+ "@react-native/js-polyfills": "0.76.0-rc.2",
117
+ "@react-native/normalize-colors": "0.76.0-rc.2",
118
+ "@react-native/virtualized-lists": "0.76.0-rc.2",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
121
  "ansi-regex": "^5.0.0",
122
+ "babel-jest": "^29.7.0",
123
+ "babel-plugin-syntax-hermes-parser": "^0.23.1",
122
124
  "base64-js": "^1.5.1",
123
125
  "chalk": "^4.0.0",
124
126
  "commander": "^12.0.0",
@@ -696,10 +696,18 @@ class ReactNativePodsUtils
696
696
  map[field] = "$(inherited)" + flag
697
697
  else
698
698
  unless map[field].include?(flag)
699
- map[field] = map[field] + flag
699
+ if map[field].instance_of? String
700
+ map[field] = map[field] + flag
701
+ elsif map[field].instance_of? Array
702
+ map[field].push(flag)
703
+ end
700
704
  end
701
705
  unless map[field].include?("$(inherited)")
702
- map[field] = "$(inherited) " + map[field]
706
+ if map[field].instance_of? String
707
+ map[field] = "$(inherited) " + map[field]
708
+ elsif map[field].instance_of? Array
709
+ map[field].unshift("$(inherited)")
710
+ end
703
711
  end
704
712
  end
705
713
  end
@@ -92,6 +92,8 @@ fi
92
92
 
93
93
  [ -z "$CLI_PATH" ] && CLI_PATH="$REACT_NATIVE_DIR/scripts/bundle.js"
94
94
 
95
+ [ -z "$BUNDLE_COMMAND" ] && BUNDLE_COMMAND="bundle"
96
+
95
97
  [ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js"
96
98
 
97
99
  if [[ -z "$BUNDLE_CONFIG" ]]; then
Binary file
Binary file
Binary file