Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest changes from RN 0.71.13 + a few cherry-picks #1911

Merged
merged 63 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a0a2301
[LOCAL] update podlock post release to fix CI
kelset Apr 11, 2023
0d3600b
Fix measurement of uncontrolled TextInput after edit
NickGerleman Feb 9, 2023
8ad6496
Minimize EditText Spans 1/9: Fix precedence (#36543)
NickGerleman Mar 24, 2023
e7122df
Minimize EditText Spans 2/9: Make stripAttributeEquivalentSpans gener…
NickGerleman Mar 24, 2023
d145957
Minimize EditText Spans 3/9: ReactBackgroundColorSpan (#36547)
NickGerleman Mar 24, 2023
644a3da
Minimize EditText Spans 4/9: ReactForegroundColorSpan (#36545)
NickGerleman Mar 24, 2023
ba4c2f5
Minimize EditText Spans 5/9: Strikethrough and Underline (#36544)
NickGerleman Mar 24, 2023
e89d23c
Minimize EditText Spans 6/9: letterSpacing (#36548)
NickGerleman Mar 24, 2023
2e2ce8a
Minimize EditText Spans 7/9: Avoid temp list (#36576)
NickGerleman Mar 24, 2023
77bd902
Minimize EditText Spans 8/9: CustomStyleSpan (#36577)
NickGerleman Mar 24, 2023
181bd38
Mimimize EditText Spans 9/9: Remove addSpansForMeasurement() (#36575)
NickGerleman Mar 25, 2023
256e25c
Merge pull request #36874 from facebook/kelset/071-backport-textinput…
kelset Apr 17, 2023
9be2959
Use RN Build Utils for Building Hermes Artifacts
dmytrorykun Mar 15, 2023
843d57e
Fix TextView alignment being reset on state updates
javache Feb 22, 2023
6115ce5
[0.71.7] Bump version numbers
Apr 19, 2023
1fbfd8c
Do not send extra onChangeText even wnen instantianting multiline Tex…
dmytrorykun Apr 18, 2023
0dda452
Read Maven group from GROUP property (#37204)
douglowder May 5, 2023
fb76526
bumped packages versions
kelset May 10, 2023
4bf4c47
[LOCAL] bump RNGP to 0.71.18
kelset May 10, 2023
a93778c
[LOCAL] update podlock
kelset May 10, 2023
d2a8739
[0.71.8] Bump version numbers
May 10, 2023
b8040b9
fix(types): cross platform autoComplete for TextInput (#36931)
iRoachie Apr 18, 2023
b245919
Allow string `transform` style in TypeScript (#37569)
NickGerleman May 25, 2023
9762016
fix: [gradle-plugin] 3rd party lib dependency substitution (#37445)
douglowder May 17, 2023
fa33e76
fix: fix virtualizedList scrollToEnd for 0 items (#36067)
Andarius Feb 6, 2023
a582ca5
[LOCAL] bump hermes version post release
kelset Jun 6, 2023
3f61b5f
Make CircleCI caches for hermesc be version dependent (#37452)
cipolleschi May 23, 2023
ed9ef98
[0.71.9] Bump version numbers
Jun 7, 2023
1564d4d
bumped packages versions
kelset Jun 7, 2023
3be3a7d
bump RNGP to 0.71.19
kelset Jun 7, 2023
4e92d67
[0.71.10] Bump version numbers
Jun 7, 2023
dfdc97a
[LOCAL] update podlock to fix CI
kelset Jun 8, 2023
fd8a19d
Revert "fix: border width top/bottom not matching the border radius (…
kelset Jun 14, 2023
c11e0f5
Fix invalid context cast in ReactRootView (#36121)
aleqsio Feb 13, 2023
f2c0514
Prevent crash in runAnimationStep on OnePlus and Oppo devices (#37487)
hsource May 23, 2023
91b172d
Use `Content-Location` header in bundle response as JS source URL (#3…
robhogan May 23, 2023
5bd1a42
[LOCAL] Make 0.70 compatible with Xcode 15 (thanks to @AlexanderEgger…
kelset Jun 14, 2023
69804c7
[LOCAL] Bump CLI to 10.2.4 and Metro to 0.73.10
kelset Jun 14, 2023
da5ed0d
Add web compat unit tests and fixes (#35316)
necolas Nov 17, 2022
42a0888
resolve some merge conflicts
AlexanderEggers Jun 14, 2023
b7644aa
fix tests
AlexanderEggers Jun 14, 2023
7ea7d94
[0.71.11] Bump version numbers
Jun 14, 2023
2b06a75
Merge pull request #37876 from AlexanderEggers/chore/cherry-pick_logi…
NickGerleman Jun 15, 2023
9ce27c7
[LOCAL] update podlock for CI
kelset Jun 20, 2023
fc1abe1
fix(ios): fix `pod install --project-directory=ios` failing (#37993)
tido64 Jun 23, 2023
f59db07
Prevent LogBox from crashing on long messages (#38005)
motiz88 Jun 22, 2023
49d16d5
[0.71.12] Bump version numbers
Jul 4, 2023
c68ef7f
[LOCAL] Bump podfile.lock
cipolleschi Jul 24, 2023
7636e4c
[LOCAL] Download artifacts from CI to speed up testing (#37971) (#38612)
cipolleschi Jul 25, 2023
b3c7a5d
fix: mount devtools overlay only if react devtools are connected (#38…
hoxyq Aug 15, 2023
f8c03d1
Allow RCTBundleURLProvider to request an inline source map (#37878) (…
Saadnajmi Aug 16, 2023
209e743
chore(releases): improve bump oss script to allow less human errors (…
kelset Aug 16, 2023
22d1e89
Add scripts and pipeline to poll for maven (#38980) (#39039)
cipolleschi Aug 16, 2023
843043c
Fix onChangeText not firing when clearing the value of TextInput with…
kkoudev Jul 4, 2023
bfd26b7
For targeting SDK 34 - Added RECEIVER_EXPORTED/RECEIVER_NOT_EXPORTED …
apuruni Jul 10, 2023
a90485a
[LOCAL] skip un-semver packages in 71 branch
kelset Aug 21, 2023
4f82350
Revert "[LOCAL] skip un-semver packages in 71 branch"
kelset Aug 21, 2023
e4ab2b2
[LOCAL] augment forEachPackage to accept optional excludes and add fo…
kelset Aug 21, 2023
7399bbb
[0.71.13] Bump version numbers
Aug 22, 2023
7957912
Merge branch '0.71-stable' of github.com:facebook/react-native into 0…
Saadnajmi Aug 23, 2023
5353ca0
Re-enable direct debugging with JSC on iOS 16.4+ (#37914)
huntie Jun 15, 2023
9bb85c9
Guard `JSGlobalContextSetInspectable` behind a compile time check for…
Saadnajmi Aug 18, 2023
847c9b4
Fix some issues
Saadnajmi Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ jobs:
- report_bundle_size:
platform: android

- store_artifacts:
path: ~/react-native/packages/rn-tester/android/app/build/outputs/apk/
destination: rntester-apk

# Optionally, run disabled tests
- when:
condition: << parameters.run_disabled_tests >>
Expand Down Expand Up @@ -1060,7 +1064,10 @@ jobs:

- run:
name: Display Environment info
command: npx envinfo@latest
command: |
npm install -g envinfo
envinfo -v
envinfo

- restore_cache:
keys:
Expand Down Expand Up @@ -1562,6 +1569,19 @@ jobs:
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${CIRCLE_TAG:1}\" }}"
# END: Stable releases

poll_maven:
docker:
- image: cimg/node:current
resource_class: small
steps:
- checkout_code_with_cache
- run_yarn
- run:
name: Poll Maven for Artifacts
command: |
node scripts/circleci/poll-maven.js


# -------------------------
# JOBS: Nightly
# -------------------------
Expand Down Expand Up @@ -1873,6 +1893,9 @@ workflows:
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
- poll_maven:
requires:
- build_and_publish_npm_package

package_and_publish_release_dryrun:
jobs:
Expand Down
2 changes: 2 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,8 @@ function InternalTextInput(props: Props): React.Node {

let style = flattenStyle(props.style);

let style = flattenStyle(props.style);

Saadnajmi marked this conversation as resolved.
Show resolved Hide resolved
if (Platform.OS === 'ios' || Platform.OS === 'macos') {
// [macOS]
const RCTTextInputView =
Expand Down
34 changes: 28 additions & 6 deletions Libraries/ReactNative/AppContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
import {RootTagContext, createRootTag} from './RootTag';
import * as React from 'react';

const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;

type Props = $ReadOnly<{|
children?: React.Node,
fabric?: boolean,
Expand Down Expand Up @@ -45,9 +47,17 @@ class AppContainer extends React.Component<Props, State> {
};
_mainRef: ?React.ElementRef<typeof View>;
_subscription: ?EventSubscription = null;
_reactDevToolsAgentListener: ?() => void = null;

static getDerivedStateFromError: any = undefined;

mountReactDevToolsOverlays(): void {
const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;

this.setState({devtoolsOverlay});
}

componentDidMount(): void {
if (__DEV__) {
if (!this.props.internal_excludeInspector) {
Expand All @@ -69,13 +79,21 @@ class AppContainer extends React.Component<Props, State> {
this.setState({inspector});
},
);
if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__ != null) {
const DevtoolsOverlay =
require('../Inspector/DevtoolsOverlay').default;
const devtoolsOverlay = (
<DevtoolsOverlay inspectedView={this._mainRef} />

if (reactDevToolsHook != null) {
if (reactDevToolsHook.reactDevtoolsAgent) {
// In case if this is not the first AppContainer rendered and React DevTools are already attached
this.mountReactDevToolsOverlays();
return;
}

this._reactDevToolsAgentListener = () =>
this.mountReactDevToolsOverlays();

reactDevToolsHook.on(
'react-devtools',
this._reactDevToolsAgentListener,
);
this.setState({devtoolsOverlay});
}
}
}
Expand All @@ -85,6 +103,10 @@ class AppContainer extends React.Component<Props, State> {
if (this._subscription != null) {
this._subscription.remove();
}

if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) {
reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener);
}
}

render(): React.Node {
Expand Down
35 changes: 33 additions & 2 deletions React/Base/RCTBundleURLProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ extern NSString *const kRCTPlatformName; // [macOS]

@property (nonatomic, assign) BOOL enableMinification;
@property (nonatomic, assign) BOOL enableDev;
@property (nonatomic, assign) BOOL inlineSourceMap;

/**
* The scheme/protocol used of the packager, the default is the http protocol
Expand All @@ -127,13 +128,32 @@ extern NSString *const kRCTPlatformName; // [macOS]
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification;
enableMinification:(BOOL)enableMinification
__deprecated_msg(
"Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
packagerScheme:(NSString *)scheme
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
modulesOnly:(BOOL)modulesOnly
runModule:(BOOL)runModule
__deprecated_msg(
"Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
inlineSourceMap:(BOOL)inlineSourceMap;

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
packagerScheme:(NSString *)scheme
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
inlineSourceMap:(BOOL)inlineSourceMap
modulesOnly:(BOOL)modulesOnly
runModule:(BOOL)runModule;
/**
Expand All @@ -144,6 +164,17 @@ extern NSString *const kRCTPlatformName; // [macOS]
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
packagerHost:(NSString *)packagerHost
scheme:(NSString *)scheme
query:(NSString *)query;
query:(NSString *)query
__deprecated_msg("Use version with queryItems parameter instead");

/**
* Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
* In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
* resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
*/
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
packagerHost:(NSString *)packagerHost
scheme:(NSString *)scheme
queryItems:(NSArray<NSURLQueryItem *> *)queryItems;

@end
102 changes: 81 additions & 21 deletions React/Base/RCTBundleURLProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@

const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;

#if !TARGET_OS_OSX // [macOS]
NSString *const kRCTPlatformName = @"ios";
#else // [macOS
NSString *const kRCTPlatformName = @"macos";
#endif // macOS]

#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
static BOOL kRCTAllowPackagerAccess = YES;
void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
{
kRCTAllowPackagerAccess = allowed;
}
#endif
#if !TARGET_OS_OSX // [macOS]
static NSString *const kRCTPlatformName = @"ios";
#else // [macOS
static NSString *const kRCTPlatformName = @"macos";
#endif // macOS]
static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";

@implementation RCTBundleURLProvider

Expand Down Expand Up @@ -189,6 +189,7 @@ - (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(
packagerScheme:[self packagerScheme]
enableDev:[self enableDev]
enableMinification:[self enableMinification]
inlineSourceMap:[self inlineSourceMap]
modulesOnly:NO
runModule:YES];
}
Expand All @@ -201,6 +202,7 @@ - (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot
packagerScheme:[self packagerScheme]
enableDev:[self enableDev]
enableMinification:[self enableMinification]
inlineSourceMap:[self inlineSourceMap]
modulesOnly:YES
runModule:NO];
}
Expand Down Expand Up @@ -240,20 +242,37 @@ - (NSURL *)resourceURLForResourceRoot:(NSString *)root
return [[self class] resourceURLForResourcePath:path
packagerHost:packagerServerHostPort
scheme:packagerServerScheme
query:nil];
queryItems:nil];
}

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
{
return [self jsBundleURLForBundleRoot:bundleRoot
packagerHost:packagerHost
packagerScheme:nil
enableDev:enableDev
enableMinification:enableMinification
inlineSourceMap:NO
modulesOnly:NO
runModule:YES];
}

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
inlineSourceMap:(BOOL)inlineSourceMap

{
return [self jsBundleURLForBundleRoot:bundleRoot
packagerHost:packagerHost
packagerScheme:nil
enableDev:enableDev
enableMinification:enableMinification
inlineSourceMap:inlineSourceMap
modulesOnly:NO
runModule:YES];
}
Expand All @@ -265,28 +284,45 @@ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
enableMinification:(BOOL)enableMinification
modulesOnly:(BOOL)modulesOnly
runModule:(BOOL)runModule
{
return [self jsBundleURLForBundleRoot:bundleRoot
packagerHost:packagerHost
packagerScheme:nil
enableDev:enableDev
enableMinification:enableMinification
inlineSourceMap:NO
modulesOnly:modulesOnly
runModule:runModule];
}

+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
packagerHost:(NSString *)packagerHost
packagerScheme:(NSString *)scheme
enableDev:(BOOL)enableDev
enableMinification:(BOOL)enableMinification
inlineSourceMap:(BOOL)inlineSourceMap
modulesOnly:(BOOL)modulesOnly
runModule:(BOOL)runModule
{
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
BOOL lazy = enableDev;
NSArray<NSURLQueryItem *> *queryItems = @[
[[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
[[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
[[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
[[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
[[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
[[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
#ifdef HERMES_BYTECODE_VERSION
NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
#else
NSString *runtimeBytecodeVersion = @"";
[[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
#endif

// When we support only iOS 8 and above, use queryItems for a better API.
NSString *query = [NSString stringWithFormat:@"platform=%@&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
kRCTPlatformName, // [macOS]
enableDev ? @"true" : @"false",
enableMinification ? @"true" : @"false",
modulesOnly ? @"true" : @"false",
runModule ? @"true" : @"false",
runtimeBytecodeVersion];
];

NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
if (bundleID) {
query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
}
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme query:query];
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
}

+ (NSURL *)resourceURLForResourcePath:(NSString *)path
Expand All @@ -303,6 +339,20 @@ + (NSURL *)resourceURLForResourcePath:(NSString *)path
return components.URL;
}

+ (NSURL *)resourceURLForResourcePath:(NSString *)path
packagerHost:(NSString *)packagerHost
scheme:(NSString *)scheme
queryItems:(NSArray<NSURLQueryItem *> *)queryItems
{
NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
resolvingAgainstBaseURL:NO];
components.path = path;
if (queryItems != nil) {
components.queryItems = queryItems;
}
return components.URL;
}

- (void)updateValue:(id)object forKey:(NSString *)key
{
[[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
Expand All @@ -320,6 +370,11 @@ - (BOOL)enableMinification
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
}

- (BOOL)inlineSourceMap
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
}

- (NSString *)jsLocation
{
return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
Expand Down Expand Up @@ -349,6 +404,11 @@ - (void)setEnableMinification:(BOOL)enableMinification
[self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
}

- (void)setInlineSourceMap:(BOOL)inlineSourceMap
{
[self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
}

- (void)setPackagerScheme:(NSString *)packagerScheme
{
[self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
Expand Down
Loading