Commit Graph
27517 Commits
Author SHA1 Message Date
Intl Scheduler f9aa55ff01 translation auto-update for i18n/analyticsapp.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695387

fbshipit-source-id: 7ccec058f4832b819928a85c8c5b0b44965c07c6
2023-05-09 08:06:48 -07:00
Ruslan Lesiutin d3e8b646a7 upgrade react-devtools to v4.27.7 in fbsource (#37146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37146

X-link: https://github.com/facebook/flipper/pull/4706

Changelog: [Internal]

Updating react-devtools-* packages to v4.27.7

Reviewed By: jacdebug

Differential Revision: D45317588

fbshipit-source-id: 5625f654feffced92ca933796e90ac10fc4801ff
2023-05-09 07:13:39 -07:00
Tommy Nguyen cceef57be1 fix(gradle-plugin): fix nightly build regression (#37332)
Summary:
Nightly builds of Android no longer build due to a recent version format change.

## Changelog:

[ANDROID] [FIXED] - Fixed nightly builds of Android no longer building due to a recent version format change

Pull Request resolved: https://github.com/facebook/react-native/pull/37332

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
cd example
yarn android
```

Reviewed By: jacdebug

Differential Revision: D45690926

Pulled By: cortinico

fbshipit-source-id: dc935733607c2b33ba296b507a98f43ba483e348
2023-05-09 06:05:46 -07:00
shubham0142 ec66f2eeb9 Codegen 113: add isOptionalProperty in parser (#37134)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872
Add a function isOptionalProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L172-L173) and [parsers/typescript/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/components/events.js#L196). Use the parsers in the buildPropertiesForEvent.

bypass-github-export-checks

## Changelog:
[Internal][Changed]: add isOptionalProperty in parser and use it in parser events.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/37134

Test Plan: `yarn test react-native-codegen`

Reviewed By: christophpurrer

Differential Revision: D45390880

Pulled By: cipolleschi

fbshipit-source-id: bb2575b8602c6a15be0a87817ca1961ae834324e
2023-05-09 05:35:45 -07:00
Riccardo Cipolleschi c027f0a41f Fix podspec setup for 3rd parties when using dynamic linking (#37275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37275

When enabling `USE_FRAMEWORKS=dynamic`, we need to explicitly defines all the dependencies used by the pods.

This change add those missing dependencies.

## Changelog:
[iOS][Added] - Add explicit dependencies for 3rd parties libraries

Reviewed By: NickGerleman

Differential Revision: D45523646

fbshipit-source-id: 228a7e0ae98ea262af4d58b7dc855f944ebed463
2023-05-09 04:42:17 -07:00
Riccardo Cipolleschi 44af6ca03c Add React-FabricImage pod to solve Circulare dependency between Fabric image component and ImageManager (#37276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37276

When enabling dynamic linking, we had a circulr dependency between Fabric and the Image Manager.

Specifically, Image Manager depends on Fabric, but the Image component, in Fabric, is using some implementation specific files from the Image Manager that surface only when enabling the dynamic linking.

Xcode fails to find those symbols unless the dependencies are explicitly added to the podspec.

This change is technically breaking, but we tried to minimize the breakage by adding the new pod in all the required search paths.

## Changelog
[iOS][Breaking] - Add React-FabricImage pod.

Reviewed By: NickGerleman

Differential Revision: D45517278

fbshipit-source-id: 994aa8c40301c68bf9fecdf46de7833028f0d3c2
2023-05-09 04:42:17 -07:00
Blake Friedman 6d83889ba9 Fix for investigating high number of ReactViewManager exceptions (#37312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37312

## Why?
Internally one of our apps is using a custom view manager that isn't respecting the `NotNull` constraint,
causing a runtime error. We have no visibility over what this manager is. The custom exception will give
us more clues to track this down.

If you look at the below stack trace, it's pretty clear the earlier approach would fail:
{F979121677}

Like a bit of a noddy, I've been waiting for days for the new exception to be hit, when it's very clear from [3 May](https://fburl.com/scuba/errorreporting_facebook_android_crashes/a63t7ilm) that this wasn't going to happen:
{F979130611}
The lesson here is to monitor 3 things:
1. the [original NullPointerExceptions](https://fburl.com/scuba/errorreporting_facebook_android_crashes/m2o0t45h),
2. the new [ReactViewReturnTypeException](https://fburl.com/scuba/errorreporting_facebook_android_crashes/2j0vtuwb), and
3. the [number of users exposed](https://fburl.com/scuba/mobile_active_users/9mbevwed) to whatever release this change goes out on.

Changelog: [Internal]
The NullPointerExceptions are hit when call the the java createView method. Previous (D45185598)
didn't capture this exception and wasn't very useful.

Reviewed By: cortinico

Differential Revision: D45660487

fbshipit-source-id: f1a7a114778a0c2eae963d64558541266ed57bda
2023-05-09 04:30:57 -07:00
Pieter De Baets e43607c5a7 Fix missing override in ConcreteState (#37279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37279

Changelog: [Internal]

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D45610260

fbshipit-source-id: 7610ec3898e8cc75fa7ed20d6f87f76f97cdfd12
2023-05-09 04:22:34 -07:00
Jerry 5dfa38a20e fix: fix FlatList viewabilityConfig prop type (#37299)
Summary:
FlatList `viewabilityConfig` prop seems  no need to be any type. So I replaced it with `ViewabilityConfig` from `VirtualizedList.d.ts`

## Changelog:

[GENERAL] [FIXED] - change FlatList `viewabilityConfig` prop type `any` to `ViewabilityConfig`

Pull Request resolved: https://github.com/facebook/react-native/pull/37299

Test Plan: Ran yarn test-typescript and yarn test-typescript-offline with no errors.

Reviewed By: jacdebug

Differential Revision: D45689033

Pulled By: cipolleschi

fbshipit-source-id: e7fd31c534c5f47321b36d0d764f466392ad897e
2023-05-09 04:13:09 -07:00
Ruslan Lesiutin e540d05846 RN: Make hermes-inspector-msggen tests visible for jest matcher (#37131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37131

Changelog: [Internal]

Looks like all this time jest was not running these tests, because their file names are not matching the
https://www.internalfb.com/code/fbsource/[1e8a1b307ffd]/xplat/js/react-native-github/jest.config.js?lines=30

- Renamed tests to kebab-case
- Some of them were failing, now updated

Reviewed By: motiz88

Differential Revision: D45368748

fbshipit-source-id: a00e6ebb8f37363516b1af79d6251fbceb0afb68
2023-05-09 03:14:45 -07:00
Intl Scheduler 8132500d93 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686942

fbshipit-source-id: e3dc213144d91b6c98b84d1c477bdeb317132a55
2023-05-09 01:40:57 -07:00
Intl Scheduler eb1393de2d translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686955

fbshipit-source-id: 340e75e6809802ca9425ce43abfaa494b2f9e1b4
2023-05-09 01:40:57 -07:00
Intl Scheduler 105f8e3c74 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686940

fbshipit-source-id: 8f5ff76be02ee21302138afbdce98cb7e8bd6809
2023-05-09 01:40:57 -07:00
Intl Scheduler 4507785dff translation auto-update for i18n/anna.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686953

fbshipit-source-id: a6be9ef18ec3db370acd8bf6b9e89d7a3db417fd
2023-05-09 01:40:57 -07:00
Intl Scheduler 90442ac66e translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907875215310
Sandcastle Job Instance ID: 18014399454367170
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45681775

fbshipit-source-id: a89dfaec4caf04b8f0bdf91e0a85f34a4c1a841c
2023-05-08 19:28:34 -07:00
Intl Scheduler 062eaae78c translation auto-update for i18n/messenger.config.json on master
Summary:
Chronos Job Instance ID: 1125907875215310
Sandcastle Job Instance ID: 18014399454367170
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45681771

fbshipit-source-id: 06a2dfc4d98c7b5cc61f3b293ebf89a0b06c7c98
2023-05-08 19:28:34 -07:00
Intl Scheduler 2fd2579ddb translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907875215310
Sandcastle Job Instance ID: 18014399454367170
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45681778

fbshipit-source-id: 3dda59a7a969a96eb727822041145008da7c0d3e
2023-05-08 19:28:34 -07:00
Intl Scheduler a797b49c71 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907875215310
Sandcastle Job Instance ID: 18014399454367170
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45681770

fbshipit-source-id: e6e03111dcc726b3249b42d34ef5c6ee178257f1
2023-05-08 19:28:34 -07:00
Intl Scheduler 1c28aa4e20 translation auto-update for i18n/creatorstudio.config.json on master
Summary:
Chronos Job Instance ID: 1125907875215310
Sandcastle Job Instance ID: 18014399454367170
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45681780

fbshipit-source-id: a9eef55ac475e0b3de5fa2ff4327a0194545e624
2023-05-08 19:28:34 -07:00
Luna Wei ef7bd883ad Remove .js.flow files (#37311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37311

Changelog: [Internal] - Remove js.flow files

Reviewed By: yungsters

Differential Revision: D45639737

fbshipit-source-id: 9069c0ac53e86b4f300d4f243817020ac7c3b5e4
2023-05-08 17:36:11 -07:00
Nick Gerleman 68ce28a0ee Fix YGNodeSetConfig causing excessive dirtying (#37316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37316

In Fabric, a ShadowNode may re-initialize YGConfig several times throughout the lifetime of a perpetually cloned Yoga Node.

RN sets `pointScaleFactor` lazily, when laying out the rootview. So right now it initializes a config to `pointScaleFactor` of 1.0, sets it, sets a new `pointScaleFactor` on the config, then repeats. This cycles the config between two `pointScaleFactor` values and will excessively dirty the node now that `YGNodeSetConfig` dirties on config change (D45505089)

This change makes it so that we retain previously used `pointScaleFactor` when cloning the Yoga nodes.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D45669878

fbshipit-source-id: bfd2e185d9264a1cda64e59132960060385e16f1
2023-05-08 16:30:06 -07:00
Phillip Pan 86f54e1ec3 get rid of unnecessary self dereference in RCTInstance (#37319)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37319

Reviewed By: sammy-SC

Differential Revision: D45671784

fbshipit-source-id: 4af8f8f0a46886ec5c2cf022e8a60f942251ff6e
2023-05-08 16:07:03 -07:00
Phillip Pan a1885e9f32 follow more standard ios style guideline in RCTInstance (#37320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37320

Changelog: [Internal]

this is just my personal taste, but here's what i did, would love to hear others' opinions (and maybe get these eventually codified):
- private methods preprended with underscore
- pragma mark groupings in this order: public, overrides, protocols, then private

Reviewed By: cipolleschi, dmytrorykun

Differential Revision: D45582491

fbshipit-source-id: 76c80955422ea7f29e7307ce2c08f70e7e8a5188
2023-05-08 16:07:03 -07:00
Nick Gerleman ea12c4c3d0 Fixup fbsource for $ArrayLike FlatList data (#37314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37314

Turns out we never transitioned fbsource to an API change we made for FlatList, due to mismatched `.js` and `.js.flow` files.

Inside of RN, `$ArrayLike` in Flow, unlike `ArrayLike` in TypeScript, treats `length` as writable. So we wrap that in `$ReadOnly`. Another option might be to inline our own version, since it is not the only [case where they differ](https://fb.workplace.com/groups/flow/permalink/24328911383397481/).

In product code, the changes end up impacting:
1. `getItemLayout` is no longer typed to receive a mutable array. I changed all of the incompatible explicit type parameters from `Array<ItemT>` to `Iterable<ItemT>`.
2. Flow has a harder time inferring destructured `data` in examples that were passing `any` to FlatList, so I needed to give some type hints where `data` was previously untyped
3. Replace some `$FlowFixMe[incompatible-type]` with `$FlowFixMe[incompatible-type-arg]`

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D45665199

fbshipit-source-id: 59aa908e277a27f7ca88acb48de493d2782517a9
2023-05-08 15:49:50 -07:00
axelaviloff 2029688630 Code improving PR (#37297)
Summary:
It's just a code improvement, with postponement of best practices.

## Changelog:

[Android] [Added] - Code improvement.

Pull Request resolved: https://github.com/facebook/react-native/pull/37297

Test Plan: The new code does not change existing logic.

Reviewed By: NickGerleman

Differential Revision: D45658400

Pulled By: yungsters

fbshipit-source-id: dcbe4b732d665a0c3c26ee2cf28843f951c3979d
2023-05-08 15:45:14 -07:00
kassens (Meta Employee) f8aeef96c2 Small flowconfig fixes (#26784)
Summary:
- The whole project root is included by default anyway, the include
section should be redundant and just misleading.
- The generated ignore paths ignore more than intended as they didn't
escape the `.` for regex.

Changelog: [Internal]

Reviewed By: mofeiZ

Differential Revision: D45658874

Pulled By: kassens

fbshipit-source-id: fd1ec59eeffa3ac1cb39c190e17f018951fafbe7
2023-05-08 14:09:24 -07:00
David Vacca 6a0bd301b6 Mark ReactInstanceDelegate as UnstableReactNativeAPI (#37288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37288

In this diff I'm marking ReactInstanceDelegate as UnstableReactNativeAPI

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D45577887

fbshipit-source-id: 4b5548f289409c47e67895b6a78d76d846629b80
2023-05-08 14:02:15 -07:00
Nick Gerleman 17f8c2d126 Re-add "aria-live" usage to UTs (#37307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37307

This should no longer log to `console.error()` after the latest prop-types update.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D45654389

fbshipit-source-id: c3d04c6a74b335e300137aa67bd7fb3640ba0303
2023-05-08 08:13:02 -07:00
acdlite 97533dbc47 Add useFormStatus to server rendering stub (#26788)
Summary:
This was an oversight when I set up the hook in #26719.

DiffTrain build for commit https://github.com/facebook/react/commit/16d053d592673dd5565d85109f259371b23f87e8.

Changelog: [Internal]

Reviewed By: kassens

Differential Revision: D45639141

fbshipit-source-id: 6d89d7521ed38d28b23b02545cfad0836ba12a38
2023-05-08 08:09:16 -07:00
gaearon (Meta Employee) 37a8fcb90d Print a hint where to get the token (#26783)
Summary:
I always forget where to get it.

DiffTrain build for commit https://github.com/facebook/react/commit/efb381bbf981aedbf4eb9e1bd0e6e30abce266d1.

Changelog: [Internal]

Reviewed By: kassens

Differential Revision: D45639138

Pulled By: gaearon

fbshipit-source-id: cfcdb6f7dfd366256c7557f43da62c2f78774fde
2023-05-08 08:09:16 -07:00
sammy-SC (Meta Employee)andDan Abramov d2c67c5df8 Use native scheduler if defined in global scope (#26554)
Summary:
DiffTrain build for commit https://github.com/facebook/react/commit/b00e27342d6ff0f2a3a57b8e1edf66290d27cf07.

Changelog: [Internal]

Reviewed By: kassens

Differential Revision: D45639137

Pulled By: sammy-SC

fbshipit-source-id: 0f03a42d287243938c5d3a98e62297a3d02e532c

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
2023-05-08 08:09:16 -07:00
Nick Gerleman e1876af923 Refactor MobileConfig Access for "react_fabric: treat_auto_as_undefined" (#37208)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37208

Reviewed By: javache

Differential Revision: D45434603

fbshipit-source-id: 9081ea11c87a05e0d8ff95e55d8aa8bcd52b4c39
2023-05-07 01:53:04 -07:00
Nick Gerleman bde38d543e Dirty nodes when dynamically setting config (#37207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37207

X-link: https://github.com/facebook/yoga/pull/1274

Yoga exposes public APIs for dirtying Nodes, but will itself perform dirty marking when changing bits which invalidate layout. E.g. changing the style of a Node will invalidate it along with every parent Node.

Because config setting is newly public to the C ABI, this makes a similar change so that replacing a Node's config will dirty the tree above the node if there is a layout impacting config change (I don't think children need to be invalidated since child output shouldn't change given the same owner dimensions).

One quirk of this is that configs may be changed independently of the node. So someone could attach a config to a Node, then change the live config after the fact. The config does not currently have a back pointer to the Node, so we do not invalidate in that case of live config edits. The future work to rectify this would be to make configs immutable once created.

There are also currently some experimental features here which should maybe be compared, but these should be moved to YGErrata anyway.

Reviewed By: javache

Differential Revision: D45505089

fbshipit-source-id: 72b2b84ba758679af081d92e7403750c9cc53cb5
2023-05-07 00:34:02 -07:00
Intl Scheduler 1af868c528 translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907873576305
Sandcastle Job Instance ID: 13510799825169895
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45636201

fbshipit-source-id: c61e8db851ae7a5106796c213ff987b4b38282d0
2023-05-06 07:29:17 -07:00
Lu Su 2ffb11bacb Fix broken android extraction/translation pipeline (#37292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37292

<level:mustfix> <name:i18n.error> Failed extracting strings from file: <../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml>
From IntlAndroidResourceExtractionException: Failed extracting resource catalyst_dev_menu_header
From InvariantViolationException: Format specifiers must be wrapped by an xliff:g tag
(FBLogger Parent Frame: /var/sandcastle/deployment/mount/54023/flib/intern/intl/extraction/StringExtractionLogger.php:43)

https://www.internalfb.com/skycastle/run/1932044240142241285/insights

Changelog:
[Internal] [Changed] - Fix broken pipelines

Differential Revision: D45615679

fbshipit-source-id: 64b2bae542c6bd0e3d5e25d3054ea916d52b0325
2023-05-05 20:36:43 -07:00
Ramanpreet Nara 1d0be6d2c8 Filter out legacy modules from TurboModule system
Summary: Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D45628219

fbshipit-source-id: 8ff5c01f143b85ac199bc5913dba9c4fb5ec4700
2023-05-05 18:08:28 -07:00
David Vacca bea3821155 Fix emission of pending events in RN Android (#37290)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37290

This diff removes an assertion that was causing a crash in production.
The root cause of the bug is that there's a race condition on viewState.mEventEmitter, the value of this field changes while the method is being executed.
In this diff I'm avoiding the crash by dispatching the event as soon as possible and unblock the fix in production

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45622656

fbshipit-source-id: a6ea64e38189676885366931de84dc5433834fff
2023-05-05 17:03:48 -07:00
Phillip Pan 28a3d45058 do not expose RCTPerformanceLogger from RCTInstance (#37246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37246

Changelog: [Internal]

since no one is using this outside of RCTInstance, let's clean this up!

Reviewed By: sammy-SC

Differential Revision: D45553212

fbshipit-source-id: 959fb454ff403c89ec5005b9a602986769cec388
2023-05-05 16:43:27 -07:00
hoxyq (Meta Employee) 33812e99e8 React DevTools 4.27.6 -> 4.27.7 (#26780)
Summary:
List of changes:
* DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in
[#26779](https://github.com/facebook/react/pull/26779))
* fix[dynamic-scripts-injection]: unregister content scripts before
registration ([hoxyq](https://github.com/hoxyq) in
[#26765](https://github.com/facebook/react/pull/26765))

DiffTrain build for commit https://github.com/facebook/react/commit/783e7fcfa3e354b3be13f5403fc2fd2260db00b4.

Changelog: [Internal]

<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45575104

Pulled By: tyao1

fbshipit-source-id: c065eb8f1f200170f611b5becc0332109f22ef71
2023-05-05 16:36:15 -07:00
hoxyq (Meta Employee) 41c668c305 DevTools: fix backend activation (#26779)
Summary:
## Summary
We have a case:
1. Open components tab
2. Close Chrome / Firefox devtools window completely
3. Reopen browser devtools panel
4. Open components tab

Currently, in version 4.27.6, we cannot load the components tree.

This PR contains two changes:
- non-functional refactoring in
`react-devtools-shared/src/devtools/store.js`: removed some redundant
type castings.
- fixed backend manager logic (introduced in
https://github.com/facebook/react/pull/26615) to activate already
registered backends. Looks like frontend of devtools also depends on
`renderer-attached` event, without it component tree won't load.

## How did you test this change?
This fixes the case mentioned prior. Currently in 4.27.6 version it is
not working, we need to refresh the page to make it work.

I've tested this in several environments: chrome, firefox, standalone
with RN application.

DiffTrain build for commit https://github.com/facebook/react/commit/377c5175f78e47a3f01d323ad6528a696c88b76e.

Changelog: [Internal]
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45573294

Pulled By: tyao1

fbshipit-source-id: 42a8e4a54cd367080fdb7e1c357c48ae3564b7f0
2023-05-05 16:36:15 -07:00
sebmarkbage 8fdec10e01 Progressively Enhanced Server Actions (#26774)
Summary:
This automatically exposes `$$FORM_ACTIONS` on Server References coming
from Flight. So that when they're used in a form action, we can encode
the ID for the server reference as a hidden field or as part of the name
of a button.

If the Server Action is a bound function it can have complex data
associated with it. In this case this additional data is encoded as
additional form fields.

To process a POST on the server there's now a `decodeAction` helper that
can take one of these progressive posts from FormData and give you a
function that is prebound with the correct closure and FormData so that
you can just invoke it.

I updated the fixture which now has a "Server State" that gets
automatically refreshed. This also lets us visualize form fields.
There's no "Action State" here for showing error messages that are not
thrown, that's still up to user space.

DiffTrain build for commit https://github.com/facebook/react/commit/aef7ce5547c9489dc48e31f69b002cd17206e0cb.

Changelog: [Internal]
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: christophpurrer

Differential Revision: D45548613

Pulled By: tyao1

fbshipit-source-id: 0d4206c18c4818fa410e8b18f3a0f0942237c91b
2023-05-05 16:36:15 -07:00
sebmarkbage 896f3c0790 Gracefully handle suspending in DOM configs (#26768)
Summary:
E.g. if we suspend (throw a promise) in pushStartInstance today we might
have already pushed some chunks (or even child segments potentially). We
should revert back to where we were.

This doesn't usually happen because when we suspend in a component it
doesn't write anything itself, it'll always defer to som host instance
to do the writing.

There was a todo about this already but I'm not 100% sure it's always
safe when suspending. It should be safe when suspending just regularly
because it's just a noop. We might not even want "throwing a promise" in
this mechanism to be supported longer term but for now that's how a
suspend in internals.

DiffTrain build for commit https://github.com/facebook/react/commit/c10010a6a00911fe99452bc561dd47c3e15f4eb8.

Changelog: [Internal]

<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: christophpurrer

Differential Revision: D45547661

Pulled By: tyao1

fbshipit-source-id: 69654c95f06bc0f056fc8231e41aa395931af228
2023-05-05 16:36:15 -07:00
acdlite 2db8c8f225 Add useFormStatus to Flight fixture (#26773)
Summary:
DiffTrain build for commit https://github.com/facebook/react/commit/f533cee8cb4fb54c170230741eea7902cb41ee06.

Changelog: [Internal]
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: christophpurrer

Differential Revision: D45540265

Pulled By: tyao1

fbshipit-source-id: 3dd365f0569953075c61f7fdca2eb099f1bf98d7
2023-05-05 16:36:15 -07:00
sebmarkbage 98f2c1ed6e Reuse request so that a ReabableStream body does not become disturbed (#26771)
Summary:
DiffTrain build for commit https://github.com/facebook/react/commit/2c1117a8d008e34eb77eaaf7b8ef315a38644735.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: kassens

Differential Revision: D45539259

Pulled By: tyao1

fbshipit-source-id: a07d78cc68aae4a5002ef20003aedc33e65f3f51
2023-05-05 16:36:15 -07:00
sebmarkbage 9af7245892 Check for nullish values on ReactCustomFormAction (#26770)
Summary:
Usually we don't have to do this since we only set these in the loop but
the ReactCustomFormAction props are optional so they might be undefined.

Also moved it to a general type since it's a semi-public API.

DiffTrain build for commit https://github.com/facebook/react/commit/fa7a447b9ce5a4f0be592fc2946380b0fa3b29c0.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45537647

Pulled By: tyao1

fbshipit-source-id: 15aa00347467e424e3fa7d509139b2f87cdcdb69
2023-05-05 16:36:15 -07:00
acdlite ba39d87113 useOptimisticState -> useOptimistic (#26772)
Summary:
Drop the "state". Just "useOptimistic". It's cleaner.

This is still an experimental API. May not be the final name.

DiffTrain build for commit https://github.com/facebook/react/commit/b7972822b5887d05ae772ef757a453265b4b7aec.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45537245

Pulled By: tyao1

fbshipit-source-id: e31f77c4a55e8931c9671d13fc43d6ff32e25dbb
2023-05-05 16:36:15 -07:00
acdlite 57c9cd19b6 Add "canary" to list of allowed npm dist tags (#26767)
Summary:
Forgot this allowlist existed. It's an extra safeguard, in case we mess
up the configuration somehow.

DiffTrain build for commit https://github.com/facebook/react/commit/388686f291afb2362fdc813c49f75b4132bc1314.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45532426

Pulled By: tyao1

fbshipit-source-id: e81a2efe340bfa1f8397c5b1301956a0e94e5357
2023-05-05 16:36:15 -07:00
hoxyq (Meta Employee) 6892a15a71 fix[dynamic-scripts-injection]: unregister content scripts before registration (#26765)
Summary:
## Summary
Fixes #26756.

DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
incognito mode. This is not happening straight-forward, but if extension
is toggled on and off, the next time I try to open it I am receiving an
error that content script was already registered.

<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">

- Unregistering content scripts before attempting to register them
again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
so this should be expected behaviour.
- Fixed error logging

## How did you test this change?
Local build of extension for Chrome, trying the same steps, which
resulted in an error.
No regression in performance, tested on react.dev, still the same.

DiffTrain build for commit https://github.com/facebook/react/commit/8a25302c668d6f9a24f6680fb4947e9b388bb7d9.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45532160

Pulled By: tyao1

fbshipit-source-id: d021721a4aee3e052512006f61cfdf72df56dbda
2023-05-05 16:36:15 -07:00
acdlite bebd8d0470 Rename "next" prerelease channel to "canary" (#26761)
Summary:
The "next" prerelease channel represents what will be published the next
time we do a stable release. We publish a new "next" release every day
using a timed CI workflow.

When we introduced this prerelease channel a few years ago, another name
we considered was "canary". But I proposed "next" instead to create a
greater distinction between this channel and the "experimental" channel
(which is published at the same cadence, but includes extra experimental
features), because some other projects use "canary" to refer to releases
that are more unstable than how we would use it.

The main downside of "next" is someone might mistakenly assume the name
refers to Next.js. We were aware of this risk at the time but didn't
think it would be an issue in practice.

However, colloquially, we've ended up referring to this as the "canary"
channel anyway to avoid precisely that confusion.

So after further discussion, we've agreed to rename to "canary".

This affects the label used in the version string (e.g.
`18.3.0-next-a1c2d3e4` becomes `18.3.0-canary-a1c2d3e4`) as well as the
npm dist tags used to publish the releases. For now, I've chosen to
publish the canaries using both `canary` and `next` dist tags, so that
downstream consumers who might depend on `next` have time to adjust. We
can remove that later after the change has been communicated.

DiffTrain build for commit https://github.com/facebook/react/commit/2c2476834a7c739ca239750b73f74aa1df144a93.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45531681

Pulled By: tyao1

fbshipit-source-id: 27ebe14eabad5c92fe6e5aa4944ff798b808ec33
2023-05-05 16:36:15 -07:00
acdlite fab2bd9b4c Remove deprecated workflow key from Circle config (#26762)
Summary:
This key was only valid during the 2.0 beta period so we can remove it.

DiffTrain build for commit https://github.com/facebook/react/commit/fa4314841e7fdeef6e6bc5a7722fe74dc8e9fd89.

Changelog: [Internal]:
<< DO NOT EDIT BELOW THIS LINE >>

Reviewed By: sammy-SC

Differential Revision: D45531656

Pulled By: tyao1

fbshipit-source-id: e2e3c9e5463c39e301361e18364d22dcec428c8a
2023-05-05 16:36:15 -07:00