react-native 0.71.12 → 0.71.13

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.
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 12,
15
+ patch: 13,
16
16
  prerelease: null,
17
17
  };
@@ -17,6 +17,8 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
17
17
  import {RootTagContext, createRootTag} from './RootTag';
18
18
  import * as React from 'react';
19
19
 
20
+ const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
21
+
20
22
  type Props = $ReadOnly<{|
21
23
  children?: React.Node,
22
24
  fabric?: boolean,
@@ -45,9 +47,17 @@ class AppContainer extends React.Component<Props, State> {
45
47
  };
46
48
  _mainRef: ?React.ElementRef<typeof View>;
47
49
  _subscription: ?EventSubscription = null;
50
+ _reactDevToolsAgentListener: ?() => void = null;
48
51
 
49
52
  static getDerivedStateFromError: any = undefined;
50
53
 
54
+ mountReactDevToolsOverlays(): void {
55
+ const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
56
+ const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;
57
+
58
+ this.setState({devtoolsOverlay});
59
+ }
60
+
51
61
  componentDidMount(): void {
52
62
  if (__DEV__) {
53
63
  if (!this.props.internal_excludeInspector) {
@@ -69,13 +79,21 @@ class AppContainer extends React.Component<Props, State> {
69
79
  this.setState({inspector});
70
80
  },
71
81
  );
72
- if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__ != null) {
73
- const DevtoolsOverlay =
74
- require('../Inspector/DevtoolsOverlay').default;
75
- const devtoolsOverlay = (
76
- <DevtoolsOverlay inspectedView={this._mainRef} />
82
+
83
+ if (reactDevToolsHook != null) {
84
+ if (reactDevToolsHook.reactDevtoolsAgent) {
85
+ // In case if this is not the first AppContainer rendered and React DevTools are already attached
86
+ this.mountReactDevToolsOverlays();
87
+ return;
88
+ }
89
+
90
+ this._reactDevToolsAgentListener = () =>
91
+ this.mountReactDevToolsOverlays();
92
+
93
+ reactDevToolsHook.on(
94
+ 'react-devtools',
95
+ this._reactDevToolsAgentListener,
77
96
  );
78
- this.setState({devtoolsOverlay});
79
97
  }
80
98
  }
81
99
  }
@@ -85,6 +103,10 @@ class AppContainer extends React.Component<Props, State> {
85
103
  if (this._subscription != null) {
86
104
  this._subscription.remove();
87
105
  }
106
+
107
+ if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) {
108
+ reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener);
109
+ }
88
110
  }
89
111
 
90
112
  render(): React.Node {
@@ -256,7 +256,7 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
256
256
 
257
257
  - (void)textViewDidChange:(__unused UITextView *)textView
258
258
  {
259
- if (_ignoreNextTextInputCall) {
259
+ if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
260
260
  _ignoreNextTextInputCall = NO;
261
261
  return;
262
262
  }
@@ -101,6 +101,7 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
101
101
 
102
102
  @property (nonatomic, assign) BOOL enableMinification;
103
103
  @property (nonatomic, assign) BOOL enableDev;
104
+ @property (nonatomic, assign) BOOL inlineSourceMap;
104
105
 
105
106
  /**
106
107
  * The scheme/protocol used of the packager, the default is the http protocol
@@ -125,13 +126,32 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
125
126
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
126
127
  packagerHost:(NSString *)packagerHost
127
128
  enableDev:(BOOL)enableDev
128
- enableMinification:(BOOL)enableMinification;
129
+ enableMinification:(BOOL)enableMinification
130
+ __deprecated_msg(
131
+ "Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");
132
+
133
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
134
+ packagerHost:(NSString *)packagerHost
135
+ packagerScheme:(NSString *)scheme
136
+ enableDev:(BOOL)enableDev
137
+ enableMinification:(BOOL)enableMinification
138
+ modulesOnly:(BOOL)modulesOnly
139
+ runModule:(BOOL)runModule
140
+ __deprecated_msg(
141
+ "Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");
142
+
143
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
144
+ packagerHost:(NSString *)packagerHost
145
+ enableDev:(BOOL)enableDev
146
+ enableMinification:(BOOL)enableMinification
147
+ inlineSourceMap:(BOOL)inlineSourceMap;
129
148
 
130
149
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
131
150
  packagerHost:(NSString *)packagerHost
132
151
  packagerScheme:(NSString *)scheme
133
152
  enableDev:(BOOL)enableDev
134
153
  enableMinification:(BOOL)enableMinification
154
+ inlineSourceMap:(BOOL)inlineSourceMap
135
155
  modulesOnly:(BOOL)modulesOnly
136
156
  runModule:(BOOL)runModule;
137
157
  /**
@@ -142,6 +162,17 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
142
162
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
143
163
  packagerHost:(NSString *)packagerHost
144
164
  scheme:(NSString *)scheme
145
- query:(NSString *)query;
165
+ query:(NSString *)query
166
+ __deprecated_msg("Use version with queryItems parameter instead");
167
+
168
+ /**
169
+ * Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
170
+ * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
171
+ * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
172
+ */
173
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
174
+ packagerHost:(NSString *)packagerHost
175
+ scheme:(NSString *)scheme
176
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems;
146
177
 
147
178
  @end
@@ -22,10 +22,12 @@ void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
22
22
  kRCTAllowPackagerAccess = allowed;
23
23
  }
24
24
  #endif
25
+ static NSString *const kRCTPlatformName = @"ios";
25
26
  static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
26
27
  static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
27
28
  static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
28
29
  static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
30
+ static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";
29
31
 
30
32
  @implementation RCTBundleURLProvider
31
33
 
@@ -183,6 +185,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
183
185
  packagerScheme:[self packagerScheme]
184
186
  enableDev:[self enableDev]
185
187
  enableMinification:[self enableMinification]
188
+ inlineSourceMap:[self inlineSourceMap]
186
189
  modulesOnly:NO
187
190
  runModule:YES];
188
191
  }
@@ -195,6 +198,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
195
198
  packagerScheme:[self packagerScheme]
196
199
  enableDev:[self enableDev]
197
200
  enableMinification:[self enableMinification]
201
+ inlineSourceMap:[self inlineSourceMap]
198
202
  modulesOnly:YES
199
203
  runModule:NO];
200
204
  }
@@ -234,13 +238,29 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
234
238
  return [[self class] resourceURLForResourcePath:path
235
239
  packagerHost:packagerServerHostPort
236
240
  scheme:packagerServerScheme
237
- query:nil];
241
+ queryItems:nil];
238
242
  }
239
243
 
240
244
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
241
245
  packagerHost:(NSString *)packagerHost
242
246
  enableDev:(BOOL)enableDev
243
247
  enableMinification:(BOOL)enableMinification
248
+ {
249
+ return [self jsBundleURLForBundleRoot:bundleRoot
250
+ packagerHost:packagerHost
251
+ packagerScheme:nil
252
+ enableDev:enableDev
253
+ enableMinification:enableMinification
254
+ inlineSourceMap:NO
255
+ modulesOnly:NO
256
+ runModule:YES];
257
+ }
258
+
259
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
260
+ packagerHost:(NSString *)packagerHost
261
+ enableDev:(BOOL)enableDev
262
+ enableMinification:(BOOL)enableMinification
263
+ inlineSourceMap:(BOOL)inlineSourceMap
244
264
 
245
265
  {
246
266
  return [self jsBundleURLForBundleRoot:bundleRoot
@@ -248,6 +268,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
248
268
  packagerScheme:nil
249
269
  enableDev:enableDev
250
270
  enableMinification:enableMinification
271
+ inlineSourceMap:inlineSourceMap
251
272
  modulesOnly:NO
252
273
  runModule:YES];
253
274
  }
@@ -259,27 +280,45 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
259
280
  enableMinification:(BOOL)enableMinification
260
281
  modulesOnly:(BOOL)modulesOnly
261
282
  runModule:(BOOL)runModule
283
+ {
284
+ return [self jsBundleURLForBundleRoot:bundleRoot
285
+ packagerHost:packagerHost
286
+ packagerScheme:nil
287
+ enableDev:enableDev
288
+ enableMinification:enableMinification
289
+ inlineSourceMap:NO
290
+ modulesOnly:modulesOnly
291
+ runModule:runModule];
292
+ }
293
+
294
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
295
+ packagerHost:(NSString *)packagerHost
296
+ packagerScheme:(NSString *)scheme
297
+ enableDev:(BOOL)enableDev
298
+ enableMinification:(BOOL)enableMinification
299
+ inlineSourceMap:(BOOL)inlineSourceMap
300
+ modulesOnly:(BOOL)modulesOnly
301
+ runModule:(BOOL)runModule
262
302
  {
263
303
  NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
304
+ BOOL lazy = enableDev;
305
+ NSArray<NSURLQueryItem *> *queryItems = @[
306
+ [[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
307
+ [[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
308
+ [[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
309
+ [[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
310
+ [[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
311
+ [[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
264
312
  #ifdef HERMES_BYTECODE_VERSION
265
- NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
266
- #else
267
- NSString *runtimeBytecodeVersion = @"";
313
+ [[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
268
314
  #endif
269
-
270
- // When we support only iOS 8 and above, use queryItems for a better API.
271
- NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
272
- enableDev ? @"true" : @"false",
273
- enableMinification ? @"true" : @"false",
274
- modulesOnly ? @"true" : @"false",
275
- runModule ? @"true" : @"false",
276
- runtimeBytecodeVersion];
315
+ ];
277
316
 
278
317
  NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
279
318
  if (bundleID) {
280
- query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
319
+ queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
281
320
  }
282
- return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme query:query];
321
+ return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
283
322
  }
284
323
 
285
324
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
@@ -296,6 +335,20 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
296
335
  return components.URL;
297
336
  }
298
337
 
338
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
339
+ packagerHost:(NSString *)packagerHost
340
+ scheme:(NSString *)scheme
341
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems
342
+ {
343
+ NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
344
+ resolvingAgainstBaseURL:NO];
345
+ components.path = path;
346
+ if (queryItems != nil) {
347
+ components.queryItems = queryItems;
348
+ }
349
+ return components.URL;
350
+ }
351
+
299
352
  - (void)updateValue:(id)object forKey:(NSString *)key
300
353
  {
301
354
  [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
@@ -313,6 +366,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
313
366
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
314
367
  }
315
368
 
369
+ - (BOOL)inlineSourceMap
370
+ {
371
+ return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
372
+ }
373
+
316
374
  - (NSString *)jsLocation
317
375
  {
318
376
  return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
@@ -342,6 +400,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
342
400
  [self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
343
401
  }
344
402
 
403
+ - (void)setInlineSourceMap:(BOOL)inlineSourceMap
404
+ {
405
+ [self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
406
+ }
407
+
345
408
  - (void)setPackagerScheme:(NSString *)packagerScheme
346
409
  {
347
410
  [self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(12),
26
+ RCTVersionPatch: @(13),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.12
1
+ VERSION_NAME=0.71.13
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -20,6 +20,7 @@ import android.content.pm.PackageManager;
20
20
  import android.graphics.Color;
21
21
  import android.graphics.Typeface;
22
22
  import android.hardware.SensorManager;
23
+ import android.os.Build;
23
24
  import android.util.Pair;
24
25
  import android.view.Gravity;
25
26
  import android.view.View;
@@ -1098,7 +1099,7 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
1098
1099
  if (!mIsReceiverRegistered) {
1099
1100
  IntentFilter filter = new IntentFilter();
1100
1101
  filter.addAction(getReloadAppAction(mApplicationContext));
1101
- mApplicationContext.registerReceiver(mReloadAppBroadcastReceiver, filter);
1102
+ compatRegisterReceiver(mApplicationContext, mReloadAppBroadcastReceiver, filter, true);
1102
1103
  mIsReceiverRegistered = true;
1103
1104
  }
1104
1105
 
@@ -1214,4 +1215,21 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
1214
1215
 
1215
1216
  return mSurfaceDelegateFactory.createSurfaceDelegate(moduleName);
1216
1217
  }
1218
+
1219
+ /**
1220
+ * Starting with Android 14, apps and services that target Android 14 and use context-registered
1221
+ * receivers are required to specify a flag to indicate whether or not the receiver should be
1222
+ * exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED
1223
+ *
1224
+ * <p>https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported
1225
+ */
1226
+ private void compatRegisterReceiver(
1227
+ Context context, BroadcastReceiver receiver, IntentFilter filter, boolean exported) {
1228
+ if (Build.VERSION.SDK_INT >= 34 && context.getApplicationInfo().targetSdkVersion >= 34) {
1229
+ context.registerReceiver(
1230
+ receiver, filter, exported ? Context.RECEIVER_EXPORTED : Context.RECEIVER_NOT_EXPORTED);
1231
+ } else {
1232
+ context.registerReceiver(receiver, filter);
1233
+ }
1234
+ }
1217
1235
  }
@@ -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", 71,
20
- "patch", 12,
20
+ "patch", 13,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 12;
20
+ int32_t Patch = 13;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.71.12",
3
+ "version": "0.71.13",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -103,7 +103,8 @@
103
103
  "test-typescript": "dtslint types",
104
104
  "test-typescript-offline": "dtslint --localTs node_modules/typescript/lib types",
105
105
  "bump-all-updated-packages": "node ./scripts/monorepo/bump-all-updated-packages",
106
- "align-package-versions": "node ./scripts/monorepo/align-package-versions.js"
106
+ "align-package-versions": "node ./scripts/monorepo/align-package-versions.js",
107
+ "trigger-react-native-release": "node ./scripts/trigger-react-native-release.js"
107
108
  },
108
109
  "peerDependencies": {
109
110
  "react": "18.2.0"
Binary file
Binary file
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.71.12"
14
+ "react-native": "0.71.13"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",