Compare commits

...
Author SHA1 Message Date
Distiller c39538b79d [0.73.8] Bump version numbers 2024-04-30 10:07:20 +00:00
Riccardo Cipolleschi fd48b94319 [LOCAL][iOS] Add missing dependency to React-RuntimeHermes podspec 2024-04-29 18:56:19 +01:00
hurali97andThibault Malbranche 12da0cda4c pick 42978 add privacy manifest to hello world template 2024-04-29 18:12:15 +02:00
Riccardo CipolleschiandThibault Malbranche 7e4626cda4 Fix enable hermes debugger in Bridgeless mode
Summary:
Set the proper build flags for debugging in Bridgeless mode.

This fixes [#44240](https://github.com/facebook/react-native/issues/44240)

## Changelog:
[iOS][Fixed] - Add `HERMES_ENABLE_DEBUGGER=1` flag to React-RuntimeApple

Reviewed By: cortinico

Differential Revision: D56575647

fbshipit-source-id: a0613a5d46caeb1d3e636e54ecd43428fbaf46e8
2024-04-29 17:59:36 +02:00
Riccardo CipolleschiandThibault Malbranche 9bf64c4396 Fix Symbol not found: (_JSGlobalContextSetInspectable) (#44185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44185

This change will fix a symbol not found for JSC Runtime.

The `if` check was not a compile time check, therefore the symbol ended up in the binary even if it is not available.

Following this post on [Apple forum](https://forums.developer.apple.com/forums/thread/749534), this changes should do the trick.

## Changelog
[iOS][Fixed] - Fix Symbol not found: (_JSGlobalContextSetInspectable)

Reviewed By: hash3r

Differential Revision: D56425834

fbshipit-source-id: a37af51b078bd47a938e6b65d9d8e0f7506e746f
2024-04-29 17:59:25 +02:00
Thibault Malbranche 1d0cbfd01b Update Hermes version 2024-04-29 17:58:21 +02:00
Alex Hunt 7e7277eb6c Update Hermes version
For pick request https://github.com/reactwg/react-native-releases/issues/242
2024-04-25 12:08:25 +01:00
Alfonso Curbelo 262c81a871 Update Podfile.lock 2024-04-18 12:44:28 -04:00
Distiller 8b09449b0c [0.73.7] Bump version numbers 2024-04-18 14:43:16 +00:00
Alfonso Curbelo 1a53ac85fe Remove extra pod functions from bad cherry-pick 2024-04-12 13:57:41 -04:00
Phillip PanandAlfonso Curbelo 3ccbd9cd8c add privacy manifest to pod install
Summary:
Changelog: [iOS][Added]

this creates the RN privacy manifest in the ios build step if user has not created one yet. the reasons have been added for the following APIs:

NSPrivacyAccessedAPICategoryFileTimestamp
- C617.1: We use fstat and stat in a few places in the C++ layer. We use these to read information about the JavaScript files in RN.

NSPrivacyAccessedAPICategoryUserDefaults
- CA92.1: We access NSUserDefaults in a few places.
1) To store RTL preferences
2) As part of caching server URLs for developer mode
3) A generic native module that wraps NSUserDefaults

NSPrivacyAccessedAPICategorySystemBootTime
- 35F9.1: Best guess reason from RR API pulled in by boost

Reviewed By: cipolleschi

Differential Revision: D53687232

fbshipit-source-id: 6dffb1a6013f8f29438a49752e47ed75c13f4a5c
2024-04-12 11:02:08 -04:00
Jean-Baptiste LARRIVIEREandAlfonso Curbelo 2bcf18812a fix: build settings for custom build configuration (#43780)
Summary:
This allows build configuration named like `StagingDebug` to match with settings applied to `Debug` This fixes https://github.com/facebook/react-native/issues/43185

Custom build setting were only applied to `Debug` build configurations, preventing configurations named `StagingDebug` or similar to access the new experimental debugger, as reported in https://github.com/facebook/react-native/issues/43185

This now applies the setting to every configuration ending with `Debug`

## Changelog:

[IOS] [CHANGED] - fix: build settings for custom build configuration

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

Reviewed By: dmytrorykun

Differential Revision: D55688996

Pulled By: cipolleschi

fbshipit-source-id: 1f34cd722f6acfaa08d3377e19a04d08af97ed7c
2024-04-12 10:51:34 -04:00
Nick GerlemanandAlfonso Curbelo bd19d0ec6a Fix Android HorizontalScrollView fling when content length less than ScrollView length (#43563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43563

Fixes https://github.com/facebook/react-native/issues/42874

## Sumary

D9405703 added some custom logic for Flings, to support FlatList scenarios where content is being added on the fly, during Fling animation. This works by allowing start Fling to not have bounds, then correcting/cancelling Fling when overscroll happens over a bound that would normally be allowed.

This has some math to try to determine max content length, and will clamp to this when scrolling over it. This logic is incorrect when content length is less than scrollview length, and we end up snapping to a negative offset.

This change adds clamping, so that we don't snap to negative position in horizontal scroll view. This clamping was already indirectly present on vertical scroll view. https://www.internalfb.com/code/fbsource/[b43cdf9b2fec71f5341ec8ff2d47e28a066f052e]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java?lines=609

## Test Plan

Above issue no longer reproes. Flinging while content is being added to horizontal FlatList still works correctly.

Changelog:
[Android][Fixed] - Fix Android HorizontalScrollView fling when content length less than ScrollView length

Reviewed By: javache

Differential Revision: D55108818

fbshipit-source-id: 7cf0065f9f92832cc2606d1c7534fc150407b9c9
2024-04-12 10:50:48 -04:00
huangtaibinandAlfonso Curbelo 342ce6115b Fix crash in getChildDrawingOrder (#40859)
Summary:
Problem Causes: In ReactViewGroup, there is a conflict between the zIndex attribute and the removeClippedSubviews optimization attribute. When both are used at the same time, the array mDrawingOrderIndices in ViewGroupDrawingOrderHelper that records the rendering order of subviews is not reset when super is called in the updateSubviewClipStatus method to add and remove subviews.

Solution:�Because there are many third-party components that inherit from or depend on ReactViewGroup, all methods for adding and removing subviews in ViewGroup need to be override in ReactViewGroup, and ViewGroupDrawingOrderHelper corresponding to handleAddView and handleRemoveView needs to be called in these methods. And all the precautions for directly calling super to add and remove subviews are changed to calling the overridden method by ReactViewGroup.

Special Note: All addView related methods in ViewGroup will eventually be called to the addView(View child, int index, LayoutParams params) method, except addViewInLayout. Regarding the method of adding subviews, we only need to override  addView(View child, int index, LayoutParams params) and addViewInLayout(View child, int index, LayoutParams params,boolean preventRequestLayout) in ReactViewGroup.

## Changelog:
[Android] [Fixed] - Fix the crash in ReactViewGroup of https://github.com/facebook/react-native/issues/30785

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

Reviewed By: NickGerleman

Differential Revision: D50321718

Pulled By: javache

fbshipit-source-id: 7fa7069937b8c2afb9f30dd10554370b1be5d515
2024-04-12 10:50:14 -04:00
Evert EtiandAlfonso Curbelo b741899f99 Fix possible deadlock in dispatchViewUpdates (#43643)
Summary:
In https://github.com/th3rdwave/react-native-safe-area-context/issues/448 it was noticed that from 0.72 (https://github.com/facebook/react-native/commit/bc766ec7f8b18ddc0ff72a2fff5783eeeff24857 https://github.com/facebook/react-native/pull/35889) it was possible to get a deadlock in dispatchViewUpdates. ([More details](https://github.com/th3rdwave/react-native-safe-area-context/issues/448#issuecomment-1871155936))

This deadlock resulted in a laggy experience for all users using https://github.com/th3rdwave/react-native-safe-area-context/ on Android.

To avoid this problem, the author of the original fix [proposed](https://github.com/th3rdwave/react-native-safe-area-context/issues/448#issuecomment-1872121172) this solution which was tested by Discord and many other users.

It would be great to have this backported to 0.72 and 0.73 because of the large userbase using react-native-safe-area-context since it's recommended by expo and react-navigation.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

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

[ANDROID] [FIXED] - Fixed possible deadlock in dispatchViewUpdates

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

Test Plan:
The original memory leak remains fixed, and can be verified in https://github.com/feiyin0719/RNMemoryLeakAndroid.

To verify the deadlock is gone, every app using https://github.com/th3rdwave/react-native-safe-area-context will work smoothly and not log any excessive `Timed out waiting for layout`
(https://github.com/17Amir17/SafeAreaContext)

Reviewed By: arushikesarwani94

Differential Revision: D55339059

Pulled By: zeyap

fbshipit-source-id: c067997364fbec734510ce99b9994e89d044384a
2024-04-12 10:47:36 -04:00
Alfonso CurbeloandGitHub 2f98436878 Merge pull request #43896 from facebook/cipolleschi/fix_yoga_archive_0.73
[Yoga][0.73] Fix archive for MacOS Catalyst
2024-04-12 10:35:55 -04:00
Riccardo Cipolleschi a8a2f1a578 [Yoga] Fix archiving for Mac Catalyst 2024-04-05 10:34:23 +01:00
hurali97 529bcc0f64 Local: update rn-tester podfile 2024-03-11 20:15:35 +05:00
Distiller 0384caad34 [0.73.6] Bump version numbers 2024-03-11 09:25:12 +00:00
Luna Wei 28f604a97d Pick adaf5eba3e fixes ##133 2024-03-08 10:28:11 -08:00
hurali97 e9bea3a9f3 Local: update rn-tester podfile 2024-03-07 21:31:06 +05:00
Muhammad Hur AliandGitHub 102a596e7a Merge pull request #43341 from facebook/cipolleschi/bump-flipper
[RN][iOS] Fix flipper for Xcode 15.3
2024-03-07 11:56:53 +05:00
Riccardo CipolleschiandGitHub 228c2b0468 Fix ruby typo 2024-03-06 19:16:41 +00:00
Muhammad Hur AliandGitHub 12381e2b8b Merge pull request #43246 from facebook/fix-hermes-bfs-073
[RN][iOS]Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE
2024-03-06 22:03:42 +05:00
Samuel Suslaandhurali97 d9794916b0 remove animation from borderLayer to stop unwanted animations (#42922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42922

changelog: [fix][ios] prevent unwanted border animation

The problem: CALayer and its properties are animatable. If RN applies mutations inside an animation block, it will animate. In this particular example, it was animated because of a transition applied by the library and because we were not creating new views, but recycling views from previous screen.

This caused size of _borderLayer to change from value A to value B inside of animation block. To resolve this, call removeAllAnimations on borderLayer.

Reviewed By: cipolleschi

Differential Revision: D53566886

fbshipit-source-id: 98e0b01a9185046e1ee500665c1832060ecc8884
2024-03-06 21:15:10 +05:00
Riccardo Cipolleschi 9d22a7fd0e [RN][iOS] Fix flipper for Xcode 15.3 2024-03-06 15:31:08 +00:00
Riccardo Cipolleschi 51b80477c7 [RN][iOS]Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE 2024-02-29 10:32:42 +00:00
Distiller 02f163e4e8 [0.73.5] Bump version numbers 2024-02-26 18:03:58 +00:00
Luna Wei bcea2b49fa choco install -y 2024-02-22 12:21:06 -08:00
Luna Wei 9c9534889c Revert "[0.73-stable] Cherry-pick improvements to monorepo publish script (#42991)"
This reverts commit 62c4664849.
2024-02-22 12:14:18 -08:00
Luna Wei a65555501a Revert "Remove getTagsFromCommit because we didnt pick https://github.com/facebook/react-native/pull/42146"
This reverts commit 7d06cd869a.
2024-02-22 12:13:57 -08:00
Luna Wei d1ca7db8fb bumped packages versions
#publish-packages-to-npm
2024-02-20 13:55:28 -08:00
Fabrizio BertoglioandLuna Wei 5ca5e3b600 Fix TextInput vertical alignment issue when using lineHeight prop on iOS without changing Text baseline (Paper - old arch) (#38359)
Summary:
This PR fixes visual regression introduced with https://github.com/facebook/react-native/pull/37465#issuecomment-1631974927

Adding paragraphStyle.maximumLineHeight to a iOS UITextField displays the text under the UITextField ([ios-screenshot-1][1], [ios-screenshot-2][2], [ios-screenshot-3][3]).

The PR implements the logic from RCTTextShadowView [#postprocessAttributedText](https://github.com/facebook/react-native/blob/9ab27e8895d6934e72ebdc601d169578ab9628f1/packages/react-native/Libraries/Text/Text/RCTTextShadowView.m#L165-L167) in RCTBaseTextInpuShadowView [#uiManagerWillPerformMounting](https://github.com/facebook/react-native/blob/4c944540f732c6055d447ecaf37d5c8f3eec1bc4/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m#L130-L192).

[1]: https://user-images.githubusercontent.com/24992535/238834159-566f7eef-ea2d-4fd4-a519-099b0a12046c.png "ios-screenshot-1"
[2]: https://user-images.githubusercontent.com/24992535/238834184-feb454a9-6504-4832-aec8-989f1d027861.png "ios-screenshot-2"
[3]: https://user-images.githubusercontent.com/24992535/238834283-cf572f94-a641-4790-92bf-bbe43afb1443.png "ios-screenshot-3"

[4]: https://github.com/Expensify/App/assets/24992535/06726b45-7e35-4003-9fcc-50c8d0dff0f6
[5]: https://github.com/Expensify/App/assets/24992535/d9745d29-8863-4170-bcc3-e78fa7e550d2

fixes https://github.com/facebook/react-native/issues/28012 fixes https://github.com/facebook/react-native/issues/33986
Related https://github.com/facebook/react-native/issues/35741 https://github.com/facebook/react-native/issues/31112

## Changelog:

[IOS] [FIXED] - Fix TextInput vertical alignment issue when using lineHeight prop on iOS without changing Text baseline (Paper - old arch)

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

Test Plan: Extensive test included in the PR comments https://github.com/facebook/react-native/pull/37465#issuecomment-1551459879 and https://github.com/Expensify/App/issues/17767#issuecomment-1640032626

Reviewed By: cipolleschi

Differential Revision: D52325261

Pulled By: dmytrorykun

fbshipit-source-id: d072a598bfaafbbffc41005b1fda1795cf3d8ab9
2024-02-20 13:54:36 -08:00
Luna Wei 242d4a7942 Merge branch '0.73-stable' of https://github.com/facebook/react-native into 0.73-stable 2024-02-20 13:42:54 -08:00
Riccardo CipolleschiandLuna Wei 0061bea215 Fix RCTFabric podspec (#42639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42639

When I reverted part of the deprecation of `RCT_NEW_ARCH_ENABLED`, I forget a little bit which was breaking RCTFabric podspec.

This diff fixes that.

[Internal] - Bring back `RCT_NEW_ARCH_ENABLED` to Fabric to make the `RCTThirdPartyFabricComponentsProvider` work again.

Reviewed By: cortinico

Differential Revision: D53048270

fbshipit-source-id: d21e833c10b332fb70147cc65b690f88016655e6
2024-02-20 13:42:43 -08:00
Riccardo CipolleschiandGitHub 929df582c8 [RN][iOS] Fix compiler flags passed to libraries (#43088) 2024-02-20 11:09:51 -08:00
Luna Wei 3bdd54a51c hermes bump 2024-02-20 11:06:44 -08:00
Szymon RybczakandGitHub ffcd8f5249 Update CLI to 12.3.6 (#43095) 2024-02-19 12:55:06 -08:00
Luna Wei 7d06cd869a Remove getTagsFromCommit because we didnt pick https://github.com/facebook/react-native/pull/42146 2024-02-19 04:28:03 -08:00
Alex HuntandGitHub 62c4664849 [0.73-stable] Cherry-pick improvements to monorepo publish script (#42991)
* Add Flow, add positive test case for monorepo publish step (#42936)

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

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607809

fbshipit-source-id: 990826fda5538af9a13e3f24978295a2f3b0c8c3

# Conflicts:
#	scripts/monorepo/__tests__/find-and-publish-all-bumped-packages-test.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js

* Update exit cases for monorepo publish script (#42937)

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

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607810

fbshipit-source-id: 18e79f23060ee70e96bd8ac6e9995b0a8ba300b3

# Conflicts:
#	scripts/monorepo/__tests__/find-and-publish-all-bumped-packages-test.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js

* Refactor package discovery in publish script (#42938)

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

Substitutes the `forEachPackage` util with a replacement async `getPackages` function. This will be used further in the next diff.

The new function aims to be more erganomic/versatile than `forEachPackage` by returning a package mapping (see updated test mock). The API aligns roughly with `yarn workspaces list` and [Lerna's `detectProjects`](https://lerna.js.org/docs/api-reference/utilities#detectprojects).

This also aligns with / replaces similar attempts in our existing scripts:
- [`getPackagesToPublish`](https://github.com/facebook/react-native/blob/2ca7bec0c2a7d821ceaaf39840a6cdc5eceb8678/scripts/monorepo/get-and-update-packages.js#L56)
- [`getPublicPackages`](https://github.com/facebook/react-native/blob/2ca7bec0c2a7d821ceaaf39840a6cdc5eceb8678/scripts/releases/set-version/index.js#L19)

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607806

fbshipit-source-id: 00ec34edadab863dc8f2f0c7852f6e835a5dddf5

# Conflicts:
#	scripts/monorepo.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
#	scripts/monorepo/for-each-package.js

* Use npm as source of truth for updated packages (make publish script rerunnable) (#42944)

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

Updates `find-and-publish-all-bumped-packages` to use the npm registry as the source of truth, similar to tools like Lerna (`lerna publish from-package`). **This enables safe reruns of the publish script**, and replaces the previous Git-diff-detection implementation.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53607807

fbshipit-source-id: 135808b7ce36cf463c9f53a8059500b83f8b6679

# Conflicts:
#	scripts/monorepo/find-and-publish-all-bumped-packages.js

* Add retry to monorepo publish script (#42964)

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

We've seen npm publishes fail occasionally in CI as part of this script, most recently in S391653. This change adds a single retry, per package, during the execution of this script, in an attempt to reduce the chance of manual interventions after a broken pipeline.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607808

fbshipit-source-id: 526d9c33d51ec57702efba3c199bad313c1bf2d4

# Conflicts:
#	scripts/monorepo/find-and-publish-all-bumped-packages.js

* Rename and document monorepo publish script (#42989)

Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607805

fbshipit-source-id: babe9bbd7fb5e7016b567193727c6a441bee60a3

# Conflicts:
#	scripts/__tests__/publish-updated-packages-test.js
#	scripts/publish-updated-packages.js
#	scripts/releases-ci/README.md
2024-02-19 03:27:39 -08:00
Tommy NguyenandGitHub 67e2bb455f fix: fix codegen not finding all third-party libraries (#42943)
* fix: fix codegen failing in pnpm setups

* fix third-party libs not being detected
2024-02-19 02:59:51 -08:00
Luna Wei af224d7f6c Local: Update rn-tester podfile 2024-02-19 02:58:35 -08:00
Tommy NguyenandLuna Wei 27968eaf9f fix(dev-middleware): fix react-native config failing in pnpm setups (#42907)
Summary:
In a pnpm setup, `react-native config` fails to read `react-native/react-native.config.js` because `ws` was not installed:

```
% node --print 'require("react-native/react-native.config.js")'
node:internal/modules/cjs/loader:1137
  throw err;
  ^

Error: Cannot find module 'ws'
```

## Changelog:

[GENERAL] [FIXED] - fix `react-native config` failing in pnpm setups

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D53516703

Pulled By: robhogan

fbshipit-source-id: 3aded393187df4ca9a7abb64a2c8e0f2c9a5fcd9
2024-02-19 02:48:21 -08:00
Dr. Sergey PogodinandLuna Wei 3d9d5b3cf3 Patches with-environment.sh script (#42184)
Summary:
Closes https://github.com/facebook/react-native/issues/42164

## Changelog:

[IOS] [FIXED] - Fixes `with-environment.sh` script for the case when Node can't be found prior to loading `.xcode.env`

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

Test Plan: This is a trivial update, no need for much testing.

Reviewed By: cortinico

Differential Revision: D52602653

Pulled By: cipolleschi

fbshipit-source-id: 0881456bf165d895252ae38cb7c7aee945cfaf52
2024-02-19 02:47:30 -08:00
Distiller 36a4a24501 [0.73.4] Bump version numbers 2024-02-06 00:38:34 +00:00
Luna Wei de8b34ae2b bumped packages versions
#publish-packages-to-npm
2024-02-05 13:18:42 -08:00
Luna Wei 80aac8b43f bumped packages versions
#publish-packages-to-npm
2024-02-05 13:16:30 -08:00
Luna Wei 6e186742e3 bumped packages versions
#publish-packages-to-npm
2024-02-05 12:48:31 -08:00
Luna Wei 6b69b34db2 bumped packages versions
#publish-packages-to-npm
2024-02-05 10:18:20 -08:00
Tommy NguyenandGitHub 562447be47 [LOCAL][0.73] fix: cannot find module react-native-*/Libraries/Core/InitializeCore (#42877) 2024-02-05 10:08:59 -08:00
hurali97 055b35d75c bumped packages versions
#publish-packages-to-npm
2024-02-05 12:39:24 +05:00
Luna Wei 22d53edd49 Local: Update rn-tester podfile 2024-02-04 13:18:34 -08:00
Lulu WuandLuna Wei 68bc219266 Ignore the one-time NullPointerException and print error log
Summary:
Why ignore for now?
- It only happen once during initialization and doesn't cause any breakages for RNTester
- The race condition happens in Android System code which is hard to tackle:
```Exception in native call
java.lang.NullPointerException: java.lang.NullPointerException
	at com.facebook.jni.NativeRunnable.run(Native Method)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:30)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:235)
	at java.lang.Thread.run(Thread.java:1012)
```
From stack trace message.callback is checked in
```at android.os.Handler.dispatchMessage(Handler.java:99)```
but becomes null in
```at android.os.Handler.handleCallback(Handler.java:958)```

[Android source code](https://l.facebook.com/l.php?u=https%3A%2F%2Fandroid.googlesource.com%2Fplatform%2Fframeworks%2Fbase%2F%2B%2Fmaster%2Fcore%2Fjava%2Fandroid%2Fos%2FHandler.java&h=AT1aQS0Vmknao8kLbYE_hhLj1G3idUf69jFQE3ZLAqjrbcMX4OdQUV1dzZpAkAvLaZ9HAOanpsKCC8z59Ce9XJa6cOhQL2L95gM9iMrSr7FbrpTKPLKbWjDmTz89WUL2pQprnBVKyA8) of Handler.

Reviewed By: cortinico

Differential Revision: D51550240

fbshipit-source-id: 6288e196da1da88a37f5c69bfce82e3e09c6f106
2024-02-04 12:54:38 -08:00
Dmitry RykunandLuna Wei 45ba0425e7 Event name normalization (#42586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42586

Every event name must be normalized.

The normalization strategy is:
1. If it starts with `top` -> do nothing.
2. If it starts with `on` -> replace `on` with `top`.
3. Else -> capitalize the first character and prepend `top`.

We have it for the old renderer on iOS [here](https://github.com/facebook/react-native/blob/a7586947d719a9cd2344ad346d271e7ca900de87/packages/react-native/React/Base/RCTEventDispatcher.m#L12-L21). This one is also used by the interop layer.
Static ViewConfigs being a part of the new renderer [replicate](https://github.com/facebook/react-native/blob/a7586947d719a9cd2344ad346d271e7ca900de87/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L164-L172) this behavior to match the old rendered.

The Android that we have is incomplete, it is missing the [*2. If it starts with `on` -> replace `on` with `top`*]. This means that some events names that worked with the old renderer would not be compatible with the new renderer + Static ViewConfigs. Specifically every event names that start with `on`.

This diff implements event name normalization on Android.

Changelog: [Internal] - Update event normalization algorithm to match SVCs.

Reviewed By: cortinico

Differential Revision: D50604571

fbshipit-source-id: cef34d8baa2cf31f641be423a16bca7ea9fa20c4
2024-02-04 12:54:24 -08:00
Luna Wei 0d2c50568f Add print-packages as a command (#41959)
Summary:
Working on releases, I'm often looking for the name of our monorepo packages (as sometimes the name doesn't align with the directory) and also getting a list of the versions of everything, as well as if its private/public -- which I've interpreted to mean that we publish it or we don't. I thought this might be convenient to add.

[Internal] - Add `print-packages` as a command to print our monorepo packages (including react-native)

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

Test Plan:
```
❯ yarn print-packages
yarn run v1.22.19
$ node ./scripts/monorepo/print
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┤
│    0    │  ''   │     'react-native/assets-registry'     │    '0.74.0'    │
│    1    │  ''   │  'react-native/babel-plugin-codegen'   │    '0.74.0'    │
│    2    │  ''   │  'react-native/community-cli-plugin'   │    '0.74.0'    │
│    3    │  ''   │    'react-native/debugger-frontend'    │    '0.74.0'    │
│    4    │  ''   │     'react-native/dev-middleware'      │    '0.74.0'    │
│    5    │  ''   │      'react-native/eslint-config'      │    '0.74.0'    │
│    6    │  ''   │      'react-native/eslint-plugin'      │    '0.74.0'    │
│    7    │  ''   │   'react-native/eslint-plugin-specs'   │    '0.74.0'    │
│    8    │  ''   │ 'react-native/hermes-inspector-msggen' │    '0.72.0'    │
│    9    │  ''   │      'react-native/metro-config'       │    '0.74.0'    │
│   10    │  ''   │    'react-native/normalize-colors'     │    '0.74.1'    │
│   11    │  ''   │      'react-native/js-polyfills'       │    '0.74.0'    │
│   12    │  ''   │             'react-native'              │   '1000.0.0'   │
│   13    │  ''   │      'react-native/babel-preset'       │    '0.74.0'    │
│   14    │  ''   │ 'react-native/metro-babel-transformer' │    '0.74.0'    │
│   15    │  ''   │          'react-native/bots'           │    '0.0.0'     │
│   16    │  ''   │         'react-native/codegen'         │    '0.74.0'    │
│   17    │  ''   │ 'react-native/codegen-typescript-test' │    '0.0.1'     │
│   18    │  ''   │      'react-native/gradle-plugin'      │    '0.74.0'    │
│   19    │  ''   │         'react-native/tester'          │    '0.0.1'     │
│   20    │  ''   │       'react-native/tester-e2e'        │    '0.0.1'     │
│   21    │  ''   │    'react-native/typescript-config'    │    '0.74.0'    │
│   22    │  ''   │    'react-native/virtualized-lists'    │    '0.74.0'    │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┘
  Done in 0.55s.
```

Also added filter flag for private/public
```
❯ yarn print-packages --type private
yarn run v1.22.19
$ node ./scripts/monorepo/print --type private
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┤
│    0    │  ''   │ 'react-native/hermes-inspector-msggen' │    '0.72.0'    │
│    1    │  ''   │          'react-native/bots'           │    '0.0.0'     │
│    2    │  ''   │ 'react-native/codegen-typescript-test' │    '0.0.1'     │
│    3    │  ''   │         'react-native/tester'          │    '0.0.1'     │
│    4    │  ''   │       'react-native/tester-e2e'        │    '0.0.1'     │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┘
  Done in 0.16s.
```

Also added a npm query where you can see the latest published version of a minor
```
❯ yarn print-packages --type public --minor 72
yarn run v1.22.19
$ node ./scripts/monorepo/print --type public --minor 72
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┬──────────────────────────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │             Version (72)             │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┼──────────────────────────────────────┤
│    0    │  ''   │     'react-native/assets-registry'     │    '0.74.0'    │               '0.72.0'               │
│    1    │  ''   │  'react-native/babel-plugin-codegen'   │    '0.74.0'    │               '0.72.3'               │
│    2    │  ''   │  'react-native/community-cli-plugin'   │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    3    │  ''   │    'react-native/debugger-frontend'    │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    4    │  ''   │     'react-native/dev-middleware'      │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    5    │  ''   │      'react-native/eslint-config'      │    '0.74.0'    │               '0.72.2'               │
│    6    │  ''   │      'react-native/eslint-plugin'      │    '0.74.0'    │               '0.72.0'               │
│    7    │  ''   │   'react-native/eslint-plugin-specs'   │    '0.74.0'    │               '0.72.4'               │
│    8    │  ''   │      'react-native/metro-config'       │    '0.74.0'    │              '0.72.11'               │
│    9    │  ''   │    'react-native/normalize-colors'     │    '0.74.1'    │               '0.72.0'               │
│   10    │  ''   │      'react-native/js-polyfills'       │    '0.74.0'    │               '0.72.1'               │
│   11    │  ''   │             'react-native'              │   '1000.0.0'   │               '0.72.8'               │
│   12    │  ''   │      'react-native/babel-preset'       │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   13    │  ''   │ 'react-native/metro-babel-transformer' │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   14    │  ''   │         'react-native/codegen'         │    '0.74.0'    │               '0.72.8'               │
│   15    │  ''   │      'react-native/gradle-plugin'      │    '0.74.0'    │              '0.72.11'               │
│   16    │  ''   │    'react-native/typescript-config'    │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   17    │  ''   │    'react-native/virtualized-lists'    │    '0.74.0'    │               '0.72.8'               │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┴──────────────────────────────────────┘
```

Reviewed By: cortinico

Differential Revision: D52347140

Pulled By: lunaleaps

fbshipit-source-id: 75811730e1afd5aae2d9fba4e437cd0d3d424a90
2024-02-04 12:54:18 -08:00
Riccardo CipolleschiandGitHub f56bf1fa0a [RN][iOS] Fix warning when loading RCTUIManager and A11yManager (#42734) 2024-02-04 12:09:25 -08:00
Distiller 53061d7b85 [0.73.3] Bump version numbers 2024-01-29 18:03:22 +00:00
Blake Friedman c5c0563f20 bumped packages version
#publish-packages-to-npm
2024-01-29 17:29:28 +00:00
Blake Friedman 71c8ab3496 bumped packages versions 2024-01-29 17:14:06 +00:00
Blake Friedman 2daedcd599 Avoid using Cocoapods 1.15 until it fixes an issue affection RN. (#42702)
Summary:
Cocoapods 1.15 (https://github.com/facebook/react-native/issues/42698) current breaks the build, limit to version >= 1.13 & < 1.15

This is currently broken and affecting users, we'll remove this limit once Cocopods fixes the regression.  It's currently blocking 0.73.3.

[iOS][Fixed] don't allow cocoapods 1.15.

<!-- 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/42702

Test Plan:
```
bundle exec pod install
```

Reviewed By: cipolleschi

Differential Revision: D53180111

Pulled By: blakef

fbshipit-source-id: 4c5dd11db6d208e8d71249443a8f85e601913abd
2024-01-29 13:21:01 +00:00
zhongwuzwandBlake Friedman 753aee1c2c RNTester enable concurrent root when using Fabric (#41166)
Summary:
RNTester's `AppDelegate` override `prepareInitialProps` method of super class `RCTAppDelegate` https://github.com/facebook/react-native/blob/70acd3f7d9edae9e40cc4603bede9778da281a85/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm#L152, so we missed `concurrentRoot` initial prop.

![image](https://github.com/facebook/react-native/assets/5061845/12af5815-afe6-46f0-8107-54ca443b4962)

cc javache cipolleschi

[IOS] [FIXED] - RNTester enable concurrent root when using Fabric

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

Test Plan: Warning disappear.

Reviewed By: cipolleschi

Differential Revision: D50596693

Pulled By: javache

fbshipit-source-id: d73a17cd137b3088405f86b739cb0ed7b5a9839e
2024-01-26 17:24:47 +00:00
Blake Friedman 1a9994ba8f [LOCAL] similar to #42306, ignore test 2024-01-25 16:56:08 +00:00
Blake Friedman a4d66b8ed4 bumped packages versions
#publish-packages-to-npm
2024-01-25 15:50:23 +00:00
Riccardo CipolleschiandBlake Friedman 98943e3155 Disable expensive checks in OSS (#42306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42306

Internally, we have some computationally expensive checks in Debug mode when running Fabric.
However, these are not very useful in OSS and they were the cause of some issues which generated noise.
With this change, we are enabling those checks only in the Meta specific builds and making sure that the OSS won't incur in that cost.

## Changelog
[Internal] - Disable expensive Fabric checks when running Fabric in OSS

Reviewed By: cortinico, sammy-SC

Differential Revision: D52543696

fbshipit-source-id: 697f14fd21e884f293ea7cee8ee16fff73764996
2024-01-25 15:47:56 +00:00
Blake Friedman 58a59f6e76 [LOCAL] Remove ccache line from react_native_pods
Cleanup from a merge conflict which brought this in.
2024-01-25 15:44:29 +00:00
Blake Friedman f4e21b0b27 bumped packages versions
#publish-packages-to-npm
2024-01-25 15:21:19 +00:00
Blake Friedman b6e7561067 Revert "Update Hermes tag to hermes-2024-01-25-RNv0.73.3-57e3665290d5e97eaea63d27cb370ce7862a10a6"
This reverts commit 62e1c5c195.
2024-01-25 15:19:26 +00:00
Blake FriedmanandGitHub e476db23f4 Merge pull request #42382 from facebook/cipolleschi/fix_new_arch_release 2024-01-25 14:48:49 +00:00
Blake FriedmanandGitHub 23f1dd6e3d Merge pull request #42227 from facebook/cipolleschi/fix-linking-issue-xcode15_1 2024-01-25 14:48:09 +00:00
Gabriel DonadelandBlake Friedman 7d5d355143 Remove ATS config patch from react_native_post_install (#42637)
Summary:
This PR removes the `apply_ats_config` function of ReactNativePodsUtils that was used inside `react_native_post_install` because it was preventing users from configuring `NSAllowsArbitraryLoads` to true in their projects, especially when building in CI as the plist file would be reset after running pod install.

[IOS] [CHANGED] - Remove ATS config patch from react_native_post_install

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

Test Plan: Edit `Info.plist`, run `pod install` and check if changes have not been overwritten

Reviewed By: cortinico

Differential Revision: D53048299

Pulled By: cipolleschi

fbshipit-source-id: 8dc335fae2e05a62daf931a50fa3f7a314e76a2e
2024-01-25 14:39:12 +00:00
Riccardo CipolleschiandBlake Friedman 6f92fb93c2 Register RCTDeviceInfo to invalidating and cleanup observer (#42396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42396

Cmmunity reported [#42120](https://github.com/facebook/react-native/issues/42120) where React Native was crashing if RCTDeviceInfo native module was receiving a notification while the bridge is invalidating.

Upon investigation, I realized that:
1. The RCTDeviceInfo module is never invalidated
2. Observers are still observing even when the Bridge is in an invalidated state and it is not back up.

This change makes sure that we invalidate the `RCTDeviceInfo.mm` module and that we unregister the observers.

## Changelog:
[iOS][Fixed] - Make `RCTDeviceInfo` listen to invalidate events and unregister observers while invalidating the bridge

Reviewed By: RSNara

Differential Revision: D52912604

fbshipit-source-id: 1727bcdef5393b1bd5a272e2143bc65456c2a389
2024-01-25 14:27:46 +00:00
LIM AlbertandBlake Friedman 4f2be88856 Call super.onRequestPermissionsResult in ReactActivity (#42478)
Summary:
This change allows activities to handle onRequestPermissionsResult callbacks (eg: registerForActivityResult)

Fixes #42403

[Android][Changed] - Call super.onRequestPermissionsResult in ReactActivity's onRequestPermissionsResult()

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

Test Plan:
**Without super.onRequestPermissionsResult() call**

![before](https://github.com/facebook/react-native/assets/8672580/553ff597-c077-4831-a4d3-51846a253536)

**With super.onRequestPermissionsResult() call**

![after](https://github.com/facebook/react-native/assets/8672580/c7d588d2-5846-4083-a02f-59b5f915442c)

Reviewed By: cipolleschi

Differential Revision: D52952198

Pulled By: cortinico

fbshipit-source-id: 53b5dac65f6b5409d87b5fe7f8be659d7b48f70d
2024-01-25 14:27:37 +00:00
Dmitry RykunandBlake Friedman da9ab6a33b SVC Codegen: Handle TSAsExpression when looking for the codegen declaration (#40860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40860

This diff adds support for the `AS` expression in TS sources. The following codegen declaration should work now:
```
export default codegenNativeComponent<NativeProps>(
  'MyComponentView',
) as HostComponent<NativeProps>;
```
Changelog: [General][Added] - Handle TSAsExpression when looking for the codegen declaration

Reviewed By: shwanton

Differential Revision: D50225241

fbshipit-source-id: 247a3d341d742b548e82318d0fa21dff9884d2bd
2024-01-25 14:20:32 +00:00
Tommy NguyenandBlake Friedman 5d8529688c fix: declare missing dependency chalk (#42235)
Summary:
Dependency on `chalk` was introduced in https://github.com/facebook/react-native/pull/37510, but was never declared. In pnpm setups, the CLI fails to run because of this.

This needs to be picked to 0.73.

[GENERAL] [FIXED] - Declare missing dependency `chalk`

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D52660337

Pulled By: cortinico

fbshipit-source-id: 1cd45fcff72045c127773566a27103f1b38262b3
2024-01-25 14:20:14 +00:00
Paul SchreiberandBlake Friedman 95c590a2cc Properly handle Xcode targets with spaces in their names (#42220)
Summary:
Properly handle targets with spaces in their names

Use quotes around the argument to basename path. Ensures this succeeds when the Xcode target name has spaces.

example:
```sh
#!/bin/sh
SOURCEMAP_FILE="ArchiveIntermediates/Jane Doe/IntermediateBuildFilesPath/Jane Doe.build/Release-iphoneos/JaneDoe.build/DerivedSources/main.jsbundle.map"
BN_SOURCEMAP_FILE="$(basename $SOURCEMAP_FILE)"
echo $BN_SOURCEMAP_FILE
```

output:
```
Jane Jane main.jsbundle.map
```

```sh
#!/bin/sh
SOURCEMAP_FILE="ArchiveIntermediates/Jane Doe/IntermediateBuildFilesPath/Jane Doe.build/Release-iphoneos/JaneDoe.build/DerivedSources/main.jsbundle.map"
BN_SOURCEMAP_FILE="$(basename "$SOURCEMAP_FILE")"
echo $BN_SOURCEMAP_FILE
```

output:
```
main.jsbundle.map
```

## Changelog:
[iOS] [Fixed] - Fix support for SOURCEMAP_FILE path containing spaces

## Related
https://github.com/facebook/react-native/pull/40937

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

Reviewed By: christophpurrer

Differential Revision: D52650491

Pulled By: arushikesarwani94

fbshipit-source-id: e42b8a0d018b37fb558abd53d765fbdd676c51a2
2024-01-25 14:19:27 +00:00
William FernandesandBlake Friedman 401aa817fc Fix release build error due to a casing issue in hermes tarball path after download prebuilt tarball (#42160)
Summary:
In my mac, I use a case-sensitive volume and when I build a react-native 0.73 project it failed with an error that can't find the hermes release tarball to extract:
```
Node found at: /usr/local/bin/node
Preparing the final location
Extracting the tarball
tar: Error opening archive: Failed to open '/Volumes/Workspace/meet-art-link/ios/Pods/hermes-engine-artifacts/hermes-ios-0.73.1-Release.tar.gz'
```
Note the `...-Release.tar.gz` in the error. In the disk it's `...-release.tar.gz`.

The build fails in after download the release tarball in release mode because the hermes tarball name in the `replace_hermes_version.js` build script is capitalized, while the file is lowercase on disk.

The fix is to ensure the hermes tarball name's "build type" is lowercase just like the function that creates the tarballs in react-native release located in `hermes_utils.js` in `getHermesPrebuiltArtifactsTarballName()`.

Perhaps it's better to retrieve the tarball name from the same method it's generated? E.g.:
```js
const { getHermesPrebuiltArtifactsTarballName } = require('react-native/scripts/hermes/hermes-utils');

const tarballName = getHermesPrebuiltArtifactsTarballName(`${version}-${configuration}`);
const tarballURLPath = `${podsRoot}/hermes-engine-artifacts/${tarballName}`;
```
If yes, let me know to update the PR.

## Changelog:

<!-- 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
-->
[iOS][Fixed] - Fix release build error due to a casing issue in hermes tarball path after download prebuilt tarball

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

Test Plan: Use a case sensitive volume or system and build react-native 0.73 in release mode, it will fail. Apply the patch in this PR and it will work fine.

Reviewed By: cortinico

Differential Revision: D52603439

Pulled By: cipolleschi

fbshipit-source-id: 41ed8d8202874f338e4aa3af88d9d28ec1b8b3d5
2024-01-25 14:19:21 +00:00
Samuel SuslaandBlake Friedman d607040200 Fix TouchableBounce, TouchableHighlight and TouchableNativeFeedback in React 18 (#42133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42133

## Changelog:
[General][Fixed] - TouchableBounce, TouchableHighlight and TouchableNativeFeedback dropping touches with React 18.

TouchableBounce, TouchableHighlight and TouchableNativeFeedback do not trigger onPress when used with React 18. This is because it resets its pressability configuration in `componentWillUnmount`. This is fine, we want to stop deliver events and restart all timers when component is unmounted.
```
componentWillUnmount(): void {
    this.state.pressability.reset();
  }
```

But TouchableBounce, TouchableHighlight and TouchableNativeFeedback were not restarting the pressability configuration when component was mounted again. It was restarting the configuration in `componentDidUpdate`, which is not called when component is unmounted and mounted again.

Reviewed By: fkgozali

Differential Revision: D52514643

fbshipit-source-id: 0d6ae4bb7c2a797cc443181459c5614da0ecfc7a
2024-01-25 14:19:12 +00:00
Samuel SuslaandBlake Friedman 220d8a51cc fix TouchableWithoutFeedback and TouchableOpacity dropping onPress in React 18 (#42121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42121

## Changelog:
[General][Fixed] - TouchableWithoutFeedback and TouchableOpacity dropping touches with React 18.

TouchableWithoutFeedback and TouchableOpacity do not trigger onPress when used with React 18. This is because it resets its pressability configuration in `componentWillUnmount`. This is fine, we want to stop deliver events and restart all timers when component is unmounted.
```
componentWillUnmount(): void {
    this.state.pressability.reset();
  }
```

But TouchableWithoutFeedback and TouchableOpacity were not restarting the pressability configuration when component was mounted again. It was restarting the configuration in `componentDidUpdate`, which is not called when component is unmounted and mounted again.

Reviewed By: fkgozali

Differential Revision: D52388699

fbshipit-source-id: ef13194c6581c5d31d0f1cb465bfd0cf98d672ea
2024-01-25 14:19:03 +00:00
Blake Friedman 62e1c5c195 Update Hermes tag to hermes-2024-01-25-RNv0.73.3-57e3665290d5e97eaea63d27cb370ce7862a10a6 2024-01-25 13:37:19 +00:00
Riccardo Cipolleschi f39f34ed82 [RN][iOS] Fix race condition between A11yManager and UIManager 2024-01-19 15:51:27 +00:00
szymonrybczakandAlex Hunt bcb229e8f8 Bump CLI to 12.3.2 2024-01-19 13:43:08 +00:00
Riccardo Cipolleschi a2771ce58a [RN][iOS] Fix flags 2024-01-10 13:12:37 +00:00
Distiller d2ac5d6a55 [0.73.2] Bump version numbers 2024-01-08 14:55:48 +00:00
Alex Hunt 7895cdb0eb Bump package versions
#publish-packages-to-npm
2024-01-08 11:08:47 +00:00
Riccardo CipolleschiandGitHub 7e721f09ad [LOCAL][RN][Geneal] Fix boost download url (#42176) 2024-01-08 12:04:38 +01:00
Alex HuntandAlex Hunt 89cf504095 Bump Metro to ^0.80.3 (#42139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42139

Bump to the latest Metro release.

Metro release notes: https://github.com/facebook/metro/releases/tag/v0.80.3

Changelog:
[General][Changed] - Bump Metro to ^v0.80.3

Reviewed By: GijsWeterings

Differential Revision: D52520542

fbshipit-source-id: 3c089e3f033a4d0597e9adb50d3377f1ad822743

# Conflicts:
#	packages/metro-config/package.json
2024-01-05 13:13:10 +00:00
Nick GerlemanandAlex Hunt 00d8389890 Fix horizontal scrollview scrollTo coordinate space in RTL on oldarch (#42094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42094

Fabric fixed this a while back with https://github.com/facebook/react-native/commit/9ca460f06405db85d0df60cbe53c304c9127c3bf

Looks like this is still broken on Paper, and now VirtualizedList relies on it. https://github.com/facebook/react-native/pull/38737#discussion_r1437874601

Changelog:
[ios][fixed] - Fix horizontal scrollview scrollTo coordinate space in RTL on oldarch

Reviewed By: lenaic

Differential Revision: D52451602

fbshipit-source-id: f41d8248c7f6ab23965800b09ca1082fd1a15151
2024-01-03 14:38:03 +00:00
David VaccaandAlex Hunt ddf0079ec5 Fix rendering of RN Tester New Architecture examples in Android
Summary:
When bridgeless is enabled, RN Tester New Architecture examples crashed with a StackOverflow Exception
The root cause of this issue is that MyLegacyViewManager is sending an event to JS during the execution of MyLegacyViewManager.createViewInstance() method.

This is a problem because the delivery of events depend on the "id" of the view, but the "id" of the view is set after MyLegacyViewManager.createViewInstance() finishes executing.

The documentations "implicitly" mentions to not set props during the execution of the ViewManager.createViewInstance() method:

https://reactnative.dev/docs/native-components-android#2-implement-method-createviewinstance

To fix this issue I'm removing the execution of the method that triggers the event.

bypass-github-export-checks

changelog: [Android][Fix] Fix rendering of 'RN Tester New Architecture examples' when bridgeless is enabled

Reviewed By: fkgozali

Differential Revision: D51047007

fbshipit-source-id: 17be493f79114fa402029063e79fabc1d90efc17
2024-01-02 17:56:10 +00:00
Oscar FrancoandAlex Hunt 5b382a8fa7 Unhandled promise rejection - attach non-standard Error object stack info if possible (#42079)
Summary:
This is a continuation of my [last PR](https://github.com/facebook/react-native/pull/40914) which improved the symbolication of unhandled promise rejections.

While I was developing another library I noticed I still got an error stack of the log adding and not of the error itself. The library I'm trying to debug does not throw a standard error object but rather a custom one, but it still contains the stack field. By passing this stack field to the logbox call I was able to get a better symbolicated stack trace. The exact line of the failure is not displayed but at least the correct file is.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Unhandled promise rejection - attach non-standard Error object stack info if possible

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

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

Test Plan:
Test any unhandled promise rejection with a non-standard error (line 23, toString must not return `[object Error]`) and see if the correct (or at least a better) stack trace is shown.

Here is the one I got before and after this change:

<img src="https://github.com/facebook/react-native/assets/1634213/3d07faad-9535-42c9-8032-b4d8fe407e88" width="200" />

<img src="https://github.com/facebook/react-native/assets/1634213/2c39bd82-c7a1-4f58-8ac4-5c479bb96b6e" width="200" />

Reviewed By: huntie

Differential Revision: D52431711

Pulled By: cipolleschi

fbshipit-source-id: be2172d3b1e2fc3f72812faac372c83bc6dface2
2024-01-02 10:26:30 +00:00
Gabriel DonadelandAlex Hunt 2c8aa68600 Update ios pod post_install logic for detecting if hermes is enabled (#41286)
Summary:
Follow up of https://github.com/facebook/react-native/pull/41284#issuecomment-1789516046

We should not rely on  checking if the `React-hermes` pod is present to determine if hermes is enabled

## Changelog:

[IOS] [CHANGED] - Update ios pod post_install logic for detecting if hermes is enabled

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

Test Plan: Run `use_react_native!(hermes => false)` should not add `USE_HERMES = true;` to `project.pbxproj`

Reviewed By: blakef

Differential Revision: D50899654

Pulled By: cipolleschi

fbshipit-source-id: a5ab5b0117c61014e77b780c50bf349da92c6342
2024-01-02 10:25:39 +00:00
Alex Hunt cadcf541fa Revert "Remove support for Android API < 23 in ReactEditText (#39671)"
This reverts commit 1904e8036a.
2024-01-02 10:22:44 +00:00
LunaandGitHub 21fc812725 Update these to use latest 0.73.x versions (#42082) 2023-12-28 10:24:01 -08:00
LunaandGitHub 27eaa2f055 Fix monorepo package versions to version published with release (#41958) 2023-12-28 10:17:58 -08:00
Riccardo CipolleschiandAlex Hunt 5061d45782 [RN][CI] Fix e2e test setup 2023-12-28 10:06:07 +00:00
Luna Wei 869ce3b2d3 [Local] Update podfile lockfile 2023-12-27 22:26:53 -08:00
MorritzandAlex Hunt 2f92a87e43 Enhance IP address retrieval for iOS devices in Metro bundler setup (#41839)
Summary:
After introducing this commit https://github.com/facebook/react-native/commit/a56e5dad7c31b6e9e6b02333219bc33811215056 script may fail in some circumstances.

Example:
When there is IP address available only for en1 and not en0, first "ipconfig" command in the loop fails with error code 1 and cancels whole script.

## Changelog:
[iOS] [Fixed] - [enhance IP address retrieval for iOS devices in Metro bundler setup](https://github.com/facebook/react-native/pull/41839/commits/6a351db158dadf944933173aa0150435c742001f)

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

Reviewed By: christophpurrer

Differential Revision: D51979040

Pulled By: dmytrorykun

fbshipit-source-id: 0f6f42a7dd70bac012875ffae5d651b74b225c94
2023-12-27 17:25:58 +00:00
Janic DuplessisandAlex Hunt bc05f48ad1 Fix comment about adding packages in android template (#41856)
Summary:
I noticed this comment is still in Java in the Kotlin template. It also doesn't really work anymore since there is no packages variable.

To fix it I completed the comment with all code needed for it to work in kotlin. I think an older version of the template used to be more like:

```kotlin
val packages = PackageList(this).packages
// packages.add(MyReactNativePackage())
return packages
```

But then it requires adding a lint suppress annotation since packages variable can be simplified. I think this is simpler even if it makes the comment a few more lines.

## Changelog:

[GENERAL] [FIXED] - Fix comment about adding packages in android template

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

Test Plan: Tested that uncommenting that code works

Reviewed By: cipolleschi

Differential Revision: D51987483

Pulled By: cortinico

fbshipit-source-id: d0135b5b536960017ccc7b25f92c75b3bd863cd9
2023-12-27 17:25:54 +00:00
Ivan AlexandrovandAlex Hunt 99b5b9d9a7 Fix android platform border color (#39893)
Summary:
If you try to apply PlatformColor to borders on Android app will crash with the next error:

"Error while updating property 'borderColor' of a view managed by: RCTView"

## Changelog:

[ANDROID] [FIXED] - Fix android crash when apply PlatformColor to borders

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

Test Plan:
In RNTester example, go to APIs -> PlatformColor
|    Before  | After |
| ----------- | ----------- |
|  <img src="https://github.com/facebook/react-native/assets/70860930/66ac2880-53da-4438-bd9a-332f8ea40645" alt="drawing" width="200"/>    | <img src="https://github.com/facebook/react-native/assets/70860930/151f58a1-d857-4b3d-9ec6-de74eb065127" alt="drawing" width="200"/>      |

Reviewed By: NickGerleman

Differential Revision: D50011758

Pulled By: javache

fbshipit-source-id: ea06c18c6aef4b6731e9b9b87422a1e0d13de208
2023-12-27 17:25:29 +00:00
Riccardo CipolleschiandLuna Wei ddf3505252 Install bundler versions depending on Ruby version (#41962)
Summary:
Since yesterday evening (why it is always friday evening???) CircleCI or Gem decided to update the default bundler version that is installed with `gem bundle install`.
Therefore, CI for iOS stopped working.

This change installs bundler's versions so that they are compatible with the Ruby version.

## Changelog:

[Internal] - Fix CI for iOS installing versions of bundler that are compatible with Ruby

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

Test Plan: CircleCI is green

Reviewed By: GijsWeterings

Differential Revision: D52230544

Pulled By: cipolleschi

fbshipit-source-id: 2f96e16ecb94159953056e8de757ea4d249f80f0
2023-12-21 16:27:18 -08:00
LunaandGitHub 8edc36e33c [Local] Clean up invalid translations (#42040) 2023-12-21 16:26:21 -08:00
Moti ZilbermanandAlex Hunt aec4669086 Use a stable device+app ID to register with the inspector proxy (#41152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41152

Building on byCedric's approach in https://github.com/facebook/metro/pull/991, and on D49954920, this diff passes stable, unique *logical device IDs* to the debugger connection infrastructure from Android and iOS.

See D49954920 for the precise stability and uniqueness requirements that these IDs meet.

Changelog:

[Changed][General] - Automatically reconnect to an existing debugger session on relaunching the app

Reviewed By: huntie

Differential Revision: D49954919

fbshipit-source-id: d4d918f0cbfd9df426e888845817e00410efb9d3
2023-12-19 14:30:55 +00:00
Distiller f6b7243d2a [0.73.1] Bump version numbers 2023-12-18 09:45:38 +00:00
Luna Wei e15c784d1a Remove patch range dependency on @react-native/community-cli-plugin for react-native 2023-12-15 13:05:46 -08:00
Alex Hunt 8c7fc732b7 Bump package versions
#publish-packages-to-npm
2023-12-14 13:46:03 +00:00
szymonrybczakandAlex Hunt dff11ab993 chore: bump CLI to 12.3.0 2023-12-13 16:38:17 +00:00
Rui YingandThibault Malbranche a7fc0c64f2 Fix NSAppTransportSecurity being overwritten during pod install (#41875)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/41874.

## Changelog:

<!-- 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
-->

[iOS] [Fixed] - Fix NSAppTransportSecurity being overwritten during pod install

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

Test Plan:
1. Delete the whole `NSAppTransportSecurity` in Info.plist and run `pod install`: `NSAllowsArbitraryLoads` and `NSAllowsLocalNetworking` are added as expected.
2. Modify `NSAppTransportSecurity` to only contain `NSExceptionDomains` and run `pod install`: `NSAllowsArbitraryLoads` and `NSAllowsLocalNetworking` are added, and `NSExceptionDomains` is still there.
3. Run `pod install` again: nothing changes.

Reviewed By: christophpurrer

Differential Revision: D52032400

Pulled By: dmytrorykun

fbshipit-source-id: 48cf29809c283af80613ffbf1ac0dc663a0a2fb5
2023-12-13 11:48:33 +01:00
Janic DuplessisandAlex Hunt 6230f9e9d4 Fix last spacer constrain logic in VirtualizedList (#41846)
Summary:
The logic to constrain the last spacer size is incorrect in some cases where the spacer is the last spacer, but not the last section in the list.

For more context, the role of spacer constraining is explained in this comment:

```
// Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to
// prevent the user for hyperscrolling into un-measured area because otherwise content will
// likely jump around as it renders in above the viewport.
 ```

For example it is incorrect in the case where we have:

ITEMS
SPACER
ITEMS

In this case the spacer is not actually the tail spacer so the constraining is incorrectly appied.

This causes issues mainly when using `maintainVisibleContentPosition` since it will cause it to scroll to an incorrect position and then cause the view that was supposed to stay visible to be virtualized away.

## Changelog:

[GENERAL] [FIXED] - Fix last spacer constrain logic in VirtualizedList

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

Test Plan:
Tested using https://gist.github.com/janicduplessis/b67d1fafc08ef848378263208ab93d4c in RN tester, before the change content will jump on first click on add items.

Tested using the same example and setting initial posts to 1000, then we can see our content view size is still constrained properly (see scrolling indicator as reference).

Reviewed By: yungsters

Differential Revision: D51964500

Pulled By: NickGerleman

fbshipit-source-id: 4465aa5a36c95466aef6571314973c1e2c9a0f2c
2023-12-12 18:26:43 +00:00
szymonrybczakandAlex Hunt 39e8e494ca Bump CLI to 12.2.1 2023-12-11 11:37:53 +00:00
Alex Hunt 5a44de4590 Update Podfile.lock 2023-12-11 11:37:33 +00:00
Alex HuntandAlex Hunt 3826a664e2 Sync debugger-frontend (12a45e0) (#41840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41840

Sync `react-native/debugger-frontend`. Includes:

- https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/2

Changelog: [Internal]

Differential Revision: D51946121

fbshipit-source-id: 8118cb5075aa86d95bbd8e1ba56a73360122aaab

# Conflicts:
#	packages/debugger-frontend/BUILD_INFO
2023-12-08 14:04:33 +00:00
Cedric van PuttenandAlex Hunt 33a6fb8c8b feature(dev-middleware): add enableNetworkInspector experiment (#41787)
Summary:
This enables the network panel/inspector by passing the `unstable_enableNetworkPanel=true` to the React Native JS Inspector. (See https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/2)

By setting this inside the `experiments`, we can enable/disable network related CDP handlers within the proxy.

## Changelog:

[GENERAL] [ADDED] - Add `enableNetworkInspector` experiment to enable Network panel and CDP handlers in inspector proxy

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

Test Plan: TBD, will provide a repository using an Expo canary / RN 0.73.0-rc release.

Reviewed By: NickGerleman

Differential Revision: D51811892

Pulled By: huntie

fbshipit-source-id: 541d96b6f0735104a4050a24a152e1158871ed1d
2023-12-07 16:45:09 +00:00
Krzysztof PiaskowyandAlex Hunt 92254f9380 Fix Binding JNI type (#41657)
Summary:
New implementation:
This PR adds cast from interface Binding to BindingImpl class.

Previous implementation:
The changes made in this PR make the `mBinding` field of `FabricUIManager` visible for JNI.

Without these changes, calling the method `JFabricUIManager::getBinding()` would result in an error.

<img width="400" alt="Screenshot 2023-11-27 at 13 55 44" src="https://github.com/facebook/react-native/assets/36106620/04418291-8ce8-4bae-b16c-29a5c9f2ee52">

In the `react-native-reanimated` library, we utilize `JFabricUIManager::getBinding()`, and we have noticed this issue since version 0.73. This isn't perfect solution, but I'm not certain which change in RN or FBJNI is the source of the problem. If there are any alternative solutions worth considering, I am open to discussing them.

Usage of `getBinding()` in Reanimated:
https://github.com/software-mansion/react-native-reanimated/blob/main/android/src/main/cpp/NativeProxy.cpp#L57

## Changelog:

[ANDROID] [FIXED] - Fix type for unrecognisable field mBinding

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

Test Plan:
Just call `JFabricUIManager::getBinding` method (https://github.com/facebook/react-native/blob/v0.73.0-rc.5/packages/react-native/ReactAndroid/src/main/jni/react/fabric/JFabricUIManager.cpp#L14)

or run app with repro:
https://github.com/piaskowyk/missing-mBinding-repro
after the app lunch you will receive error from above screenshot.

Co-author: tomekzaw

Reviewed By: NickGerleman

Differential Revision: D51661873

Pulled By: javache

fbshipit-source-id: 1891c36bf25c503ebc9b0501211df03be6f74115
2023-12-07 16:45:09 +00:00
Michał PierzchałaandAlex Hunt 63c0acf57b Update CLI to 12.2 2023-12-07 16:44:36 +00:00
Distiller 1eb4bf0d3a [0.73.0] Bump version numbers 2023-12-06 16:12:08 +00:00
Distiller 6a4b434c8f [0.73.0-rc.8] Bump version numbers 2023-12-04 18:04:48 +00:00
generatedunixname89002005232357andAlex Hunt 0b3a8118d8 Revert D49509633: Multisect successfully blamed "D49509633: [react-native][PR] fix: Text cut off issues when adjusting text size and font weight in system settings" for test or build failures
Summary:
This diff is reverting D49509633
D49509633: [react-native][PR] fix: Text cut off issues when adjusting text size and font weight in system settings by ryancat has been identified to be causing the following test or build failures:

Tests affected:
- [xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeTTRCTester/__tests__/ReactNativeTTRCTester-errorReportedManually-android-e2e.js](https://www.internalfb.com/intern/test/281475019301157/)

Here's the Multisect link:
https://www.internalfb.com/multisect/3131615
Here are the tasks that are relevant to this breakage:

We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

If you believe this diff has been generated in error you may Commandeer and Abandon it.

Reviewed By: NickGerleman

Differential Revision: D49645585

fbshipit-source-id: 414531e067cffa109d0663d6af185dcaf8fb9c4e
2023-12-04 13:47:30 +00:00
Alex Hunt d2517afcfc Update Podfile.lock 2023-12-04 13:47:30 +00:00
Distiller bb989e982c [0.73.0-rc.7] Bump version numbers 2023-12-04 10:58:21 +00:00
Alex Hunt d97e8e6566 Update Podfile.lock 2023-12-01 17:16:00 +00:00
Will SchurmanandAlex Hunt cd43de6ca9 Fix android root view group removal during instance re-creation (#41678)
Summary:
This is my proposed solution to https://github.com/facebook/react-native/issues/41677.

Fixes https://github.com/facebook/react-native/issues/41677.

## Changelog:

[ANDROID] [FIXED] - Fix android root view group removal during instance re-creation

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

Test Plan:
Both with fabric enabled and disabled (new architecture):

1. Clone repro repo: https://github.com/wschurman/rn-reload-repro
2. Build and run on android (I use android studio)
3. Click reload button, see timestamp doesn't change (indicating that the view is not removed)
4. Apply this PR as a patch.
5. Re-build and run.
6. Click reload button, see view is correctly disposed of and the new view is set.

Reviewed By: cortinico

Differential Revision: D51658524

Pulled By: javache

fbshipit-source-id: d9a026cde677ad1ec113230bc31bd9297bca8bfc
2023-12-01 10:39:29 +00:00
Distiller 0d5e67841f [0.73.0-rc.6] Bump version numbers 2023-11-28 11:54:44 +00:00
Alex Hunt 61867e24de Bump package versions
#publish-packages-to-npm
2023-11-27 11:08:52 +00:00
Tommy NguyenandAlex Hunt dcdea80d9e Fix build_codegen! not finding @react-native/codegen in pnpm setups (#41399)
Summary:
`build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead.

However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository.

## Changelog:

[GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups

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

Test Plan: We have a patched version of `react-native` working in a pnpm setup here: https://github.com/microsoft/rnx-kit/pull/2811

Reviewed By: dmytrorykun

Differential Revision: D51201643

Pulled By: cipolleschi

fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
2023-11-27 11:07:30 +00:00
Tommy NguyenandAlex Hunt c32064c510 Correctly declare runtime dependencies
In pnpm setups, codegen will fail during build because it cannot find
its dependencies. Some of the dependencies it relies on at runtime are
currently declared under `devDependencies`. This change moves them to
`dependencies`.
2023-11-27 11:07:08 +00:00
Alex Hunt e03137ecbd Bump package versions
#publish-packages-to-npm
2023-11-27 11:03:40 +00:00
Nicola CortiandAlex Hunt f3f75e86d8 Fix projects being broken on dependencies starting with a.. (#41621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41621

Currently, if you have a dependency that is alphabetically smaller than `app`, it's evaluation will happen before `app`.
This means that the namespace auto-discovery and the JVM toolchain configuration won't be working and the project will fail to buid.

This fixes it by introducing a root-project Gradle Plugin that takes care of enforcing the evaluation order on the `app` project.

Fixes #41620

Changelog:
[Android] [Fixed] - Fix projects being broken on dependencies starting with `a..`

Reviewed By: huntie

Differential Revision: D51547294

fbshipit-source-id: 65df7149548b7087dd8928e556fb803b3baf7b79
2023-11-27 10:44:10 +00:00
Riccardo CipolleschiandAlex Hunt 830c2e7c57 [RN][iOS] Fix React-ImageManager dependencies 2023-11-27 10:43:12 +00:00
Riccardo CipolleschiandAlex Hunt 9dfb0ffa1b Revert "RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag (#41573)"
This reverts commit 02a411e997.
2023-11-24 18:49:06 +00:00
Riccardo Cipolleschi 3bb7a70c0d [LOCAL] Update Podfile.lock 2023-11-24 17:52:41 +00:00
Nick GerlemanandAlex Hunt 154a81ad16 FP Tolerance in iOS Paper SafeAreaView debouncing (#41614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41614

Fixes https://github.com/facebook/react-native/issues/41545

SafeAreaView works by adding padding in order to shift content out of the safe area. This may change the layout dimensions of the SafeAreaView, in turn effecting its safe area insets.

This can cause layout results to change, which in turn changes the inset value. Because of this, there is a tolerance, where safe area inset changes do not trigger a new update.

Yoga is instructed to round layout dimensions to the closest physical pixel, so a very small difference in layout may result being off by about a pixel. Right now the tolerance is exactly one physical pixel, and if there is FP error here, we may not pass the test, and start oscillating with different layout values.

After changing affected ShadowNode order to always be root-first, the first call to set the frame of the `SafeAreaView` happens when a non-zero-sized RootView is present, which I think may lead to a safe area inset update communicated that wasn't before? Or other cosmic butterflies. Layout rounds to one physical pixel in difference, and our tolerance is `0.00001` dips off (not helped that 1/3 screen scale cannot be represented as decimal, even without FP error).

This adds a small tolerance beyond just the pixel boundary, matching the logic in Fabric, which seems to resolve the issue.

Changelog:
[iOS][Fixed] - FP Tolerance in iOS Paper SafeAreaView debouncing

Reviewed By: philIip

Differential Revision: D51539091

fbshipit-source-id: 88bddc38c7cd8d93feef5f12da64b124af22f46d
2023-11-24 17:12:48 +00:00
Alex HuntandAlex Hunt a66cda9284 Remove "Open Debugger" action under JSC (#41535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41535

## Context

**Remote JS Debugging removal**

In React Native 0.73, we have deprecated Remote JS Debugging (execution of JavaScript in a separate V8 process) and also removed the Dev Menu launcher (https://github.com/facebook/react-native/pull/36754).

## This diff

Follows D46187942 — this option wasn't correctly removed for Android when running JSC. This is now consistent with iOS.

Changelog:
[Android][Changed] "Open Debugger" is no longer available for remote JS debugging from the Dev Menu (non-Hermes). Please use `NativeDevSettings.setIsDebuggingRemotely()`.

Reviewed By: blakef

Differential Revision: D50555095

fbshipit-source-id: 1aeb48ab1390dc12ce300d6f321c30de5343cf0a
2023-11-21 12:00:08 +00:00
Christoph PurrerandAlex Hunt 02a411e997 RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag (#41573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41573

Changelog: [iOS][Fixed] RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag

On iOS we check for ENV flags if Hermes should be used:
- https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React-Core.podspec#L24
- https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React/React-RCTFabric.podspec#L90

and add necessary C++ packages based on that flag.

In code we do check for those imports
https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h#L16-L27

and decided if we should use Hermes or not.

However the .mm check is faulty and does not check for the `RCT_USE_HERMES` flag set in code.

Reviewed By: fkgozali

Differential Revision: D51483740

fbshipit-source-id: 428c27aae80fe6f9799cf6ae21a5d3801fe6ca11
2023-11-21 11:59:23 +00:00
szymonrybczakandAlex Hunt 3da0959291 Update CLI to v12.1.1 2023-11-21 11:15:35 +00:00
Distiller 4cd4b398dd [0.73.0-rc.5] Bump version numbers 2023-11-20 18:10:13 +00:00
Thibault Malbranche 2896a57353 bumped packages versions
#publish-packages-to-npm
2023-11-20 17:24:36 +01:00
Luna Wei 5a3bcea25d Update podfile.lock 2023-11-16 23:48:02 -08:00
Luna Wei 3efabb6fa5 bumped packages versions
#publish-packages-to-npm
2023-11-16 23:15:30 -08:00
Luna Wei 690b317106 Update Hermes tag to hermes-2023-11-17-RNv0.73.0-21043a3fc062be445e56a2c10ecd8be028dd9cc5 2023-11-16 23:13:11 -08:00
Jesse Watts-RussellandLuna Wei 3f907b10d4 Android Events - setting default to true to use C++ event pipeline (#41036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41036

Changelog:
[Added] - Shipping the new event dispatching pipeline that immediately moves events over to the C++ queue. This should unblock useDeferredValue + useTransition interruptibility on Android.

Reviewed By: javache

Differential Revision: D50365981

fbshipit-source-id: ecf60e5bc29fb4568463568a6ede4330e0294fd3
2023-11-16 22:46:22 -08:00
David VaccaandLuna Wei 40fe1cbd8c Remove support for Android API < 23 in ReactEditText (#39671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39671

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactEditText

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactEditText

Reviewed By: NickGerleman

Differential Revision: D48545507

fbshipit-source-id: 98be52ba36248962864e99e80ff648bbb351ff61
2023-11-16 22:45:26 -08:00
Dmitry RykunandLuna Wei b23d71ca46 Do not include two copies of JSI when using hermes-engine (#41499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41499

After D48152876 we consume JSI from `ReactCommon/jsi`, and ignore JSI that is distributed with `hermes-engine`.
This diff removes `include/jsi` from `source_files` of `hermes-engine` so we don't get two sets of JSI headers - one from `ReactCommon`, and the other one from `hermes-engine`.
This diff also fixes accidental breakage of ODR violation. We will no longer compile JSI into `react-native` when linking against `hermes-engine`, which already has JSI in it.
Changelog: [iOS][Fixed] - Exclude JSI headers when using hermes-engine prebuilt.

Reviewed By: cipolleschi

Differential Revision: D51347562

fbshipit-source-id: 6e4b9940c43d74d227a05999926b8752d7685670
2023-11-16 22:40:48 -08:00
Gabriel DonadelandLuna Wei edb4746085 Expose unstable_InspectorProxy and unstable_Device from dev-middleware (#41370)
Summary:
Recently, both `metro-inspector-proxy`(https://github.com/facebook/react-native/pull/39045) and `react-native-community/cli-plugin-metro`(https://github.com/facebook/react-native/pull/38795) were moved to this repo and in the process of moving these packages, the `exports` field inside package.json was added, only exporting the `index.js` file.

The problem is that Expo CLI (and possibly other community packages) rely on functions and classes that are not exported in the `index.js` file, e.g. Importing the InspectorProxy class from `react-native/dev-middleware/dist/inspector-proxy/InspectorProxy`. Normally this wouldn't be a problem and we would just import from `dist/` but due to the `exports` field, attempting to import from any other file not specified on this field will result in a `ERR_PACKAGE_PATH_NOT_EXPORTED` error.

As a short-term fix, we should create `unstable_`-prefixed exports of individual features Expo currently depends on.

## Changelog:

[INTERNAL] [CHANGED] - Expose unstable_InspectorProxy and unstable_Device from `react-native/dev-middleware`

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

Test Plan: N / A

Reviewed By: robhogan

Differential Revision: D51163134

Pulled By: blakef

fbshipit-source-id: e67adaedc4fc64131e4c9dd8383c9877b8202283
2023-11-16 22:38:45 -08:00
Kacper KafaraandLuna Wei 735781cc9f Purge children from view registry when UIManager is invalidated (#38617)
Summary:
Talking about Paper & iOS here.

In standard RN applications when a native component is removed permanently from view hierarchy [it is invalidated (if it implements `RCTInvalidating`)](https://github.com/facebook/react-native/blob/e64756ae5bb5c0607a4d97a134620fafcb132b3b/packages/react-native/React/Modules/RCTUIManager.m#L483-L495). Components that implement `RCTInvalidating` such as [`RNSScreenView`](https://github.com/software-mansion/react-native-screens/blob/9fb3bd00850bcdf29b46daa57e56eabda3ae30ea/ios/RNSScreen.mm#L35) of [`react-native-screens`](https://github.com/software-mansion/react-native-screens) library rely on `RCTInvalidating#invalidate` method being called in adequate moment to release retained resources (in my case the `RNSScreenView` holds a strong reference to it's view controller preventing it from being garbage collected).

However in case of brownfield applications (React Native is used only for a particular view & loaded on demand, see: https://github.com/software-mansion/react-native-screens/issues/1754 for discussion & app example) when view controller holding `RCTRootView` is dismissed and whole `React Native` managed view / controller tree gets deallocated, `RCTInvalidating#invalidate` method is not called on the dismissed components, thus in my particular use case, leading to memory leak.

Right now I've added call to `RCTUIManager#_purgeChildren:fromRegistry:` (which internally invalidates all components which implement `RCTInvalidating`) in `RCTUIManager#invalidate`.

## Changelog:

<!-- 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
-->

[IOS][FIXED] - Purge children from view registry on `RCTUIManager` invalidation.

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

Test Plan:
You can run the [demo](https://github.com/mkondakov/RNSScreensMemoryLeak) provided in the [issue](https://github.com/software-mansion/react-native-screens/issues/1754).

Following screenshots show that memory leak in brownfield application is resolved.

Without the change (`invalidate` method is not being called on native components)

![image](https://github.com/facebook/react-native/assets/50801299/dac331c2-1e7c-4e66-a8c1-b88f7a007d9b)

With the change:

![image](https://github.com/facebook/react-native/assets/50801299/7a8afbe9-446c-47a2-a972-d7589b921677)

Reviewed By: NickGerleman

Differential Revision: D49952215

Pulled By: javache

fbshipit-source-id: 6336b86774615acc40279c97e6ae0bb777bda8ad
2023-11-16 22:37:37 -08:00
Riccardo CipolleschiandGitHub 5d33f03b28 [RN][iOS] Improve Podspec dependencies and prepare support for multiple Apple platforms (#41380)
resolved: https://github.com/facebook/react-native/pull/41353
resolved: https://github.com/facebook/react-native/pull/41354
resolved: https://github.com/facebook/react-native/pull/41355
resolved: https://github.com/facebook/react-native/pull/41356
resolved: https://github.com/facebook/react-native/pull/41357
resolved: https://github.com/facebook/react-native/pull/41358
resolved: https://github.com/facebook/react-native/pull/41359
2023-11-16 22:35:27 -08:00
Riccardo Cipolleschi 77123b8d23 [LOCAL] Update Podfile.lock 2023-11-08 12:06:40 +00:00
Distiller 7ba400c35e [0.73.0-rc.4] Bump version numbers 2023-11-06 22:35:02 +00:00
Luna Wei 7366fc64d8 bumped packages versions
#publish-packages-to-npm
2023-11-06 14:21:06 -08:00
Luna Wei 40c149b0c4 Update missing rnc/cli related packages to 12.0.0 and update lockfile 2023-11-03 10:38:27 -07:00
Riccardo CipolleschiandGitHub 641a11fe21 [RN][CI]Update node installation on debian (0.73) (#41275) 2023-11-03 09:32:40 -07:00
Gabriel DonadelandLuna Wei 84144272ba Fix ios pod post_install logic for detecting if fabric is enabled (#41284)
Summary:
There is a problem in the way that we check if Fabric is enabled inside `react_native_post_install`.

https://github.com/facebook/react-native/blob/899e7cdb55197fc17a96a93af4f8bcc7519553c2/packages/react-native/scripts/react_native_pods.rb#L239

We're determining if fabric is enabled by checking if the `React-Fabric pod `is present, but since we always call `setup_fabric!(:react_native_path => prefix)`  (https://github.com/facebook/react-native/pull/39057) inside `use_react_native` the `React-Fabric` pod is always present causing the `-DRN_FABRIC_ENABLED` flag to always be added to `project.pbxproj` even if the new arch is disabled.

[IOS] [FIXED] - Fix ios pod post_install logic for detecting if fabric is enabled

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

Test Plan: Run `use_react_native!(fabric => false)` should not add the `-DRN_FABRIC_ENABLED` flag to `project.pbxproj`

Reviewed By: fkgozali

Differential Revision: D50896487

Pulled By: cipolleschi

fbshipit-source-id: 78154407ce52b09fd3a317b7dc64bd4bba56363e
2023-11-02 15:32:13 -07:00
Luna Wei 9b97cd95cf Update podfile.lock and yarn.lock 2023-11-02 15:28:41 -07:00
Riccardo CipolleschiandLuna Wei cddd0e17d1 Make the interop-layer work with components with custom name (#41207)
Summary:
This should fix
https://github.com/facebook/react-native/issues/37905#issuecomment-1774851214

When working on react-native-fast-image, we realized that the interop layer does not work for components where the exported name is different from the iOS class.

To fix this, we can use the Bridge to retrieve the actual view manager, given the component name.

This solution should be much more robust than making assumptions on the ViewManager name, given the ComponentName.

On top of that, we realized tha the interop layer was not calling `didSetProps` after setting the props, so we are invoking that.

bypass-github-export-checks

[iOS][Fixed] - Add support for Components with custom names in the interop layer.

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

Test Plan: Tested locally on an app created in 0.72 and 0.73 in Bridge and Bridgeless mode.

Reviewed By: cortinico

Differential Revision: D50698172

Pulled By: cipolleschi

fbshipit-source-id: 49aee905418515b0204febbbe6a67c0114f37029
2023-11-02 14:55:24 -07:00
Luna Wei 126db5eb65 Bump CLI to 12.0.0 2023-11-02 14:46:36 -07:00
Rob HoganandLuna Wei 31ce64073f Bump dependency on deprecated-react-native-prop-types (#40869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40869

Bumps DRNPT to v5 - the significant change is that this one depends on `react-native/normalize-color: ^0.73.0`, instead of `*`, so is protected from future breaking changes to that package.

NOTE: We can't safely include `react-native/normalize-color: ^0.74.0` in the dependency range of DRNPT because `0.74.0` isn't a semver-compliant release (0.74 isn't cut yet), so this will pull 0.73.2 from NPM, which is fine.  We may need to publish DRNPT@6 if 0.74 final turns out to contain breaking changes (eg, a Node 20 bump).

Changelog:
[General][Fixed] Update `deprecated-react-native-prop-types` to remove fragile transitive `*` dependencies.

Reviewed By: huntie

Differential Revision: D50228564

fbshipit-source-id: 01aafafad40d9a93d00de2b5f45d2796620b9b5d
2023-11-02 12:01:08 -07:00
Gabriel Donadel Dall'AgnolandLuna Wei 7aa46a169e Fix createAnimatedStyle when providing undefined transform style (#41176)
Summary:
https://github.com/facebook/react-native/pull/35198 introduced a regression where if an `{transform: undefined}` style is provided to an Animated View a `Cannot read property 'map' of undefined` type error is thrown

<img src="https://github.com/facebook/react-native/assets/11707729/bb87781e-1ba7-40ec-879d-a57cef3e10d9" height="200" />

## Changelog:

[GENERAL] [FIXED] - Fix `createAnimatedStyle` when providing an undefined transform style

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

Test Plan:
<details>
  <summary>Render an `Animated.View` passing `style={{transform: undefined}}`</summary>

E.g.

```
const UndefinedTransform = () => {
  return (
    <View>
      <Animated.View style={{transform: undefined}} />
    </View>
  );
};
```
</details>

### RNTester
1. Open the RNTester app and navigate to the Animated page
2. Navigate to the Transform Styles page
3. App should not throw any errors

<table>
    <tr><th>Before</th><th>After</th></tr>
    <tr>
        <td><video src="https://github.com/facebook/react-native/assets/11707729/92ba9c3b-60b0-4805-8080-0e7fb7c00345"/></td>
        <td><video src="https://github.com/facebook/react-native/assets/11707729/80e2bba8-6ff6-4cf5-bcb8-26de0b869036"/></td>
    </tr>
</table>

Reviewed By: fabriziocucci

Differential Revision: D50638415

Pulled By: javache

fbshipit-source-id: 0ee949f019a77b8bef557888694e0e8404810105
2023-11-02 11:59:41 -07:00
Nick GerlemanandLuna Wei 29f8f1e196 Bail on hiPri render on missing layout data before checking priority (#41270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41270

`scheduleCellsToRenderUpdate()` is called in response to new measurements, or component changes. It has logic to decide whether to immediately calculate new state, or to defer it until a later batched period.

It will not immediately update state if we don't yet have measurements for cells, but this condition is after another which calculates priority, relying on these measurements. These are garbage if we don't yet have measurements, and trigger an invariant violation in horizontal RTL.

This switches around the conditions, to avoid offset resolution if we don't yet have valid measurements.

I suspect some "hiPri" renders where cells shift are bugged right now when we update state in response to content size change, before we have new corresponding cell layouts.

Changelog:
[General][Fixed] - Bail on hiPri render on missing layout data before checking priority

Reviewed By: yungsters

Differential Revision: D50791506

fbshipit-source-id: 8dbffc37edd2a42f7842c0090d344dcd6f3e3c6d
2023-11-02 11:58:46 -07:00
tarunrajputandLuna Wei 832b423a65 fix: textTransform not working in new arch (#41223)
Summary:
Fixes: https://github.com/facebook/react-native/issues/39524

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix textTransform not working in new architecture

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

Test Plan:
**Before:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/d44e6030-0a49-42c9-be44-cf7541583af0">

**After:**
<img width="307" alt="image" src="https://github.com/facebook/react-native/assets/34857453/fb717cec-72d3-41d7-8c48-4ec9a9ecb16b">

Reviewed By: javache

Differential Revision: D50773216

Pulled By: NickGerleman

fbshipit-source-id: 769bf67f2661ff4ff7b88121493bdd27564458d3
2023-11-02 11:57:57 -07:00
David VaccaandLuna Wei f4cf8abc09 Back out "Add support for legacy UIManager in UIManagerHelper"
Summary:
Original commit changeset: 93eba1eb3106

Original Phabricator Diff: D50694805

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D50853438

fbshipit-source-id: 687cb100dfea28f3ea63812e1dd5b21e4c8ceb0e
2023-11-02 11:55:00 -07:00
Nicola CortiandGitHub c8ad23ae1a [0.73] Collection of Android picks for RC4 (#41221)
Co-authored-by: Lulu Wu <luluwu@meta.com>
Co-authored-by: Gabriel Donadel <donadeldev@gmail.com>
fix `java.lang.NoSuchMethodError` for Bridgeless (#41081)
resolved: https://github.com/facebook/react-native/pull/41081
resolved: https://github.com/facebook/react-native/pull/40999
resolved: https://github.com/facebook/react-native/pull/41165
Fix RNTester not showing Redbox when Metro is not connected (#41191)
resolved: https://github.com/facebook/react-native/pull/41191
resolved: https://github.com/facebook/react-native/pull/41190
resolved: https://github.com/facebook/react-native/pull/41085
resolved: https://github.com/facebook/react-native/pull/41206
2023-11-02 09:23:15 -07:00
Riccardo CipolleschiandGitHub 2664b8b117 cipolleschi/fix test script (#41267) 2023-11-02 09:22:38 -07:00
Rob HoganandRob Hogan aed4aed9d5 Update Metro to ^0.80.0, don't pin to exact version
cherry-pick 7853b06929
2023-10-31 11:12:31 +00:00
Riccardo Cipolleschi abfdf2c7fe [LOCAL] Update Podfile.lock 2023-10-24 15:16:06 +01:00
Riccardo Cipolleschi 4ddf7cb025 [LOCAL] Run prettier 2023-10-24 15:14:33 +01:00
Riccardo Cipolleschi f068f4a903 [LOCAL] Fix e2e script for 0.73 2023-10-24 14:50:22 +01:00
Moti ZilbermanandAlex Hunt d64c72f629 Remove deprecated jsinspector files (#41159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41159

Changelog: [Internal]

Cleanup from D48966244. The deprecated `jsinspector` files are no longer used by any code in either fbsource or `react-native`.

Reviewed By: hoxyq

Differential Revision: D50530796

fbshipit-source-id: b539b097cb6caf6c50a482fa93bf5d7886e76e52
2023-10-23 16:32:31 +01:00
Distiller 6d41c72a90 [0.73.0-rc.3] Bump version numbers 2023-10-23 14:23:48 +00:00
Riccardo CipolleschiandAlex Hunt 764ae1a03a Make the Fabric Interop layer work in Bridgeless (#40732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40732

This change allows the Fabric Interop Layer to work in bridgeless mode.

Given that the legacy components requires a Bridge to send events and use commands, this change simulates a bridge when it doesn't exists (i.e.: we are in bridgeless mode).

In order to make it work, we had to simulate a few elements from the Bridge and the UIManager.

## Changelog:
[iOS][Fixed] - Make the Fabric interop layer works in bridgeless mode.

## Facebook:
As an alternative approach, we could have created a `protocol RCTBridging`, have the `RCTBridge` conform to that protocol, and create a new type for it.
Practically this would have been much more cumbersome:
1. The [RCTBridge](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridge.h?lines=87-238) interface is quite big. All the props and method should be part of the protocol.
2. Extensions declared on RCTBridge would not have worked. For example, [`RCTBridge (RCTUIManager)`](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Modules/RCTUIManager.h?lines=170-174).
3. It would require a major overhaul of the APIs, returning `id<RCTBridging>` in place of **every** function that takes/return an instance of `RCTBridge *`.

Clearly, not a feasible way to go.

Reviewed By: RSNara

Differential Revision: D50079929

fbshipit-source-id: 77d4370e9043c8e06b676bff3987511c042b0f9c
2023-10-23 09:55:17 +01:00
Riccardo CipolleschiandAlex Hunt cb658983c4 Fix Glog for earlier versions of Xcode (#41058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41058

Glog has a piece of code which looks like this:
```
namespace google {

// They need the definitions of integer types.
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
```

This fragment is:
- Always valid when the pod does not define a module
- Valid for Xcode >= 14.3, when the pod do define a module
- Invalid for Xcode < 14.3, when the pod do define a module

Modules are required to support Swift, so, in the long run, we want to have `DEFINES_MODULE` set to `YES` for `Glog`.

This is a temporary workaround to keep supporting older versions of Xcode while Apple keeps allowing to use Xcode 14.1 to submit apps to the store.
Historically, Apple pushes the minimum version of Xcode every April, so we expect to be able to remove this workaround in April 2024.

## Changelog:
[Internal] - Make Glog work with older versions of Xcode

Reviewed By: cortinico

Differential Revision: D50410487

fbshipit-source-id: 96145cdf9ba1bc75622403d3c06454d6d4bfd967
2023-10-23 09:55:08 +01:00
Riccardo CipolleschiandAlex Hunt 50a8bd8146 Make hermes build fetching more flavour resilient (#41055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41055

This should fix the issue highlighted in [this comment](https://github.com/reactwg/react-native-releases/discussions/64#discussioncomment-7271155).
Basically, before the fix, we were not supporting flavours correctly, as we assumed that only Debug and Release were available.

With this change, we infer whether we have to fetch Hermes for Debug or Release based on the actual flags that are passed. In this way, the users can customize their app's flavors more freely.

## Changelog:
[Internal] - Support multiple flavors when downloading Hermes

Reviewed By: huntie

Differential Revision: D50408381

fbshipit-source-id: 6990218b286b4dd823323bc63de90279efc9e74e
2023-10-23 09:54:41 +01:00
Alex Hunt a98a781988 Bump package versions
#publish-packages-to-npm
2023-10-19 15:41:54 +01:00
Nicola CortiandAlex Hunt d6b73c6726 Make IntArray events work on Bridgeless for RN-Tester (#41047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41047

Array events are currently broken in the sample for RN Tester. This is because the event name is not registered correctly.

I'm updating the event registration to be correct.

Changelog:
[Internal] [Changed] - Make IntArray events work on Bridgeless for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D50266485

fbshipit-source-id: 13bbce91a41281383d4857048e573b6d9cc5387b
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt d1e2137425 Make events work for Fabric Interop on Bridgeless (#40941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40941

Events are currently not working for Fabric Interop on Bridgeless. That's because the `BridgelessReactContext` is not checking for interop modules on `getJsModule` calls, so the `InteropEventEmitter` is never returned.

This extends `BridgelessReactContext` so that  `InteropEventEmitter` is returned if the Interop Layer is turned on.

Changelog:
[Internal] [Changed] - Make events work for Fabric Interop on Bridgeless

Reviewed By: cipolleschi

Differential Revision: D50266484

fbshipit-source-id: 0188d71bdc7acc8c188d886d45f0258914ad7af7
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt a5df17661d Simplify new app template for bridgeless (#40929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40929

This diff reduces the footprint that bridgeless is imposing on the new app template. Specifically:
- I've created a `.toReactHost` method that converts a DefaultReactNativeHost to a DefaultReactHost
- I've updated RN Tester to use the same setup as the New App template which reduces code duplication.

I also had to remove a couple of `UnstableReactNativeAPI` as those were bleeding in the new app template.
I don't think we should ask users to opt-in in `UnstableReactNativeAPI` in the New App template itself as
this means that all the apps will get this opt-in.
Instead we should keep it only for specific APIs that we want the users to opt into.

Changelog:
[Internal] [Changed] - Simplify new app template for bridgeless

Reviewed By: cipolleschi, luluwu2032

Differential Revision: D50227693

fbshipit-source-id: e86c54d5156cc27f1f898b43ca89c57d5cf148b8
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt 8cae2e75e7 Fix broken Fabric Interop example (#40942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40942

The Fabric Interop example for Android is broken. This is due to the Kotlin conversion which moved the `Color.colorToHSV(color, hsv)` statement *after* the HSV array is read so the array is always [0,0,0].

I'm fixing it here.

Changelog:
[Internal] [Changed] - Fix broken Fabric Interop example

Reviewed By: cipolleschi

Differential Revision: D50264766

fbshipit-source-id: 27ae5289408c7c23c667d6d7112437fa7ebe36d5
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt dbef1d90d1 Make sure onIntArrayChanged is invoked on RN Tester (#40940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40940

Currently the `onIntArrayChanged` event is invoked
 only once inside RN Tester. I'm changing the logic to make sure it fires whenever we click "Set Opacity"

Changelog:
[Internal] [Changed] - Make sure onIntArrayChanged is invoked on RN Tester

Reviewed By: mdvacca, dmytrorykun

Differential Revision: D50264765

fbshipit-source-id: 93a60fd1b657c3d8b8182cab6bb7cd4368ac9a42
2023-10-19 14:29:31 +01:00
Lulu WuandAlex Hunt 34052725e1 Add ExceptionsManagerModule for RNTester (#40767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40767

Fix the following issue:
```Invariant Violation: TurboModuleRegistry.getEnforcing(...):
'ExceptionsManager' could not be found. Verify that a module by this name is registered in the native
binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules":
["PlatformConstants","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","LogBox","Networking","Appearance","DevLoadingView","DeviceInfo","DeviceEventManager",
"SoundManager","ImageLoader","DialogManagerAndroid","NativeAnimatedModule","I18nManager","AccessibilityInfo","StatusBarManager","StatusBarManager","IntentAndroid","ToastAndroid","ShareModule","Vibration"],
"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","FrameRateLogger","KeyboardObserver",
"AccessibilityManager","ModalManager","LinkingManager","ActionSheetManager","ExceptionsManager"]}
```

Changelog:
[Android][Changed] - Add Add ExceptionsManagerModule to CoreReactPackage

Reviewed By: cortinico

Differential Revision: D50017783

fbshipit-source-id: 8642bb23bdae50a1e702f5e0586b0ede80007bb1
2023-10-19 14:29:31 +01:00
Christoph PurrerandAlex Hunt c72867d0ad Add rn-tester Android BUCK configuration (#39987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39987

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49983211

fbshipit-source-id: c362d5b93e159bfb5ca17bea0ec0484adcdb4dca
2023-10-19 14:29:31 +01:00
David VaccaandAlex Hunt 91a25629bd Move ReactHost to com.facebook.react (#39769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39769

Move ReactHost to com.facebook.react

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D49834870

fbshipit-source-id: 2cfdd34297399115457424f0ba1279fd477da4a1
2023-10-19 14:29:31 +01:00
Lulu WuandAlex Hunt efcc3cf4fd Fix new arch example not render in RNTester (#39810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39810

Two issues will be fixed:
- Bridgeless has lazy view manager loading by default so the React Package that provides view managers must implement ViewManagerOnDemandReactPackage, we might could refactor the design of package classes later
- ThemedReactContext should **NOT** be used directly to call function ```getJSModule```, since it doesn't overrides ```getJSModule``` for Bridgeless, we can use it's internal variable ```meactApplicationContext``` which should be an instance of BridgelessReactContext

Reviewed By: cortinico

Differential Revision: D49912656

fbshipit-source-id: a0bdd717612398e8d7a6f36d36dba241a3b06bd7
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt bb4801ca0c Do not guard initializeFlipper for bridgeless for RN Tester
Summary:
We don't need this if-than-else because the initializeFlipper already checks if we're on bridgeless or not

Changelog:
[Internal] [Changed] - Do not guard initializeFlipper for bridgeless for RN Tester

Reviewed By: NickGerleman

Differential Revision: D49881903

fbshipit-source-id: e6bfc941b43382580bd418a5f27ad9426d300c69
2023-10-19 14:29:31 +01:00
OleksiiandAlex Hunt 3700d6a8da rewrite RNTesterApplication to kotlin (#39557)
Summary:
Rewrite `RNTesterApplication` to Kotlin as per [Help us Kotlin-ify React Native tests - Round 2](https://github.com/facebook/react-native/issues/38825)

## Changelog:

[ANDROID] [CHANGED] - Rewrite RNTesterApplication to Kotlin, add AnnotationTarget property.

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

Test Plan:
`yarn && yarn android` 

The only thing I'm kinda unsure of is whether `AnnotationTarget.PROPERTY` should be added, but it didn't let me annotate `reactHostInterface` without that and didn't compile.
<img width="637" alt="image" src="https://github.com/facebook/react-native/assets/33528752/8bc84870-f3f2-4a46-b076-6ee7e38bd735">

 cortinico mdvacca

Reviewed By: cortinico

Differential Revision: D49598401

Pulled By: mdvacca

fbshipit-source-id: 105ae0c13c93dae0eeb2b6fa9040f03f42d2736a
2023-10-19 14:29:31 +01:00
Nicola CortiandAlex Hunt f47635374d Revert "Add ExceptionsManagerModule for RNTester (#40767)"
This reverts commit 034d815cfd.
2023-10-19 14:29:31 +01:00
Riccardo CipolleschiandAlex Hunt 3542e9083a Bump RNTester Cocoapods cache keys after SocketRocket 6.1.0 bump (#40789)
Summary:
Commit 8b88883071 broke the Cache for RNTester because the cached version of the pods does not know about the exitence of SocketRocket 6.1.0
Bumping the keys should force a redownload of the cocoapods specs repo

## Changelog:
[Internal] - Bump RNTester cache keys

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

Test Plan: CircleCI is green

Reviewed By: GijsWeterings

Differential Revision: D50169281

Pulled By: cipolleschi

fbshipit-source-id: 83e251495bfa43d62384470efe97c5505d76684f

# Conflicts:
#	packages/rn-tester/Podfile.lock
2023-10-18 14:54:21 +01:00
Gabriel DonadelandAlex Hunt 93edc9a31a Bump SocketRocket to 0.6.1 (#40774)
Summary:
The SocketRocket version was upgraded to 0.6.1 on the 0.72-stable branch but for some reason it was not updated in main, causing a downgrade when running `pod install` with 0.73.0 RC1

Original commit bumping SocketRocket -> https://github.com/facebook/react-native/commit/8ce471e2fa802cc50ff2d6ab346627cb5f6d79b4

## Changelog:

[IOS] [CHANGED] - Bump SocketRocket to 0.6.1

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

Test Plan: Run rntester locally

Reviewed By: cipolleschi

Differential Revision: D50137261

Pulled By: arushikesarwani94

fbshipit-source-id: dfc2760f5d5611881126ad114d8f6ada23630a29

# Conflicts:
#	packages/react-native/React-Core.podspec
#	packages/react-native/React/CoreModules/React-CoreModules.podspec
#	packages/rn-tester/Podfile.lock
2023-10-18 14:53:32 +01:00
Riccardo CipolleschiandAlex Hunt 1e72390fbb Align all the pods to 13.4 (#41050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41050

This change aligns all the podspecs to 13.4, including 3rd party libraries. This should fix https://github.com/facebook/react-native/issues/39826

## Changelog
[iOS][Changed] - Align all pods to 13.4

Reviewed By: huntie

Differential Revision: D50405114

fbshipit-source-id: 2d1b50ed8433e8cdc2214eb17e15be6ea81107a1

# Conflicts:
#	packages/react-native/scripts/cocoapods/utils.rb
2023-10-18 13:28:52 +01:00
Oscar FrancoandAlex Hunt c4c8b4b95a Symbolicate unhandled promise rejections (#40914)
Summary:
For a very long time when a promise rejects without an attached catch we get this warning screen without a correct stack trace, only some internal calls to the RN internals.

<img src="https://github.com/facebook/react-native/assets/1634213/75aa7615-ee3e-4229-80d6-1744130de6e5" width="200" />

I created [an issue for discussion](https://github.com/react-native-community/discussions-and-proposals/discussions/718) in the react-native-community repo and we figured out it was only a matter of symbolication. While it cannot be done on release without external packages and source maps, at least while developing we can provide a symbolicated stack-trace so developers can better debug the source of rejected promise.

I got the stack trace symbolicated and the correct code frame. I'm missing some help trying to display it in the warning view but at the very least I can now correctly show the line of the error and log the codeframe to the console.
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Show correct stack frame on unhandled promise rejections on development mode.

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

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

Test Plan:
I simply created a throwing function on a dummy app, and checked the output of the console and the warning view:

```ts
import React from 'react';
import {SafeAreaView, Text} from 'react-native';

async function throwme() {
  throw new Error('UNHANDLED');
}

function App(): JSX.Element {
  throwme();

  return (
    <SafeAreaView>
      <Text>Throw test</Text>
    </SafeAreaView>
  );
}

export default App;
```

Here is the output

<img src="https://github.com/facebook/react-native/assets/1634213/2c100e4d-618e-4143-8d64-4095e8370f4f" width="200" />

Edit: I got the warning window working properly:

<img src="https://github.com/facebook/react-native/assets/1634213/f02a2568-da3e-4daa-8132-e05cbe591737" width="200" />

Reviewed By: yungsters

Differential Revision: D50324344

Pulled By: javache

fbshipit-source-id: 66850312d444cf1ae5333b493222ae0868d47056
2023-10-18 11:26:46 +01:00
Riccardo CipolleschiandAlex Hunt ba5895e190 Fix unstable RCTAppDelegate podspec (#41009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41009

This change should fix [#39971](https://github.com/facebook/react-native/issues/39971), computing the relative path from the App path to the pod installation root and using that instead of the absolute path to the `react-native.config.js` file

## Changelog
[Internal] - Stabilize RCTAppDelegate podspec

Reviewed By: cortinico

Differential Revision: D50323710

fbshipit-source-id: e29e62228d08c752e822d7a9ab5b1a2b5dcd6eb4
2023-10-18 11:25:35 +01:00
Saad NajmiandAlex Hunt efcb84126e Rename RCTRootViewFrameDidChangeNotification as it's not trac… (#39835)
Summary:
…king root view frame changes

Looking through where this was introduced (https://github.com/facebook/react-native/pull/37649), it seems the notification went from tracking root view size changes to window size changes. However, it was not renamed. I was using it for root view changes in RN-macOS, which.. I guess I'll refactor. Meanwhile, let's update the name?

## Changelog:

[IOS] [CHANGED] - Rename `RCTRootViewFrameDidChangeNotification` as it's not tracking root view frame changes

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

Test Plan: CI should pass

Reviewed By: cipolleschi

Differential Revision: D50173742

Pulled By: javache

fbshipit-source-id: 4651696174c439800984a5e6cf642200bb9c4f3c
2023-10-18 11:24:27 +01:00
DeokHyeon WiandAlex Hunt becb369601 update: fresco 3.0.0 -> 3.1.0 (#41024)
Summary:
- ref: https://github.com/reactwg/react-native-releases/discussions/64#discussioncomment-7270126

With react-native@0.73.0-rc.2 and fresco@3.0.0, `dlopen failed: library "libnative-imagetranscoder.so"` error made crash in android. so, I patched fresco version to 3.1.0, so that resolves the crash error according to https://github.com/facebook/fresco/issues/2722#issuecomment-1749333089 this comment.

## Changelog:

<!-- 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
-->

[ANDROID] [FIXED] - b1fccb05cc bumped fresco version to 3.1.0.

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

Test Plan: after bumping fresco version, error not occurs.

Reviewed By: cipolleschi

Differential Revision: D50359564

Pulled By: cortinico

fbshipit-source-id: d24caecc057bad4d9c94e378422ab18c106a7ee6

# Conflicts:
#	packages/react-native/gradle/libs.versions.toml
2023-10-18 11:23:03 +01:00
Nicola CortiandAlex Hunt 20d1466be8 Fix compilation warnings introduced by Gradle 8.4 (#39959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39959

We're still accessing project.buildDir which will be removed in Gradle 9.0
I'm cleaning it up here.

Changelog:
[Internal] [Changed] - Fix compilation warnings introduced by Gradle 8.4

Reviewed By: yungsters

Differential Revision: D50016573

fbshipit-source-id: de7a725f61b503f08991ebf85b9a002cefab221a
2023-10-18 11:19:48 +01:00
Lulu WuandAlex Hunt 034d815cfd Add ExceptionsManagerModule for RNTester (#40767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40767

Fix the following issue:
```Invariant Violation: TurboModuleRegistry.getEnforcing(...):
'ExceptionsManager' could not be found. Verify that a module by this name is registered in the native
binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules":
["PlatformConstants","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","LogBox","Networking","Appearance","DevLoadingView","DeviceInfo","DeviceEventManager",
"SoundManager","ImageLoader","DialogManagerAndroid","NativeAnimatedModule","I18nManager","AccessibilityInfo","StatusBarManager","StatusBarManager","IntentAndroid","ToastAndroid","ShareModule","Vibration"],
"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","FrameRateLogger","KeyboardObserver",
"AccessibilityManager","ModalManager","LinkingManager","ActionSheetManager","ExceptionsManager"]}
```

Changelog:
[Android][Changed] - Add Add ExceptionsManagerModule to CoreReactPackage

Reviewed By: cortinico

Differential Revision: D50017783

fbshipit-source-id: 8642bb23bdae50a1e702f5e0586b0ede80007bb1

# Conflicts:
#	packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt
2023-10-18 11:19:29 +01:00
Samuel SuslaandAlex Hunt 7193bd720b Re-introduce FabricViewStateManager interface (#40998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40998

changelog: [Android] Add back interface FabricViewStateManager to unblock 0.73

I incorrectly deleted FabricViewStateManager in D47993140. This is a breaking change even for old architecture. Let's add it back and mark it as deprected so we can remove it later on.
This interface is not used in react-native anymore.

We are removing FabricViewStateManager because it simply wraps StateWrapper and provides no additional anymore.

Reviewed By: cortinico

Differential Revision: D50318633

fbshipit-source-id: aeb1c66c35018e336339616b564dee6f3156b54b
2023-10-18 11:15:43 +01:00
Nicola CortiandAlex Hunt 2d163cf496 Fix instacrash on bridgeless due to calling showMessage on null instance (#39834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39834

Bridgeless is instacrashing on fast-refresh. This fixes it.

Changelog:
[Android] [Fixed] - Fix instacrash on bridgeless due to calling showMessage on null instance

Reviewed By: cipolleschi

Differential Revision: D49929822

fbshipit-source-id: a2ce65797abd34d6a3e2b7f2c50d38a62ea8bdea
2023-10-18 10:51:59 +01:00
UNIDY2002andAlex Hunt 0344de246d Configure Java toolchains only when executing App configuration (#40757)
Summary:
Fix https://github.com/facebook/react-native/issues/40560

## Changelog:

[ANDROID] [FIXED] - Ensure that `configureJavaToolChains` is only executed once during configuration

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

Test Plan:
- Create a fresh `react-native@0.73.0-rc.1` project
- Install `react-native-webview`
- Apply [this patch](https://github.com/react-native-webview/react-native-webview/pull/3175/files) for `react-native-webview` (caused by another issue https://github.com/facebook/react-native/issues/40559)
- Edit `android/gradle.properties` and set `newArchEnabled` to true
- Build application
- (Expected) Application fail to build
- Apply this PR
- (Expected) Application build successfully

**Additional explanation:**

According to the implementation of `configureJavaToolChains`, all the subprojects (both the app and the libraries) will have their toolchains setup in one execution of the method. Therefore, it is okay for the method to be invoked only when configuring the plugin for the app.

On the other hand, invoking the method for more than one time will cause the issue stated in https://github.com/facebook/react-native/issues/40560.

Reviewed By: cipolleschi

Differential Revision: D50361871

Pulled By: cortinico

fbshipit-source-id: bd5e18df97988122788d0482dba954e517a0cb5c
2023-10-18 10:51:43 +01:00
Nicola CortiandAlex Hunt db45da7101 Make sure buildConfig is turned on for all the 3rd party libraries (#40939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40939

Currently some libs on RN 0.73 are broken as the default for Build Config generation changed
from true to false since AGP 8.x. This reverts the behavior to the old flag.

Closes #40791
Closes #40559

Changelog:
[Internal] [Changed] - Make sure buildConfig is turned on for all the 3rd party libraries

Reviewed By: mdvacca

Differential Revision: D50270382

fbshipit-source-id: 02dcb031c577f65be2f41d9da0334c1b3d89e4c5
2023-10-18 10:51:27 +01:00
116-7andAlex Hunt 6bc0444acc Refactors InspectorProxy to compare pathname portion of url passed in… (#41005)
Summary:
… request to local pathname comparator variables to fix issue with other rightward elements of url such as query or fragment entering the comparison and causing 404 errors for key debugging routes.

A change in Chromium appended the query "?for_tabs" to the /json/list request made by Chrome DevTools to find remote debugger targets.

The current comparison in InspectorProxy.js compares the entire node IncomingMessage url field to the local pathname constants. The issue arises as url can also contain the query and fragment portions so the original comparison of "/json/list" === "/json/list" which resolved as true would become "/json/list?for_tabs" === "/json/list" and evaluate to false ultimately resulting in a 404 for the request.

In summary, all these changes/issues caused remote debugging of Hermes code in React Native apps to become unavailable, greatly impacting developer experience.

## Changelog:

[GENERAL] [FIXED] JS Debugging: Fix inspector-proxy to allow for DevTools requests with query strings

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

Reviewed By: NickGerleman

Differential Revision: D50342265

Pulled By: robhogan

fbshipit-source-id: a65f2908f0bea9fc15e1e3e4e6d31a3b9598e81f
2023-10-18 10:37:28 +01:00
Alex HuntandAlex Hunt bf0cdfcdd4 Add "Hermes only" to open debugger key prompt
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D50327180

fbshipit-source-id: 6ee08fadd313828ddbc7702d5b3b1174a91b1ac1
2023-10-18 10:37:01 +01:00
Riccardo CipolleschiandAlex Hunt 9b9c07eaf0 Run all the tests when not on a PR
Summary:
## Changelog:
[Internal] - Run all the tests in CI when not on a PR

Reviewed By: cortinico

Differential Revision: D50220596

fbshipit-source-id: be1a30d713e9d427858cf22bd3ca9549ad513057
2023-10-13 09:47:06 +01:00
Blake FriedmanandAlex Hunt 8d2f41dbbf make runtime reference thread safe on tickleJs call
Summary:
The reference to runtime assumes the queue will ensure references to runtime are valid when invoked. This
isn't the case if you create a breakpoint, Hermes hit that breakpoint and your refresh the app. This consistently
will crash the app.

The fix is to not assument this, similar to ReactCommon/react/runtime/hermes/HermesInstance.cpp

Reviewed By: javache

Differential Revision: D50225678

fbshipit-source-id: b45cae1f5f687bc8c699fd74b187376a547012c5
2023-10-13 09:43:59 +01:00
Alex HuntandAlex Hunt 9f6575b6d4 Disable --experimental-debugger by default (#40795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40795

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D50178494

fbshipit-source-id: b833b6accadd2902d97a45e030cd48d1b62ac438
2023-10-12 13:50:37 +01:00
Nick GerlemanandAlex Hunt a09999911a Fix iOS Paper Scroll Event RTL check (#40751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40751

In D48379915 I fixed inverted `contentOffset` in `onScroll` events on iOS. I thought I tested on Paper, but I think this was during a period where the Paper route in Catalyst was actually launching Fabric (oops).

In Paper, at least under `forceRTL` and English, `[UIApplication sharedApplication].userInterfaceLayoutDirection` is not set to RTL. We instead have a per-view `reactLayoutDirection` we should be reading.

This sort of thing isn't currently set on Fabric, which checks application-level RTL. This seems... not right with being able to set `direction` in a subtree context, but Android does the same thing, and that would take some greater changes.

Changelog:
[iOS][Fixed] - Fix iOS Paper Scroll Event RTL check

Reviewed By: luluwu2032

Differential Revision: D50098310

fbshipit-source-id: e321fca7b2f7983e903e23237bc2d604c72f98a3
2023-10-11 11:39:37 +01:00
Nick GerlemanandAlex Hunt 59855fc412 Remove code to support bottom-up layout events in horizontal RTL (#39646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39646

We can dramatically simplify this code and remove quirks/hacks, now that we can assume layout events are always fired top down.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D49628669

fbshipit-source-id: 7de5bbc4597eba1c59aaa7672c70e76d2786c7ef
2023-10-11 11:39:32 +01:00
Nick GerlemanandAlex Hunt 31680559b4 Deterministic onLayout event ordering for iOS Paper (#40748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40748

The ordering of `onLayout` events is non-deterministic on iOS Paper, due to nodes being added to an `NSHashTable` before iteration, instead of an ordered collection.

We don't do any lookups on the collection, so I think this was chosen over `NSMutableArray` for the sake of `[NSHashTable weakObjectsHashTable]`, to avoid retain/release. Using a collection which does retain/release seems to cause a crash due to double release or similar, so those semantics seem intentional (though I'm not super familiar with the model here).

We can replicate the memory semantics with ordering by using `NSPointerArray` (which is unfortunately not parameterized). This change does that, so we get consistently top-down layout events (matching Fabric, and Android Paper as of D49627996). This lets us use multiple layout events to calculate right/bottom edge insets deterministically.

Changelog:
[iOS][Changed] -  Deterministic onLayout event ordering for iOS Paper

Reviewed By: luluwu2032

Differential Revision: D50093411

fbshipit-source-id: f6a9d5c973b97aede879baa8b952cc1be2447f28
2023-10-11 11:39:25 +01:00
Nick GerlemanandAlex Hunt 21e2445d06 Top-down onLayout events (#39644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39644

This makes Android Paper/Classic renderer fire `onLayout` events top down, like in Fabric/new Architecture. This gives a much more sane model for using layout events to calculate bottom/right-edge insets.

I was under the impression that Paper in general was bottom-up, but it turns out that is only true for Android and Windows (iOS seems totally deterministic).

This is a behavior change, but to my knowledge was never hit during the Fabric migration, and any JS code already written for both Android and iOS cannot make assumptions here anyways.

Changelog:
[General][Changed] - Make layout events top-down on Android classic renderer

Reviewed By: mdvacca

Differential Revision: D49627996

fbshipit-source-id: 29964b421dd420681d45348c7db16f211a6c087f
2023-10-11 11:39:20 +01:00
Dmitry RykunandAlex Hunt 4a4fb12a47 Store hermes stable artifacts inside Pods directory (#40733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40733

Node package managers may purge or recreate `node_modules/react-native` when adding/removenf project dependencies. Storing hermes iOS artifacts inside `node_modules/react-native/sdks` is not reliable.
This diff moves those artifacts to `Pods/hermes-engine-artifacts`.
Should fix https://github.com/facebook/react-native/issues/39903
Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D50081559

fbshipit-source-id: a130898e12fb6275cadaef7617bf4b6a09e6487e
2023-10-11 11:39:10 +01:00
Nicola CortiandGitHub c05b3d385e [0.73] Make sure template is consuming the right buildToolsVersion (#39957) 2023-10-11 11:37:38 +01:00
Alex HuntandAlex Hunt 5310a50a66 Add --experimental-debugger-frontend flag, restore 0.72 flow as base (#40766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40766

This changeset allows users to opt into the new debugger frontend experience by passing `--experimental-debugger` to `react-native start`. **We are defaulting this option to `true`** for now, but will continue to evaluate this feature before 0.73 ships. It restores Flipper (via `flipper://`) as the default handling for `/open-debugger` (matching 0.72 behaviour) when this flag is not enabled.

Detailed changes:

- Replaces `enableCustomDebuggerFrontend` experiment in `dev-middleware` with `enableNewDebugger`. The latter now hard-swaps between the Flipper and new launch flows.
    - Removes now-unused switching of `devtoolsFrontendUrl`.
- Implements `deprecated_openFlipperMiddleware` (matching previous RN CLI implementation).
- Disables "`j` to debug" key handler by default.
- Marks "`j` to debug" and `/open-debugger` console logs as experimental.

Changelog:
[Changed][General] Gate new debugger frontend behind `--experimental-debugger` flag, restore Flipper as base launch flow

Reviewed By: motiz88

Differential Revision: D50084590

fbshipit-source-id: 5234634f20110cb7933b1787bd2c86f645411fff
2023-10-10 18:41:40 +01:00
Distiller e22a8d1ac5 [0.73.0-rc.2] Bump version numbers 2023-10-10 08:36:24 +00:00
Luna Wei d5ff7e7e74 Update .gitignore for sdks/downloads 2023-10-06 10:22:38 -07:00
Luna Wei b4bc816fcd Update pod for CI 2023-10-06 10:22:03 -07:00
Luna Wei a52faa6fab fix missing sed import 2023-10-06 09:30:04 -07:00
Luna WeiandLuna Wei 8e5439f1a7 Set hermes for Android template project in testing
Summary:
Changelog: [Internal] - Set the hermes value as specified by the test-e2e-local script flag. Right now, the script incorrectly ignores the flag

By default, the template project has `hermesEnabled=true`

Reviewed By: cipolleschi

Differential Revision: D49831355

fbshipit-source-id: 7fb8613fa86f2c6140b7d25b16aeb583e6e26c12
2023-10-06 09:25:13 -07:00
Saad NajmiandGitHub 3ba5e4f89c [iOS] Deprecate RCTGetMultiplierForContentSizeCategory (#39785) 2023-10-05 21:35:01 -07:00
NishanandLuna Wei ee6ff7a53e fix: view flips on RTL with new transform origin changes in Paper arch. (#39803)
Summary:
Fixes - https://github.com/facebook/react-native/pull/38626#issuecomment-1745528706. Explained the issue [here](https://github.com/facebook/react-native/pull/38626#issuecomment-1747212113).

## Changelog:

[IOS] [FIXED] - View flips horizontally in paper arch on RTL

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

Test Plan: Run RNTester in Paper mode on iOS

Reviewed By: NickGerleman

Differential Revision: D49952227

Pulled By: lunaleaps

fbshipit-source-id: 7240552e499765859dceea0a0406561cc3a3148f
2023-10-05 21:34:28 -07:00
Riccardo CipolleschiandLuna Wei 7f72275567 Fix Gemfile, setting Active support to < 7.1.0 (#39828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39828

Active Suppert released a new Gem which is incompatible with Cocoapods 1.13.0, the latest release, as they removed a method used by cocoapods.

This fix ensures that we install compatible versions of the Gem.

## Changelog:
[iOS][Fixed] - Set the max version of Active support to 7.0.8

Reviewed By: hoxyq

Differential Revision: D49949782

fbshipit-source-id: 278097502d3a416567cc8c0b90090fee4fb21503
2023-10-05 21:34:09 -07:00
Dmitry RykunandLuna Wei d247b61f78 Default to native view configs in bridged mode and to static view configs in bridgeless mode (#39704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39704

Default to native view configs in bridged mode and to static view configs in bridgeless mode.
Remove `setRuntimeConfigProvider` calls from RNTester and from the Template.
Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D49687252

fbshipit-source-id: 140e1c510ba3fbc153978b59c8bb4b4e35bc7571
2023-10-05 21:34:01 -07:00
Riccardo CipolleschiandLuna Wei 7a4a0c4984 Remove unneeded write to .version file (#39807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39807

We used to need this file so that we could read the react native version when [creating Hermes artifacts](https://github.com/facebook/react-native/commit/e4b5d3eec9bae44c46795c4be097b31cb48593ae#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R1507). Originally, that change was introduced [here](https://github.com/facebook/react-native/commit/e4b5d3eec9bae44c46795c4be097b31cb48593ae#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47)

Despite the fact that that approach was wrong, as we already have the right version in the package.json which is guaranteed to be present, a lot has changed since then and we don't need that file anymore.

## Changelog:
[Internal] - Remove lines that write a .version file while releasing on npm

Reviewed By: lunaleaps

Differential Revision: D49909718

fbshipit-source-id: bd23d6d73001d0b58bf6b0321ed6d4ceb3523e7a
2023-10-05 21:33:18 -07:00
Nicola CortiandLuna Wei 82a52a1939 Fix broken Loading/Refreshing indicator on Android
Summary:
The Loading.../Refreshing... indicator is currently broken on Android.
The reason is related to D42599220
We used to have a Toast shown to users on Android as a fallback, but as the
DevLoadingView is not always loaded as a module in the core package, this ends up in the banner never beign shown to the user (on RN Tester or template apps).

Changelog:
[Android] [Fixed] - Fix broken Loading/Refreshing indicator on Android

Reviewed By: cipolleschi

Differential Revision: D49876757

fbshipit-source-id: 400e002327ebca908e3e7a7f81c5066888ac4e9b
2023-10-05 21:32:51 -07:00
Distiller e8f41ce48b [0.73.0-rc.1] Bump version numbers 2023-10-04 08:37:43 +00:00
Riccardo CipolleschiandGitHub 032706790a Make jobs required for hermes to run on tagged builds (#39800) 2023-10-04 10:22:14 +02:00
Thibault Malbranche 8eec395268 Revert "[0.73.0-rc.1] Bump version numbers"
This reverts commit 725b1c9a7e.
2023-10-04 10:20:44 +02:00
Distiller 725b1c9a7e [0.73.0-rc.1] Bump version numbers 2023-10-03 20:23:12 +00:00
Alex Hunt 50f242e4d7 Bump package versions
#publish-packages-to-npm
2023-10-03 15:11:53 -04:00
Alex Hunt e5bf39cf85 Fix start command exit behaviour
This is an eager cherry pick of #39788 for `0.73-stable`.
2023-10-03 15:04:22 -04:00
Alex Hunt 047f645079 Fix typings for ReactNativeVersionCheck
Applies correct fix for `_formatVersion` misalignment — based on #36657.
2023-10-03 14:36:08 -04:00
Alex Hunt dd30cd30c9 Revert "Fix typings for ReactNativeVersion.js"
This reverts commit b6c0703ebb.
2023-10-03 14:36:08 -04:00
Distiller f133dd2efb [0.73.0-rc.0] Bump version numbers 2023-10-03 16:13:06 +00:00
Riccardo CipolleschiandGitHub 8263b9d237 [RN][CI] Make the Choose CI Job run also on tags (#39774) 2023-10-03 11:58:36 -04:00
Alex Hunt 0c040314b5 Revert "[0.73.0-rc.0] Bump version numbers"
This reverts commit 6b9cf50b30.
2023-10-03 11:57:38 -04:00
Alex Hunt b6c0703ebb Fix typings for ReactNativeVersion.js
This is an eager cherry pick of #39784 for `0.73-stable`.
2023-10-03 11:56:51 -04:00
Distiller 6b9cf50b30 [0.73.0-rc.0] Bump version numbers 2023-10-02 21:39:05 +00:00
Alex Hunt aa58c4c4b7 Bump package versions (dependant packages)
#publish-packages-to-npm
2023-10-02 16:57:25 -04:00
Alex Hunt 3793a64808 Bump package versions
#publish-packages-to-npm
2023-10-02 16:50:40 -04:00
David VaccaandAlex Hunt e6b24a3146 Mark initHybrid as @JvmStatic (#39755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39755

The goal of this diff is to fix:
```
JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoSuchMethodError: no static or non-static method
"Lcom/facebook/react/jscexecutor/JSCExecutor;.initHybrid(Lcom/facebook/react/bridge/ReadableNativeMap;)Lcom/facebook/jni/HybridData;"

```

changelog: [internal] internal

Reviewed By: luluwu2032

Differential Revision: D49831595

fbshipit-source-id: 9ce22cdccdd02af74edb27be2df72a469d3166c9
2023-10-02 16:31:16 -04:00
Alex HuntandAlex Hunt c116c1c268 Sync debugger-frontend
Summary:
Sync latest `debugger-frontend` artifacts, based on https://github.com/motiz88/rn-chrome-devtools-frontend/pull/12.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D49502838

fbshipit-source-id: 25805066670ac35ec976dc820a73a722ee182dd2
2023-10-02 13:40:29 -04:00
Riccardo CipolleschiandAlex Hunt 67ebc7c7d5 Update Xcode 15 patches to be more robust (#39710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39710

Last week Apple released Xcode 15, which required us to ship a workaround for the new linker.
Unfortunately, the previous fix was not good enough and there were some edge cases that were not covered.
For example, in some occasions the flags are read as an array and the `-Wl` and the `-ld_classic` flags were separated and not properly removed when moving from Xcode 15 to Xcpde 14.3.1.

This change fixes those edge cases, with a more robust solution where:
- We convert the flags to a string.
- We trim the string and the values properly.
- We add the flags when running `pod install` with Xcode 15 as the default iOS toolchain.
- We remove the flags when running `pod install` with Xcode <15 as the default iOS toolchain.

## Changelog:
[Internal] - Make the Xcode 15 workaround more robust.

Reviewed By: dmytrorykun

Differential Revision: D49748844

fbshipit-source-id: 34976d148f123c5aacba6487a500874bb938fe99
2023-10-02 10:59:36 -04:00
Alex Hunt 49bd0ed303 Bump package versions
#publish-packages-to-npm
2023-09-27 15:22:42 -04:00
Alex Hunt 608b4bac44 Bump CLI to 12.0.0-alpha.17 2023-09-27 15:21:37 -04:00
Dmitry RykunandLuna Wei ea09bcd8cb Export Commands and Constants only if native view config interop is enabled (#39696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39696

`Commands` and `Constants` should be set in native only if component data is instantiated via native view config interop layer.
Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D49684166

fbshipit-source-id: ceaa29c2ed3336aa6e21a116a3f5f94e03c225c1
2023-09-27 13:41:12 -04:00
Ramanpreet NaraandLuna Wei 562109fdd3 Enable TurboModule interop in Bridgeless Mode (#39687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39687

Bridgeless mode is releasing in 0.73.

Bridgeless mode isn't stable inside RNTester (in 0.73) without the TurboModule interop layer: T164853040.

**Changes:** Enable the TurboModule interop layer in RNTester (Bridgeless Mode).

**Urgency:** This will unblock the 0.73.

Changelog: [General][Added] - Enable TurboModule interop in Bridgeless mode

Reviewed By: fkgozali, dmytrorykun, luluwu2032

Differential Revision: D49653919

fbshipit-source-id: a4a09a99544c2ef8713484dbeab5cb04f29256cc
2023-09-27 13:39:15 -04:00
Arushi KesarwaniandLuna Wei a57a8b7782 Reduce visibility of functions in ReactHostImpl (#39640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39640

changelog: [internal] internal

Reducing visibility from public to package only for `ReactHostImpl.getDefaultHardwareBackBtnHandler()` since it's only used within package

Reviewed By: mdvacca

Differential Revision: D49612859

fbshipit-source-id: 3c40888da732f33dc046d9363b08119e707f4ea4
2023-09-27 13:03:16 -04:00
Luna Wei 69e0c2d916 bumped packages versions
#publish-packages-to-npm
2023-09-27 12:36:19 -04:00
Alex Hunt 04d80478c8 Bump CLI to 12.0.0-alpha.16 2023-09-27 12:19:06 -04:00
Alex HuntandGitHub 73cd7c0e6b [Hotfix] Remove node engines constraint for normalize-color (#39698) 2023-09-27 12:18:28 -04:00
Lulu WuandLuna Wei 4c1418a216 Enable Template with Bridgeless (#39661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39661

Changelog:
[Android][Changed] - Enable Template with Bridgeless

Reviewed By: cortinico

Differential Revision: D49464580

fbshipit-source-id: 26dd8e2a0b9a66421d58f147eed4d2fd28817dc7
2023-09-26 13:40:32 -04:00
Dmitry RykunandLuna Wei 9f5c77dab7 Enable native view configs in bridgeless mode in OSS (#39476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39476

This diff enables native view config interop layer in bridgeless mode by default for OSS.
It also removes redundant `enableNativeViewConfigsInBridgelessMode` JS feature flag.
Changelog: [General][Added] - Native view config interop layer enabled in bridgeless mode.

Reviewed By: luluwu2032

Differential Revision: D49318325

fbshipit-source-id: ea2e38b2ea10637b578d98e38d97eed923498fb3
2023-09-26 13:15:39 -04:00
Luna Wei b07859ab1f Bump react-native-babel-preset to 0.73.18 #publish-packages-to-npm 2023-09-26 12:16:15 -04:00
Alex Hunt 90b8518073 bumped packages versions
#publish-packages-to-npm
2023-09-26 10:27:39 -04:00
Alex Hunt d54e20b5f6 Set Hermes release version 2023-09-26 10:24:51 -04:00
261 changed files with 3709 additions and 2898 deletions
+16 -4
View File
@@ -35,7 +35,16 @@ jobs:
command: |
apt update
apt install -y wget git curl jq
curl -sL https://deb.nodesource.com/setup_18.x | bash -
apt-get update
apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt install -y nodejs
npm install --global yarn
- checkout
@@ -69,9 +78,9 @@ jobs:
command: |
if [[ -z "$CIRCLE_PULL_REQUEST" ]]; then
echo "Not in a PR. Can't filter properly outside a PR. Please open a PR so that we can run the proper CI tests."
echo "Skipping!"
echo "For safety, we run all the tests!"
mkdir -p /tmp/circleci/
echo '{}' > /tmp/circleci/pipeline_config.json
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
else
PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}"
node ./scripts/circleci/pipeline_selection.js filter-jobs
@@ -91,4 +100,7 @@ jobs:
workflows:
always-run:
jobs:
- choose_ci_jobs
- choose_ci_jobs:
filters:
tags:
only: /.*/
+5 -1
View File
@@ -61,7 +61,11 @@ commands:
# Set ruby dependencies
rbenv global << parameters.ruby_version >>
gem install bundler
if [[ $(echo << parameters.ruby_version >> | awk -F'.' '{print $1}') == "2" ]]; then
gem install bundler -v 2.4.22
else
gem install bundler
fi
bundle check || bundle install --path vendor/bundle --clean
- save_cache:
key: *rbenv_cache_key
+1 -1
View File
@@ -35,4 +35,4 @@ executors:
xcode: *xcode_version
resource_class: macos.x86.medium.gen2
environment:
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
+13 -4
View File
@@ -621,7 +621,7 @@ jobs:
- run:
name: Install Node JS
# Note: Version set separately for non-Windows builds, see above.
command: choco install nodejs-lts
command: choco install -y nodejs --version=18.18.0 --allow-downgrade
# Setup Dependencies
- run:
@@ -673,7 +673,7 @@ jobs:
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- HERMES_VERSION_FILE: "packages/react-native/sdks/.hermesversion"
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
steps:
- run:
name: Install dependencies
@@ -681,7 +681,16 @@ jobs:
apt update
apt install -y wget git curl jq
curl -sL https://deb.nodesource.com/setup_18.x | bash -
apt-get update
apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt install -y nodejs
npm install --global yarn
- checkout
@@ -1074,7 +1083,7 @@ jobs:
name: Build HermesC for Windows
command: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
choco install -y --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
+2 -2
View File
@@ -91,8 +91,8 @@ references:
hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v1-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
# Cocoapods - RNTester
pods_cache_key: &pods_cache_key v10-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
cocoapods_cache_key: &cocoapods_cache_key v8-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v6-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
cocoapods_cache_key: &cocoapods_cache_key v9-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v7-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
# Cocoapods - Template
template_cocoapods_cache_key: &template_cocoapods_cache_key v4-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile.lock" }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock }}
+2
View File
@@ -43,6 +43,7 @@ workflows:
requires:
- prepare_hermes_workspace
- build_apple_slices_hermes:
filters: *only_release_tags
requires:
- build_hermesc_apple
matrix:
@@ -54,6 +55,7 @@ workflows:
requires:
- prepare_hermes_workspace
- build_hermes_macos:
filters: *only_release_tags
requires:
- build_apple_slices_hermes
matrix:
-1
View File
@@ -21,7 +21,6 @@ DerivedData
*.xcuserstate
project.xcworkspace
**/.xcode.env.local
/poackages/react-native/sdks/downloads/
# Gradle
/build/
+1 -1
View File
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.12'
gem 'activesupport', '>= 6.1.7.3'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
+29
View File
@@ -0,0 +1,29 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'open' {
import type {ChildProcess} from 'child_process';
declare export type Options = $ReadOnly<{
wait?: boolean,
background?: boolean,
newInstance?: boolean,
allowNonzeroExitCode?: boolean,
...
}>;
declare type open = (
target: string,
options?: Options,
) => Promise<ChildProcess>;
declare module.exports: open;
}
+5 -4
View File
@@ -25,6 +25,7 @@
"lint-java": "node ./scripts/lint-java.js",
"lint": "eslint .",
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
"print-packages": "node ./scripts/monorepo/print",
"shellcheck": "./scripts/circleci/analyze_scripts.sh",
"start": "cd packages/rn-tester && npm run start",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
@@ -55,8 +56,8 @@
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.6.3",
"@pkgjs/parseargs": "^0.11.0",
"@react-native/metro-babel-transformer": "^0.73.11",
"@react-native/metro-config": "^0.73.0",
"@react-native/metro-babel-transformer": "0.73.15",
"@react-native/metro-config": "0.73.5",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.0.18",
"@typescript-eslint/parser": "^5.57.1",
@@ -91,8 +92,8 @@
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "0.79.1",
"metro-memory-fs": "0.79.1",
"metro-babel-register": "^0.80.0",
"metro-memory-fs": "^0.80.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
+7 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.73.0",
"version": "0.73.1",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
@@ -9,7 +9,12 @@
"directory": "packages/assets"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/assets#readme",
"keywords": ["assets", "registry", "react-native", "support"],
"keywords": [
"assets",
"registry",
"react-native",
"support"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
+8
View File
@@ -83,6 +83,14 @@ function isCodegenDeclaration(declaration) {
declaration.expression.callee.name === 'codegenNativeComponent'
) {
return true;
} else if (
declaration.type === 'TSAsExpression' &&
declaration.expression &&
declaration.expression.callee &&
declaration.expression.callee.name &&
declaration.expression.callee.name === 'codegenNativeComponent'
) {
return true;
}
return false;
+10 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.73.0",
"version": "0.73.4",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -9,7 +9,14 @@
"directory": "packages/babel-plugin-codegen"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/babel-plugin-codegen#readme",
"keywords": ["babel", "plugin", "codegen", "react-native", "native-modules", "view-manager"],
"keywords": [
"babel",
"plugin",
"codegen",
"react-native",
"native-modules",
"view-manager"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
@@ -18,7 +25,7 @@
"index.js"
],
"dependencies": {
"@react-native/codegen": "*"
"@react-native/codegen": "0.73.3"
},
"devDependencies": {
"@babel/core": "^7.20.0"
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.73.1",
"version": "0.73.17",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,20 +22,20 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "^0.73.0",
"@react-native-community/cli-server-api": "12.0.0-alpha.15",
"@react-native-community/cli-tools": "12.0.0-alpha.15",
"@react-native/metro-babel-transformer": "^0.73.11",
"@react-native/dev-middleware": "0.73.8",
"@react-native-community/cli-server-api": "12.3.6",
"@react-native-community/cli-tools": "12.3.6",
"@react-native/metro-babel-transformer": "0.73.15",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "0.79.1",
"metro-config": "0.79.1",
"metro-core": "0.79.1",
"metro": "^0.80.3",
"metro-config": "^0.80.3",
"metro-core": "^0.80.3",
"node-fetch": "^2.2.0",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "0.79.1"
"metro-resolver": "^0.80.3"
},
"engines": {
"node": ">=18"
@@ -15,7 +15,6 @@ import {logger} from '@react-native-community/cli-tools';
import chalk from 'chalk';
import execa from 'execa';
import fetch from 'node-fetch';
import readline from 'readline';
import {KeyPressHandler} from '../../utils/KeyPressHandler';
const CTRL_C = '\u0003';
@@ -23,27 +22,23 @@ const CTRL_D = '\u0004';
export default function attachKeyHandlers({
cliConfig,
serverInstance,
devServerUrl,
messageSocket,
experimentalDebuggerFrontend,
}: {
cliConfig: Config,
devServerUrl: string,
serverInstance: http$Server | https$Server,
messageSocket: $ReadOnly<{
broadcast: (type: string, params?: Record<string, mixed> | null) => void,
...
}>,
experimentalDebuggerFrontend: boolean,
}) {
if (process.stdin.isTTY !== true) {
logger.debug('Interactive mode is not supported in this environment');
return;
}
readline.emitKeypressEvents(process.stdin);
// $FlowIgnore[prop-missing]
process.stdin.setRawMode(true);
const execaOptions = {
env: {FORCE_COLOR: chalk.supportsColor ? 'true' : 'false'},
};
@@ -83,30 +78,35 @@ export default function attachKeyHandlers({
).stdout?.pipe(process.stdout);
break;
case 'j':
if (!experimentalDebuggerFrontend) {
return;
}
await fetch(devServerUrl + '/open-debugger', {method: 'POST'});
break;
case CTRL_C:
case CTRL_D:
logger.info('Stopping server');
listener?.({pause: true});
serverInstance.close(() => {
process.emit('SIGINT');
process.exit();
});
keyPressHandler.stopInterceptingKeyStrokes();
process.emit('SIGINT');
process.exit();
}
};
const keyPressHandler = new KeyPressHandler(onPress);
const listener = keyPressHandler.createInteractionListener();
keyPressHandler.createInteractionListener();
keyPressHandler.startInterceptingKeyStrokes();
logger.log(
`
${chalk.bold('i')} - run on iOS
${chalk.bold('a')} - run on Android
${chalk.bold('d')} - open Dev Menu
${chalk.bold('j')} - open debugger
${chalk.bold('r')} - reload app
`,
[
'',
`${chalk.bold('i')} - run on iOS`,
`${chalk.bold('a')} - run on Android`,
`${chalk.bold('d')} - open Dev Menu`,
...(experimentalDebuggerFrontend
? [`${chalk.bold('j')} - open debugger (experimental, Hermes only)`]
: []),
`${chalk.bold('r')} - reload app`,
'',
].join('\n'),
);
}
@@ -95,6 +95,13 @@ const startCommand: Command = {
name: '--no-interactive',
description: 'Disables interactive mode',
},
{
name: '--experimental-debugger',
description:
"[Experimental] Enable the new debugger experience and 'j' to " +
'debug. This enables the new frontend experience only: connection ' +
'reliability and some basic features are unstable in this release.',
},
],
};
@@ -33,6 +33,7 @@ export type StartCommandArgs = {
assetPlugins?: string[],
cert?: string,
customLogReporterPath?: string,
experimentalDebugger: boolean,
host?: string,
https?: boolean,
maxWorkers?: number,
@@ -118,7 +119,7 @@ async function runServer(
logger,
unstable_experiments: {
// NOTE: Only affects the /open-debugger endpoint
enableCustomDebuggerFrontend: true,
enableNewDebugger: args.experimentalDebugger,
},
});
@@ -137,8 +138,8 @@ async function runServer(
attachKeyHandlers({
cliConfig: ctx,
devServerUrl,
serverInstance,
messageSocket: messageSocketEndpoint,
experimentalDebuggerFrontend: args.experimentalDebugger,
});
}
},
@@ -62,6 +62,7 @@ function getOverrideConfig(ctx: ConfigLoadingContext): InputConfigT {
...outOfTreePlatforms.map(platform =>
require.resolve(
`${ctx.platforms[platform].npmPackageName}/Libraries/Core/InitializeCore`,
{paths: [ctx.root]},
),
),
],
+4 -4
View File
@@ -1,9 +1,9 @@
@generated SignedSource<<8a0bac4cfdcc3cd44a4f7136f2611ebb>>
Git revision: 0ffb687b8e049769d2e7162ba8d7205c90e4110c
@generated SignedSource<<fbad20dc7d32047d6d436b94ec8a15b4>>
Git revision: 12a45e0628384aa80075493354159ef5d91b2698
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/motiz88/rn-chrome-devtools-frontend
Remote branch: rn-0.73-chromium-5845
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
Remote branch: main
GN build args (overrides only):
is_official_build = true
Git status in checkout:
@@ -13,6 +13,7 @@ style.setProperty('--image-file-chromeLeft', 'url(\"' + new URL('./chromeLeft.av
style.setProperty('--image-file-chromeMiddle', 'url(\"' + new URL('./chromeMiddle.avif', import.meta.url).toString() + '\")');
style.setProperty('--image-file-chromeRight', 'url(\"' + new URL('./chromeRight.avif', import.meta.url).toString() + '\")');
style.setProperty('--image-file-cssoverview_icons_2x', 'url(\"' + new URL('./cssoverview_icons_2x.avif', import.meta.url).toString() + '\")');
style.setProperty('--image-file-favicon', 'url(\"' + new URL('./favicon.ico', import.meta.url).toString() + '\")');
style.setProperty('--image-file-navigationControls_2x', 'url(\"' + new URL('./navigationControls_2x.png', import.meta.url).toString() + '\")');
style.setProperty('--image-file-navigationControls', 'url(\"' + new URL('./navigationControls.png', import.meta.url).toString() + '\")');
style.setProperty('--image-file-nodeIcon', 'url(\"' + new URL('./nodeIcon.avif', import.meta.url).toString() + '\")');
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,s="";class r{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new r),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}")}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const t=e.experiment;if("*"===t)return!0;if(t&&t.startsWith("!")&&o.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!o.isEnabled(t))return!1;const n=e.condition;return!(n&&!n.startsWith("!")&&!r.queryParam(n))&&!(n&&n.startsWith("!")&&r.queryParam(n.substring(1)))}loadLegacyModule(e){return import(`../../${e}`)}}class i{#e;#t;#n;#s;#r;#i;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#s=new Set,this.#r=new Set,this.#i=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||this.#i.has(t.name)||e.push(t);return e}enabledExperiments(){return this.#e.filter((e=>e.isEnabled()))}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==r.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#s.has(e))||(!!this.#r.has(e)||Boolean(r.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);const n=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setNonConfigurableExperiments(e){for(const t of e)this.checkExperiment(t),this.#i.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#s.clear(),this.#r.clear()}cleanUpStaleExperiments(){const e=r.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const s=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){}}class a{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,s,r,i){this.name=t,this.title=n,this.unstable=s,this.docLink=r,this.feedbackLink=i,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const o=new i;var l,E;!function(e){e.CAPTURE_NODE_CREATION_STACKS="captureNodeCreationStacks",e.CSS_OVERVIEW="cssOverview",e.LIVE_HEAP_PROFILE="liveHeapProfile",e.DEVELOPER_RESOURCES_VIEW="developerResourcesView",e.CSP_VIOLATIONS_VIEW="cspViolationsView",e.WASM_DWARF_DEBUGGING="wasmDWARFDebugging",e.ALL="*",e.PROTOCOL_MONITOR="protocolMonitor",e.WEBAUTHN_PANE="webauthnPane",e.FULL_ACCESSIBILITY_TREE="fullAccessibilityTree",e.PRECISE_CHANGES="preciseChanges",e.STYLES_PANE_CSS_CHANGES="stylesPaneCSSChanges",e.HEADER_OVERRIDES="headerOverrides",e.EYEDROPPER_COLOR_PICKER="eyedropperColorPicker",e.INSTRUMENTATION_BREAKPOINTS="instrumentationBreakpoints",e.AUTHORED_DEPLOYED_GROUPING="authoredDeployedGrouping",e.IMPORTANT_DOM_PROPERTIES="importantDOMProperties",e.JUST_MY_CODE="justMyCode",e.PRELOADING_STATUS_PANEL="preloadingStatusPanel",e.DISABLE_COLOR_FORMAT_SETTING="disableColorFormatSetting",e.TIMELINE_AS_CONSOLE_PROFILE_RESULT_PANEL="timelineAsConsoleProfileResultPanel",e.OUTERMOST_TARGET_SELECTOR="outermostTargetSelector",e.JS_PROFILER_TEMP_ENABLE="jsProfilerTemporarilyEnable",e.HIGHLIGHT_ERRORS_ELEMENTS_PANEL="highlightErrorsElementsPanel",e.SET_ALL_BREAKPOINTS_EAGERLY="setAllBreakpointsEagerly",e.REACT_NATIVE_SPECIFIC_UI="reactNativeSpecificUI"}(l||(l={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder"}(E||(E={}));var c=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:o,get ExperimentName(){return l},get ConditionName(){return E}});export{c as Runtime};
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,s="";class r{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new r),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}")}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const t=e.experiment;if("*"===t)return!0;if(t&&t.startsWith("!")&&l.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!l.isEnabled(t))return!1;const n=e.condition;return!(n&&!n.startsWith("!")&&!r.queryParam(n))&&!(n&&n.startsWith("!")&&r.queryParam(n.substring(1)))}loadLegacyModule(e){return import(`../../${e}`)}}class i{#e;#t;#n;#s;#r;#i;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#s=new Set,this.#r=new Set,this.#i=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||this.#i.has(t.name)||e.push(t);return e}enabledExperiments(){return this.#e.filter((e=>e.isEnabled()))}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==r.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#s.has(e))||(!!this.#r.has(e)||Boolean(r.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);const n=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setNonConfigurableExperiments(e){for(const t of e)this.checkExperiment(t),this.#i.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#s.clear(),this.#r.clear()}cleanUpStaleExperiments(){const e=r.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const s=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){}}class a{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,s,r,i){this.name=t,this.title=n,this.unstable=s,this.docLink=r,this.feedbackLink=i,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const l=new i;var o,E;!function(e){e.CAPTURE_NODE_CREATION_STACKS="captureNodeCreationStacks",e.CSS_OVERVIEW="cssOverview",e.LIVE_HEAP_PROFILE="liveHeapProfile",e.DEVELOPER_RESOURCES_VIEW="developerResourcesView",e.CSP_VIOLATIONS_VIEW="cspViolationsView",e.WASM_DWARF_DEBUGGING="wasmDWARFDebugging",e.ALL="*",e.PROTOCOL_MONITOR="protocolMonitor",e.WEBAUTHN_PANE="webauthnPane",e.FULL_ACCESSIBILITY_TREE="fullAccessibilityTree",e.PRECISE_CHANGES="preciseChanges",e.STYLES_PANE_CSS_CHANGES="stylesPaneCSSChanges",e.HEADER_OVERRIDES="headerOverrides",e.EYEDROPPER_COLOR_PICKER="eyedropperColorPicker",e.INSTRUMENTATION_BREAKPOINTS="instrumentationBreakpoints",e.AUTHORED_DEPLOYED_GROUPING="authoredDeployedGrouping",e.IMPORTANT_DOM_PROPERTIES="importantDOMProperties",e.JUST_MY_CODE="justMyCode",e.PRELOADING_STATUS_PANEL="preloadingStatusPanel",e.DISABLE_COLOR_FORMAT_SETTING="disableColorFormatSetting",e.TIMELINE_AS_CONSOLE_PROFILE_RESULT_PANEL="timelineAsConsoleProfileResultPanel",e.OUTERMOST_TARGET_SELECTOR="outermostTargetSelector",e.JS_PROFILER_TEMP_ENABLE="jsProfilerTemporarilyEnable",e.HIGHLIGHT_ERRORS_ELEMENTS_PANEL="highlightErrorsElementsPanel",e.SET_ALL_BREAKPOINTS_EAGERLY="setAllBreakpointsEagerly",e.REACT_NATIVE_SPECIFIC_UI="reactNativeSpecificUI"}(o||(o={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(E||(E={}));var c=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:l,get ExperimentName(){return o},get ConditionName(){return E}});export{c as Runtime};
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/devtools_app/devtools_app.js"></script>
<body class="undocked" id="-blink-dev-tools">
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/inspector/inspector.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/js_app/js_app.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/ndb_app/ndb_app.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/node_app/node_app.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -1 +1 @@
import*as e from"../../core/i18n/i18n.js";import*as t from"../../core/root/root.js";import*as i from"../../ui/legacy/legacy.js";const o={profiler:"Profiler",showProfiler:"Show Profiler",performance:"Performance",showPerformance:"Show Performance",startStopRecording:"Start/stop recording",showRecentTimelineSessions:"Show recent timeline sessions",record:"Record",stop:"Stop",startProfilingAndReloadPage:"Start profiling and reload page"},n=e.i18n.registerUIStrings("panels/js_profiler/js_profiler-meta.ts",o),r=e.i18n.getLazilyComputedLocalizedString.bind(void 0,n);let a,l;async function s(){return l||(l=await import("../profiler/profiler.js")),l}async function c(){return a||(a=await import("../timeline/timeline.js")),a}function g(e){return void 0===a?[]:e(a)}i.ViewManager.registerViewExtension({location:"panel",id:"js_profiler",title:r(o.profiler),commandPrompt:r(o.showProfiler),order:65,persistence:"closeable",experiment:t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,loadView:async()=>(await s()).ProfilesPanel.JSProfilerPanel.instance()}),i.ViewManager.registerViewExtension({location:"panel",id:"timeline",title:r(o.performance),commandPrompt:r(o.showPerformance),order:66,hasToolbar:!1,isPreviewFeature:!0,loadView:async()=>(await c()).TimelinePanel.TimelinePanel.instance({forceNew:null,isNode:!0})}),i.ActionRegistration.registerActionExtension({actionId:"profiler.js-toggle-recording",category:i.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,title:r(o.startStopRecording),iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes(){return e=e=>[e.ProfilesPanel.JSProfilerPanel],void 0===l?[]:e(l);var e},loadActionDelegate:async()=>(await s()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),category:i.ActionRegistration.ActionCategory.PERFORMANCE,title:r(o.showRecentTimelineSessions),contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:i.ActionRegistration.ActionCategory.PERFORMANCE,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),options:[{value:!0,title:r(o.record)},{value:!1,title:r(o.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),category:i.ActionRegistration.ActionCategory.PERFORMANCE,title:r(o.startProfilingAndReloadPage),loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}]});
import*as e from"../../core/i18n/i18n.js";import*as t from"../../core/root/root.js";import*as i from"../../ui/legacy/legacy.js";const o={profiler:"Profiler",showProfiler:"Show Profiler",performance:"Performance",showPerformance:"Show Performance",startStopRecording:"Start/stop recording",showRecentTimelineSessions:"Show recent timeline sessions",record:"Record",stop:"Stop",startProfilingAndReloadPage:"Start profiling and reload page"},n=e.i18n.registerUIStrings("panels/js_profiler/js_profiler-meta.ts",o),r=e.i18n.getLazilyComputedLocalizedString.bind(void 0,n);let a,l;async function s(){return l||(l=await import("../profiler/profiler.js")),l}async function c(){return a||(a=await import("../timeline/timeline.js")),a}function g(e){return void 0===a?[]:e(a)}i.ViewManager.registerViewExtension({location:"panel",id:"js_profiler",title:r(o.profiler),commandPrompt:r(o.showProfiler),order:65,persistence:"permanent",experiment:t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,loadView:async()=>(await s()).ProfilesPanel.JSProfilerPanel.instance()}),i.ActionRegistration.registerActionExtension({actionId:"profiler.js-toggle-recording",category:i.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,title:r(o.startStopRecording),iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes(){return e=e=>[e.ProfilesPanel.JSProfilerPanel],void 0===l?[]:e(l);var e},loadActionDelegate:async()=>(await s()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),category:i.ActionRegistration.ActionCategory.PERFORMANCE,title:r(o.showRecentTimelineSessions),contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:i.ActionRegistration.ActionCategory.PERFORMANCE,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),options:[{value:!0,title:r(o.record)},{value:!1,title:r(o.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),i.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>g((e=>[e.TimelinePanel.TimelinePanel])),category:i.ActionRegistration.ActionCategory.PERFORMANCE,title:r(o.startProfilingAndReloadPage),loadActionDelegate:async()=>(await c()).TimelinePanel.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}]});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../../ui/legacy/legacy.js";import*as t from"../../core/i18n/i18n.js";import*as n from"../../ui/lit-html/lit-html.js";const i=new CSSStyleSheet;i.replaceSync('.rn-welcome-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:16px;text-align:center;background-color:var(--color-background-elevation-0)}.rn-welcome-header{display:flex;align-items:center;margin-bottom:16px}.rn-welcome-icon{width:30px;height:30px;border-radius:4px;margin-right:12px}.rn-welcome-title{font-size:20px;color:var(--color-text-primary)}.rn-welcome-tagline{margin-bottom:24px;font-size:1rem;line-height:1.3;color:var(--color-text-secondary)}.rn-welcome-links{display:flex;align-items:center}.rn-welcome-links > .devtools-link{position:relative;margin:0 16px;font-size:14px}.rn-welcome-links > .devtools-link:not(:last-child)::after{content:"";position:absolute;right:-16px;height:16px;border-right:1px solid var(--color-details-hairline)}\n/*# sourceURL=rnWelcome.css */\n');const o={debuggerBrandName:"React Native JS Inspector",welcomeMessage:"Welcome to debugging in React Native",docsLabel:"Debugging docs",whatsNewLabel:"What's new"},{render:r,html:l}=n,s=t.i18n.registerUIStrings("panels/rn_welcome/RNWelcome.ts",o),c=t.i18n.getLocalizedString.bind(void 0,s);let a;class d extends e.Widget.VBox{static instance(e={forceNew:null}){const{forceNew:t}=e;return a&&!t||(a=new d),a}constructor(){super(!0,!0)}wasShown(){super.wasShown(),this.registerCSSFiles([i]),this.render(),e.InspectorView.InspectorView.instance().showDrawer(!0)}render(){const e=new URL("../../Images/react_native/welcomeIcon.png",import.meta.url).toString();r(l` <div class="rn-welcome-panel"> <div class="rn-welcome-header"> <img class="rn-welcome-icon" src="${e}" role="presentation"> <div class="rn-welcome-title"> ${c(o.debuggerBrandName)} </div> </div> <div class="rn-welcome-tagline"> ${c(o.welcomeMessage)} </div> <div class="rn-welcome-links"> <x-link class="devtools-link" href="https://reactnative.dev/docs/next/debugging"> ${c(o.docsLabel)} </x-link> <x-link class="devtools-link" href="https://reactnative.dev/blog/tags/debugging"> ${c(o.whatsNewLabel)} </x-link> </div> </div> `,this.contentElement,{host:this})}}var g=Object.freeze({__proto__:null,RNWelcomeImpl:d});export{g as RNWelcome};
import*as e from"../../ui/legacy/legacy.js";import*as r from"../../core/i18n/i18n.js";import*as t from"../../ui/lit-html/lit-html.js";const o=new CSSStyleSheet;o.replaceSync('.rn-welcome-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:16px;text-align:center;background-color:var(--color-background-elevation-0)}.rn-welcome-header{display:flex;align-items:center;margin-bottom:16px}.rn-welcome-icon{width:30px;height:30px;border-radius:4px;margin-right:12px}.rn-welcome-title{font-size:20px;color:var(--color-text-primary)}.rn-welcome-title-accessory{margin-left:12px;padding:4px 8px;border-radius:4px;background-color:var(--color-purple-bright);font-size:12px;color:var(--color-on-primary)}.rn-welcome-tagline{margin-bottom:24px;font-size:1rem;line-height:1.3;color:var(--color-text-secondary)}.rn-welcome-links{display:flex;align-items:center}.rn-welcome-links > .devtools-link{position:relative;margin:0 16px;font-size:14px}.rn-welcome-links > .devtools-link:not(:last-child)::after{content:"";position:absolute;right:-16px;height:16px;border-right:1px solid var(--color-details-hairline)}\n/*# sourceURL=rnWelcome.css */\n');const n={debuggerBrandName:"React Native JS Inspector",techPreviewLabel:"Technology Preview",welcomeMessage:"Welcome to debugging in React Native",docsLabel:"Debugging docs",whatsNewLabel:"What's new"},{render:i,html:l}=t,s=r.i18n.registerUIStrings("panels/rn_welcome/RNWelcome.ts",n),c=r.i18n.getLocalizedString.bind(void 0,s);let a;class d extends e.Widget.VBox{static instance(e={forceNew:null}){const{forceNew:r}=e;return a&&!r||(a=new d),a}constructor(){super(!0,!0)}wasShown(){super.wasShown(),this.registerCSSFiles([o]),this.render(),e.InspectorView.InspectorView.instance().showDrawer(!0)}render(){const e=new URL("../../Images/react_native/welcomeIcon.png",import.meta.url).toString();i(l` <div class="rn-welcome-panel"> <div class="rn-welcome-header"> <img class="rn-welcome-icon" src="${e}" role="presentation"> <div class="rn-welcome-title"> ${c(n.debuggerBrandName)} </div> <div class="rn-welcome-title-accessory"> ${c(n.techPreviewLabel)} </div> </div> <div class="rn-welcome-tagline"> ${c(n.welcomeMessage)} </div> <div class="rn-welcome-links"> <x-link class="devtools-link" href="https://reactnative.dev/docs/debugging"> ${c(n.docsLabel)} </x-link> <x-link class="devtools-link" href="https://reactnative.dev/blog"> ${c(n.whatsNewLabel)} </x-link> </div> </div> `,this.contentElement,{host:this})}}var m=Object.freeze({__proto__:null,RNWelcomeImpl:d});export{m as RNWelcome};
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/rn_inspector/rn_inspector.js"></script>
<body class="undocked" id="-blink-dev-tools">
@@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>DevTools</title>
<title>DevTools (React Native)</title>
<style>
@media (prefers-color-scheme: dark) {
body {
@@ -16,5 +16,6 @@
</style>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="./Images/favicon.ico">
<script type="module" src="./entrypoints/worker_app/worker_app.js"></script>
<body class="undocked" id="-blink-dev-tools">
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.73.0",
"version": "0.73.3",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
+5 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.73.1",
"version": "0.73.8",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,14 +23,16 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "^0.73.0",
"@react-native/debugger-frontend": "0.73.3",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^1.0.0",
"connect": "^3.6.5",
"debug": "^2.2.0",
"node-fetch": "^2.2.0",
"open": "^7.0.3",
"serve-static": "^1.13.1",
"temp-dir": "^2.0.0"
"temp-dir": "^2.0.0",
"ws": "^6.2.2"
},
"engines": {
"node": ">=18"
@@ -20,6 +20,7 @@ import connect from 'connect';
import path from 'path';
// $FlowFixMe[untyped-import] TODO: type serve-static
import serveStaticMiddleware from 'serve-static';
import deprecated_openFlipperMiddleware from './middleware/deprecated_openFlipperMiddleware';
import openDebuggerMiddleware from './middleware/openDebuggerMiddleware';
import InspectorProxy from './inspector-proxy/InspectorProxy';
import DefaultBrowserLauncher from './utils/DefaultBrowserLauncher';
@@ -59,6 +60,13 @@ type Options = $ReadOnly<{
* This is an unstable API with no semver guarantees.
*/
unstable_experiments?: ExperimentsConfig,
/**
* An interface for using a modified inspector proxy implementation.
*
* This is an unstable API with no semver guarantees.
*/
unstable_InspectorProxy?: Class<InspectorProxy>,
}>;
type DevMiddlewareAPI = $ReadOnly<{
@@ -73,10 +81,12 @@ export default function createDevMiddleware({
unstable_browserLauncher = DefaultBrowserLauncher,
unstable_eventReporter,
unstable_experiments: experimentConfig = {},
unstable_InspectorProxy,
}: Options): DevMiddlewareAPI {
const experiments = getExperiments(experimentConfig);
const inspectorProxy = new InspectorProxy(
const InspectorProxyClass = unstable_InspectorProxy ?? InspectorProxy;
const inspectorProxy = new InspectorProxyClass(
projectRoot,
serverBaseUrl,
unstable_eventReporter,
@@ -86,14 +96,18 @@ export default function createDevMiddleware({
const middleware = connect()
.use(
'/open-debugger',
openDebuggerMiddleware({
serverBaseUrl,
inspectorProxy,
browserLauncher: unstable_browserLauncher,
eventReporter: unstable_eventReporter,
experiments,
logger,
}),
experiments.enableNewDebugger
? openDebuggerMiddleware({
serverBaseUrl,
inspectorProxy,
browserLauncher: unstable_browserLauncher,
eventReporter: unstable_eventReporter,
experiments,
logger,
})
: deprecated_openFlipperMiddleware({
logger,
}),
)
.use(
'/debugger-frontend',
@@ -111,7 +125,8 @@ export default function createDevMiddleware({
function getExperiments(config: ExperimentsConfig): Experiments {
return {
enableCustomDebuggerFrontend: config.enableCustomDebuggerFrontend ?? false,
enableNewDebugger: config.enableNewDebugger ?? false,
enableOpenDebuggerRedirect: config.enableOpenDebuggerRedirect ?? false,
enableNetworkInspector: config.enableNetworkInspector ?? false,
};
}
@@ -13,3 +13,6 @@ export {default as createDevMiddleware} from './createDevMiddleware';
export type {BrowserLauncher, LaunchedBrowser} from './types/BrowserLauncher';
export type {EventReporter, ReportableEvent} from './types/EventReporter';
export {default as unstable_InspectorProxy} from './inspector-proxy/InspectorProxy';
export {default as unstable_Device} from './inspector-proxy/Device';
@@ -94,12 +94,13 @@ export default class InspectorProxy implements InspectorProxyQueries {
response: ServerResponse,
next: (?Error) => mixed,
) {
const pathname = url.parse(request.url).pathname;
if (
request.url === PAGES_LIST_JSON_URL ||
request.url === PAGES_LIST_JSON_URL_2
pathname === PAGES_LIST_JSON_URL ||
pathname === PAGES_LIST_JSON_URL_2
) {
this._sendJsonResponse(response, this.getPageDescriptions());
} else if (request.url === PAGES_LIST_JSON_VERSION_URL) {
} else if (pathname === PAGES_LIST_JSON_VERSION_URL) {
this._sendJsonResponse(response, {
Browser: 'Mobile JavaScript',
'Protocol-Version': '1.1',
@@ -0,0 +1,60 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {NextHandleFunction} from 'connect';
import type {IncomingMessage, ServerResponse} from 'http';
import type {Logger} from '../types/Logger';
import open from 'open';
const FLIPPER_SELF_CONNECT_URL =
'flipper://null/Hermesdebuggerrn?device=React%20Native';
type Options = $ReadOnly<{
logger?: Logger,
}>;
/**
* Open the legacy Flipper debugger (Hermes).
*
* @deprecated This replicates the pre-0.73 workflow of opening Flipper via the
* `flipper://` URL scheme, failing if Flipper is not installed locally. This
* flow will be removed in a future version.
*/
export default function deprecated_openFlipperMiddleware({
logger,
}: Options): NextHandleFunction {
return async (
req: IncomingMessage,
res: ServerResponse,
next: (err?: Error) => void,
) => {
if (req.method === 'POST') {
logger?.info('Launching JS debugger...');
try {
logger?.warn(
'Attempting to debug JS in Flipper (deprecated). This requires ' +
'Flipper to be installed on your system to handle the ' +
"'flipper://' URL scheme.",
);
await open(FLIPPER_SELF_CONNECT_URL);
res.end();
} catch (e) {
logger?.error(
'Error launching Flipper: ' + e.message ?? 'Unknown error',
);
res.writeHead(500);
res.end();
}
}
};
}
@@ -64,6 +64,7 @@ export default function openDebuggerMiddleware({
app =>
app.title === 'React Native Experimental (Improved Chrome Reloads)',
);
let target;
const launchType: 'launch' | 'redirect' =
@@ -72,7 +73,7 @@ export default function openDebuggerMiddleware({
if (typeof appId === 'string') {
logger?.info(
(launchType === 'launch' ? 'Launching' : 'Redirecting to') +
' JS debugger...',
' JS debugger (experimental)...',
);
target = targets.find(_target => _target.description === appId);
} else {
@@ -106,9 +107,9 @@ export default function openDebuggerMiddleware({
appId,
await browserLauncher.launchDebuggerAppWindow(
getDevToolsFrontendUrl(
experiments,
target.webSocketDebuggerUrl,
serverBaseUrl,
experiments,
),
),
);
@@ -117,10 +118,10 @@ export default function openDebuggerMiddleware({
case 'redirect':
res.writeHead(302, {
Location: getDevToolsFrontendUrl(
experiments,
target.webSocketDebuggerUrl,
// Use a relative URL.
'',
experiments,
),
});
res.end();
@@ -10,10 +10,11 @@
export type Experiments = $ReadOnly<{
/**
* Enables the use of the custom debugger frontend (@react-native/debugger-frontend)
* in the /open-debugger endpoint.
* Enables the new JS debugger launch flow and custom debugger frontend
* (@react-native/debugger-frontend). When disabled, /open-debugger will
* trigger the legacy Flipper connection flow.
*/
enableCustomDebuggerFrontend: boolean,
enableNewDebugger: boolean,
/**
* Enables the handling of GET requests in the /open-debugger endpoint,
@@ -22,6 +23,11 @@ export type Experiments = $ReadOnly<{
* interface.
*/
enableOpenDebuggerRedirect: boolean,
/**
* Enables the Network panel when launching the custom debugger frontend.
*/
enableNetworkInspector: boolean,
}>;
export type ExperimentsConfig = Partial<Experiments>;
@@ -12,37 +12,22 @@
import type {Experiments} from '../types/Experiments';
/**
* The Chrome DevTools frontend revision to use. This should be set to the
* latest version known to be compatible with Hermes.
*
* Revision should be the full identifier from:
* https://chromium.googlesource.com/chromium/src.git
*/
const DEVTOOLS_FRONTEND_REV = 'd9568d04d7dd79269c5a655d7ada69650c5a8336'; // Chrome 100.0.4896.75
/**
* Construct the URL to Chrome DevTools connected to a given debugger target.
* Get the DevTools frontend URL to debug a given React Native CDP target.
*/
export default function getDevToolsFrontendUrl(
experiments: Experiments,
webSocketDebuggerUrl: string,
devServerUrl: string,
experiments: Experiments,
): string {
const scheme = new URL(webSocketDebuggerUrl).protocol.slice(0, -1);
const webSocketUrlWithoutProtocol = webSocketDebuggerUrl.replace(
/^wss?:\/\//,
'',
const appUrl = `${devServerUrl}/debugger-frontend/rn_inspector.html`;
const webSocketUrlWithoutProtocol = encodeURIComponent(
webSocketDebuggerUrl.replace(/^wss?:\/\//, ''),
);
if (experiments.enableCustomDebuggerFrontend) {
const urlBase = `${devServerUrl}/debugger-frontend/rn_inspector.html`;
return `${urlBase}?${scheme}=${encodeURIComponent(
webSocketUrlWithoutProtocol,
)}&sources.hide_add_folder=true`;
}
const devToolsUrl = `${appUrl}?${scheme}=${webSocketUrlWithoutProtocol}&sources.hide_add_folder=true`;
const urlBase = `https://chrome-devtools-frontend.appspot.com/serve_rev/@${DEVTOOLS_FRONTEND_REV}/devtools_app.html`;
return `${urlBase}?panel=console&${scheme}=${encodeURIComponent(
webSocketUrlWithoutProtocol,
)}`;
return experiments.enableNetworkInspector
? `${devToolsUrl}&unstable_enableNetworkPanel=true`
: devToolsUrl;
}
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.73.0",
"version": "0.73.2",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.20.0",
"@babel/eslint-parser": "^7.20.0",
"@react-native/eslint-plugin": "^0.73.0",
"@react-native/eslint-plugin": "0.73.1",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.73.0",
"version": "0.73.1",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
@@ -9,7 +9,12 @@
"directory": "packages/eslint-plugin-react-native"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/eslint-plugin-react-native#readme",
"keywords": ["eslint", "rules", "eslint-config", "react-native"],
"keywords": [
"eslint",
"rules",
"eslint-config",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
+10 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.73.0",
"version": "0.73.3",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -9,7 +9,14 @@
"directory": "packages/eslint-plugin-specs"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/eslint-plugin-specs#readme",
"keywords": ["eslint", "rules", "react-native", "native-modules", "components", "specs"],
"keywords": [
"eslint",
"rules",
"react-native",
"native-modules",
"components",
"specs"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
@@ -24,7 +31,7 @@
"@babel/eslint-parser": "^7.20.0",
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
"@babel/preset-flow": "^7.20.0",
"@react-native/codegen": "*",
"@react-native/codegen": "0.73.3",
"flow-parser": "^0.206.0",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
+10 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.73.0",
"version": "0.73.5",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -9,16 +9,20 @@
"directory": "packages/metro-config"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/metro-config#readme",
"keywords": ["metro", "config", "react-native"],
"keywords": [
"metro",
"config",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
},
"exports": "./index.js",
"dependencies": {
"@react-native/metro-babel-transformer": "^0.73.11",
"@react-native/js-polyfills": "^0.73.0",
"metro-config": "0.79.1",
"metro-runtime": "0.79.1"
"@react-native/metro-babel-transformer": "0.73.15",
"@react-native/js-polyfills": "0.73.1",
"metro-config": "^0.80.3",
"metro-runtime": "^0.80.3"
}
}
+8 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.73.0",
"version": "0.73.2",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
@@ -9,9 +9,11 @@
"directory": "packages/normalize-color"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/normalize-color#readme",
"keywords": ["color", "normalization", "normalize-colors", "react-native"],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
}
"keywords": [
"color",
"normalization",
"normalize-colors",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues"
}
+8 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.73.0",
"version": "0.73.1",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -9,7 +9,13 @@
"directory": "packages/polyfills"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/polyfills#readme",
"keywords": ["polyfill", "polyfills", "js", "js-polyfills", "react-native"],
"keywords": [
"polyfill",
"polyfills",
"js",
"js-polyfills",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.73.16",
"version": "0.73.21",
"description": "Babel preset for React Native applications",
"main": "src/index.js",
"repository": {
@@ -53,7 +53,7 @@
"@babel/plugin-transform-typescript": "^7.5.0",
"@babel/plugin-transform-unicode-regex": "^7.0.0",
"@babel/template": "^7.0.0",
"@react-native/babel-plugin-codegen": "*",
"@react-native/babel-plugin-codegen": "0.73.4",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
},
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.73.11",
"version": "0.73.15",
"description": "Babel transformer for React Native applications.",
"main": "src/index.js",
"repository": {
@@ -16,7 +16,7 @@
"license": "MIT",
"dependencies": {
"@babel/core": "^7.20.0",
"@react-native/babel-preset": "*",
"@react-native/babel-preset": "0.73.21",
"hermes-parser": "0.15.0",
"nullthrows": "^1.1.1"
},
@@ -19,7 +19,7 @@
"prepare": "yarn run build"
},
"dependencies": {
"@react-native/codegen": "*"
"@react-native/codegen": "0.73.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
@@ -294,7 +294,7 @@ export const __INTERNAL_VIEW_CONFIG = {
uiViewClassName: 'EventPropsNativeComponentView',
bubblingEventTypes: {
paperDirectName: {
topPaperDirectName: {
phasedRegistrationNames: {
captured: 'onChangeCapture',
bubbled: 'onChange',
@@ -308,7 +308,7 @@ export const __INTERNAL_VIEW_CONFIG = {
},
},
paperBubblingName: {
topPaperBubblingName: {
phasedRegistrationNames: {
captured: 'onEventBubblingWithPaperNameCapture',
bubbled: 'onEventBubblingWithPaperName',
@@ -321,11 +321,11 @@ export const __INTERNAL_VIEW_CONFIG = {
registrationName: 'onEventDirect',
},
paperDirectName: {
topPaperDirectName: {
registrationName: 'onEventDirectWithPaperName',
},
paperBubblingName: {
topPaperBubblingName: {
registrationName: 'onOrientationChange',
},
},
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.73.0",
"version": "0.73.3",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -31,7 +31,10 @@
"dependencies": {
"@babel/parser": "^7.20.0",
"flow-parser": "^0.206.0",
"glob": "^7.1.1",
"invariant": "^2.2.4",
"jscodeshift": "^0.14.0",
"mkdirp": "^0.5.1",
"nullthrows": "^1.1.1"
},
"devDependencies": {
@@ -46,10 +49,7 @@
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"chalk": "^4.0.0",
"glob": "^7.1.1",
"invariant": "^2.2.4",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"prettier": "2.8.8",
"rimraf": "^3.0.2"
},
@@ -197,7 +197,7 @@ function generateBubblingEventInfo(
) {
return j.property(
'init',
j.identifier(nameOveride || normalizeInputEventName(event.name)),
j.identifier(normalizeInputEventName(nameOveride || event.name)),
j.objectExpression([
j.property(
'init',
@@ -221,7 +221,7 @@ function generateDirectEventInfo(
) {
return j.property(
'init',
j.identifier(nameOveride || normalizeInputEventName(event.name)),
j.identifier(normalizeInputEventName(nameOveride || event.name)),
j.objectExpression([
j.property(
'init',
@@ -468,7 +468,7 @@ export const __INTERNAL_VIEW_CONFIG = {
uiViewClassName: 'RCTInterfaceOnlyComponent',
bubblingEventTypes: {
paperChange: {
topPaperChange: {
phasedRegistrationNames: {
captured: 'onChangeCapture',
bubbled: 'onChange',
@@ -477,7 +477,7 @@ export const __INTERNAL_VIEW_CONFIG = {
},
directEventTypes: {
paperDirectChange: {
topPaperDirectChange: {
registrationName: 'onDirectChange',
},
},
@@ -26,6 +26,10 @@ gradlePlugin {
id = "com.facebook.react"
implementationClass = "com.facebook.react.ReactPlugin"
}
create("reactrootproject") {
id = "com.facebook.react.rootproject"
implementationClass = "com.facebook.react.ReactRootProjectPlugin"
}
}
}
@@ -66,6 +70,7 @@ tasks.withType<KotlinCompile>().configureEach {
apiVersion = "1.5"
// See comment above on JDK 11 support
jvmTarget = "11"
allWarningsAsErrors = true
}
}
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.73.0",
"version": "0.73.4",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -9,7 +9,11 @@
"directory": "packages/react-native-gradle-plugin"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-gradle-plugin#readme",
"keywords": ["gradle", "plugin", "react-native"],
"keywords": [
"gradle",
"plugin",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
@@ -12,8 +12,10 @@ import com.android.build.gradle.internal.tasks.factory.dependsOn
import com.facebook.react.internal.PrivateReactExtension
import com.facebook.react.tasks.GenerateCodegenArtifactsTask
import com.facebook.react.tasks.GenerateCodegenSchemaTask
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFields
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForApp
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForLibraries
import com.facebook.react.utils.AgpConfiguratorUtils.configureDevPorts
import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries
import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap
import com.facebook.react.utils.DependencyUtils.configureDependencies
import com.facebook.react.utils.DependencyUtils.configureRepositories
@@ -64,9 +66,10 @@ class ReactPlugin : Plugin<Project> {
}
configureReactNativeNdk(project, extension)
configureBuildConfigFields(project, extension)
configureBuildConfigFieldsForApp(project, extension)
configureDevPorts(project)
configureBackwardCompatibilityReactMap(project)
configureJavaToolChains(project)
project.extensions.getByType(AndroidComponentsExtension::class.java).apply {
onVariants(selector().all()) { variant ->
@@ -77,12 +80,11 @@ class ReactPlugin : Plugin<Project> {
}
// Library Only Configuration
configureBuildConfigFieldsForLibraries(project)
configureNamespaceForLibraries(project)
project.pluginManager.withPlugin("com.android.library") {
configureCodegen(project, extension, rootExtension, isLibrary = true)
}
// Library and App Configurations
configureJavaToolChains(project)
}
private fun checkJvmVersion(project: Project) {
@@ -0,0 +1,30 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react
import org.gradle.api.Plugin
import org.gradle.api.Project
/**
* Gradle plugin applied to the `android/build.gradle` file.
*
* This plugin allows to specify project wide configurations that can be applied to both apps and
* libraries before they're evaluated.
*/
class ReactRootProjectPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.subprojects {
// As the :app project (i.e. ReactPlugin) configures both namespaces and JVM toolchains
// for libraries, its evaluation must happen before the libraries' evaluation.
// Eventually the configuration of namespace/JVM toolchain can be moved inside this plugin.
if (it.path != ":app") {
it.evaluationDependsOn(":app")
}
}
}
}
@@ -23,6 +23,7 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
val targetName = variant.name.capitalizeCompat()
val targetPath = variant.name
val buildDir = this.layout.buildDirectory.get().asFile
// Resources: generated/assets/react/<variant>/index.android.bundle
val resourcesDir = File(buildDir, "generated/res/react/$targetPath")
// Bundle: generated/assets/react/<variant>/index.android.bundle
@@ -8,17 +8,22 @@
package com.facebook.react.utils
import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.gradle.LibraryExtension
import com.facebook.react.ReactExtension
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
import java.io.File
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.AppliedPlugin
import org.w3c.dom.Element
@Suppress("UnstableApiUsage")
internal object AgpConfiguratorUtils {
fun configureBuildConfigFields(project: Project, extension: ReactExtension) {
fun configureBuildConfigFieldsForApp(project: Project, extension: ReactExtension) {
val action =
Action<AppliedPlugin> {
project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext ->
@@ -35,6 +40,16 @@ internal object AgpConfiguratorUtils {
project.pluginManager.withPlugin("com.android.library", action)
}
fun configureBuildConfigFieldsForLibraries(appProject: Project) {
appProject.rootProject.allprojects { subproject ->
subproject.pluginManager.withPlugin("com.android.library") {
subproject.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext ->
ext.buildFeatures.buildConfig = true
}
}
}
}
fun configureDevPorts(project: Project) {
val devServerPort =
project.properties["reactNativeDevServerPort"]?.toString() ?: DEFAULT_DEV_SERVER_PORT
@@ -53,6 +68,43 @@ internal object AgpConfiguratorUtils {
project.pluginManager.withPlugin("com.android.application", action)
project.pluginManager.withPlugin("com.android.library", action)
}
fun configureNamespaceForLibraries(appProject: Project) {
appProject.rootProject.allprojects { subproject ->
subproject.pluginManager.withPlugin("com.android.library") {
subproject.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext ->
if (ext.namespace == null) {
val android = subproject.extensions.getByType(LibraryExtension::class.java)
val manifestFile = android.sourceSets.getByName("main").manifest.srcFile
manifestFile
.takeIf { it.exists() }
?.let { file ->
getPackageNameFromManifest(file)?.let { packageName ->
ext.namespace = packageName
}
}
}
}
}
}
}
}
const val DEFAULT_DEV_SERVER_PORT = "8081"
fun getPackageNameFromManifest(manifest: File): String? {
val factory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance()
val builder: DocumentBuilder = factory.newDocumentBuilder()
try {
val xmlDocument = builder.parse(manifest)
val manifestElement = xmlDocument.getElementsByTagName("manifest").item(0) as? Element
val packageName = manifestElement?.getAttribute("package")
return if (packageName.isNullOrEmpty()) null else packageName
} catch (e: Exception) {
return null
}
}
@@ -0,0 +1,65 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.utils
import java.io.File
import org.junit.Assert.*
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
class AgpConfiguratorUtilsTest {
@get:Rule val tempFolder = TemporaryFolder()
@Test
fun getPackageNameFromManifest_withEmptyFile_returnsNull() {
val mainFolder = tempFolder.newFolder("awesome-module/src/main/")
val manifest = File(mainFolder, "AndroidManifest.xml").apply { writeText("") }
val actual = getPackageNameFromManifest(manifest)
assertNull(actual)
}
@Test
fun getPackageNameFromManifest_withMissingPackage_returnsNull() {
val mainFolder = tempFolder.newFolder("awesome-module/src/main/")
val manifest =
File(mainFolder, "AndroidManifest.xml").apply {
writeText(
// language=xml
"""
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
"""
.trimIndent())
}
val actual = getPackageNameFromManifest(manifest)
assertNull(actual)
}
@Test
fun getPackageNameFromManifest_withPackage_returnsPackage() {
val mainFolder = tempFolder.newFolder("awesome-module/src/main/")
val manifest =
File(mainFolder, "AndroidManifest.xml").apply {
writeText(
// language=xml
"""
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react" >
</manifest>
"""
.trimIndent())
}
val actual = getPackageNameFromManifest(manifest)
assertNotNull(actual)
assertEquals("com.facebook.react", actual)
}
}
@@ -30,7 +30,7 @@ function createAnimatedStyle(
const animatedStyles: any = {};
for (const key in style) {
const value = style[key];
if (key === 'transform') {
if (value != null && key === 'transform') {
animatedStyles[key] =
ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
? new AnimatedObject(value)
@@ -100,8 +100,6 @@
* By default, it assigns the rootView to the view property of the rootViewController
* If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
* For example: UISplitViewController requires `setViewController(_:for:)`
*
* @return: void
*/
- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
@@ -49,6 +49,19 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
#endif
static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabricEnabled)
{
#ifdef RCT_NEW_ARCH_ENABLED
NSMutableDictionary *mutableProps = [initialProps mutableCopy] ?: [NSMutableDictionary new];
// Hardcoding the Concurrent Root as it it not recommended to
// have the concurrentRoot turned off when Fabric is enabled.
mutableProps[kRNConcurrentRoot] = @(isFabricEnabled);
return mutableProps;
#else
return initialProps;
#endif
}
@interface RCTAppDelegate () <RCTCxxBridgeDelegate> {
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
}
@@ -76,10 +89,13 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
{
BOOL enableTM = NO;
BOOL enableBridgeless = NO;
BOOL fabricEnabled = NO;
#if RCT_NEW_ARCH_ENABLED
enableTM = self.turboModuleEnabled;
enableBridgeless = self.bridgelessEnabled;
fabricEnabled = [self fabricEnabled];
#endif
NSDictionary *initProps = updateInitialProps([self prepareInitialProps], fabricEnabled);
RCTAppSetupPrepareApp(application, enableTM);
@@ -87,11 +103,17 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
if (enableBridgeless) {
#if RCT_NEW_ARCH_ENABLED
// Enable native view config interop only if both bridgeless mode and Fabric is enabled.
RCTSetUseNativeViewConfigsInBridgelessMode(fabricEnabled);
// Enable TurboModule interop by default in Bridgeless mode
RCTEnableTurboModuleInterop(YES);
RCTEnableTurboModuleInteropBridgeProxy(YES);
[self createReactHost];
[self unstable_registerLegacyComponents];
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName
initialProperties:launchOptions];
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName initialProperties:initProps];
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
initWithSurface:surface
@@ -111,7 +133,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
[self unstable_registerLegacyComponents];
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
#endif
NSDictionary *initProps = [self prepareInitialProps];
rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
@@ -133,15 +155,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
- (NSDictionary *)prepareInitialProps
{
NSMutableDictionary *initProps = self.initialProps ? [self.initialProps mutableCopy] : [NSMutableDictionary new];
#ifdef RCT_NEW_ARCH_ENABLED
// Hardcoding the Concurrent Root as it it not recommended to
// have the concurrentRoot turned off when Fabric is enabled.
initProps[kRNConcurrentRoot] = @([self fabricEnabled]);
#endif
return initProps;
return self.initialProps;
}
- (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions
@@ -185,7 +199,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
{
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
}
#pragma mark - RCTCxxBridgeDelegate
@@ -21,7 +21,6 @@ folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
is_new_arch_enabled = ENV["RCT_NEW_ARCH_ENABLED"] == "1"
use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
new_arch_enabled_flag = (is_new_arch_enabled ? " -DRCT_NEW_ARCH_ENABLED" : "")
is_fabric_enabled = is_new_arch_enabled || ENV["RCT_FABRIC_ENABLED"]
@@ -43,21 +42,7 @@ header_search_paths = [
].concat(use_hermes ? [
"$(PODS_ROOT)/Headers/Public/React-hermes",
"$(PODS_ROOT)/Headers/Public/hermes-engine"
] : []).concat(use_frameworks ? [
"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-RuntimeApple/React_RuntimeApple.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-RuntimeCore/React_RuntimeCore.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-runtimescheduler/React_runtimescheduler.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/",
] : []).map{|p| "\"#{p}\""}.join(" ")
] : [])
Pod::Spec.new do |s|
s.name = "React-RCTAppDelegate"
@@ -87,18 +72,19 @@ Pod::Spec.new do |s|
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
s.dependency "React-RCTNetwork"
s.dependency "React-RCTImage"
s.dependency "React-NativeModulesApple"
s.dependency "React-CoreModules"
s.dependency "React-nativeconfig"
s.dependency "React-runtimescheduler"
s.dependency "React-RCTFabric"
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
add_dependency(s, "React-runtimescheduler")
add_dependency(s, "React-RCTFabric", :framework_name => "RCTFabric")
if is_new_arch_enabled
s.dependency "React-RuntimeCore"
s.dependency "React-RuntimeApple"
add_dependency(s, "React-RuntimeCore")
add_dependency(s, "React-RuntimeApple")
if use_hermes
s.dependency "React-RuntimeHermes"
end
@@ -111,21 +97,25 @@ Pod::Spec.new do |s|
end
if is_new_arch_enabled
s.dependency "React-Fabric"
s.dependency "React-graphics"
s.dependency "React-utils"
s.dependency "React-debug"
s.dependency "React-rendererdebug"
add_dependency(s, "React-Fabric", :additional_framework_paths => ["react/renderer/components/view/platform/cxx"])
add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
add_dependency(s, "React-utils")
add_dependency(s, "React-debug")
add_dependency(s, "React-rendererdebug")
rel_path_from_pods_root_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(Pod::Config.instance.installation_root)
rel_path_from_pods_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(File.join(Pod::Config.instance.installation_root, 'Pods'))
s.script_phases = {
:name => "Generate Legacy Components Interop",
:script => "
WITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"
source $WITH_ENVIRONMENT
${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{ENV['APP_PATH']} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{rel_path_from_pods_to_app} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
",
:execution_position => :before_compile,
:input_files => ["#{ENV['APP_PATH']}/react-native.config.js"],
:input_files => ["#{rel_path_from_pods_root_to_app}/react-native.config.js"],
:output_files => ["${REACT_NATIVE_PATH}/Libraries/AppDelegate/RCTLegacyInteropComponents.mm"],
}
end
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTBlob"
s.version = version
@@ -52,12 +44,14 @@ Pod::Spec.new do |s|
}
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTBlobHeaders", version
s.dependency "React-Core/RCTWebSocket", version
s.dependency "React-RCTNetwork", version
s.dependency "React-jsi"
s.dependency "React-Core/RCTBlobHeaders"
s.dependency "React-Core/RCTWebSocket"
s.dependency "React-RCTNetwork"
add_dependency(s, "React-Codegen")
add_dependency(s, "React-NativeModulesApple")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
@@ -203,6 +203,10 @@ class TouchableBounce extends React.Component<Props, State> {
this.state.pressability.configure(this._createPressabilityConfig());
}
componentDidMount(): mixed {
this.state.pressability.configure(this._createPressabilityConfig());
}
componentWillUnmount(): void {
this.state.pressability.reset();
}
@@ -363,6 +363,7 @@ class TouchableHighlight extends React.Component<Props, State> {
componentDidMount(): void {
this._isMounted = true;
this.state.pressability.configure(this._createPressabilityConfig());
}
componentDidUpdate(prevProps: Props, prevState: State) {
@@ -339,6 +339,10 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
this.state.pressability.configure(this._createPressabilityConfig());
}
componentDidMount(): mixed {
this.state.pressability.configure(this._createPressabilityConfig());
}
componentWillUnmount(): void {
this.state.pressability.reset();
}
@@ -314,6 +314,10 @@ class TouchableOpacity extends React.Component<Props, State> {
}
}
componentDidMount(): void {
this.state.pressability.configure(this._createPressabilityConfig());
}
componentWillUnmount(): void {
this.state.pressability.reset();
}
@@ -189,6 +189,10 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
this.state.pressability.configure(createPressabilityConfig(this.props));
}
componentDidMount(): mixed {
this.state.pressability.configure(createPressabilityConfig(this.props));
}
componentWillUnmount(): void {
this.state.pressability.reset();
}
+3 -3
View File
@@ -10,8 +10,8 @@
*/
exports.version = {
major: 1000,
minor: 0,
patch: 0,
major: 0,
minor: 73,
patch: 8,
prerelease: null,
};
@@ -40,7 +40,9 @@ exports.checkVersions = function checkVersions(): void {
};
function _formatVersion(
version: (typeof Platform)['constants']['reactNativeVersion'],
version:
| (typeof Platform)['constants']['reactNativeVersion']
| {major: number, minor: number, patch: number, prerelease: ?string},
): string {
return (
`${version.major}.${version.minor}.${version.patch}` +
@@ -22,15 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTImage"
@@ -54,10 +47,13 @@ Pod::Spec.new do |s|
s.framework = ["Accelerate", "UIKit"]
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "RCTTypeSafety", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTImageHeaders", version
s.dependency "React-RCTNetwork", version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTImageHeaders"
s.dependency "React-RCTNetwork"
add_dependency(s, "React-Codegen")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -22,19 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTLinking"
s.version = version
@@ -55,8 +44,11 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
}
s.dependency "React-Codegen", version
s.dependency "React-Core/RCTLinkingHeaders", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
+2 -1
View File
@@ -30,6 +30,7 @@ export type LogData = $ReadOnly<{|
message: Message,
category: Category,
componentStack: ComponentStack,
stack?: string,
|}>;
export type Observer = (
@@ -198,7 +199,7 @@ export function addLog(log: LogData): void {
// otherwise spammy logs would pause rendering.
setImmediate(() => {
try {
const stack = parseErrorStack(errorForStackTrace?.stack);
const stack = parseErrorStack(log.stack ?? errorForStackTrace?.stack);
appendNewLog(
new LogBoxLog({
@@ -1020,6 +1020,54 @@ Please follow the instructions at: fburl.com/rn-remote-assets`,
});
});
it('detects a component stack for ts, tsx, jsx, and js files', () => {
expect(
parseLogBoxLog([
'Some kind of message\n in MyTSComponent (at MyTSXComponent.ts:1)\n in MyTSXComponent (at MyTSCComponent.tsx:1)\n in MyJSXComponent (at MyJSXComponent.jsx:1)\n in MyJSComponent (at MyJSComponent.js:1)',
]),
).toEqual({
componentStack: [
{
content: 'MyTSComponent',
fileName: 'MyTSXComponent.ts',
location: {
column: -1,
row: 1,
},
},
{
content: 'MyTSXComponent',
fileName: 'MyTSCComponent.tsx',
location: {
column: -1,
row: 1,
},
},
{
content: 'MyJSXComponent',
fileName: 'MyJSXComponent.jsx',
location: {
column: -1,
row: 1,
},
},
{
content: 'MyJSComponent',
fileName: 'MyJSComponent.js',
location: {
column: -1,
row: 1,
},
},
],
category: 'Some kind of message',
message: {
content: 'Some kind of message',
substitutions: [],
},
});
});
it('detects a component stack in the first argument (JSC)', () => {
expect(
parseLogBoxLog([
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
if (!s) {
return null;
}
const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
if (!match) {
return null;
}
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTAnimation"
s.version = version
@@ -52,9 +44,11 @@ Pod::Spec.new do |s|
}
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "RCTTypeSafety", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTAnimationHeaders", version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTAnimationHeaders"
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -55,14 +55,20 @@ export function get<Config>(
): HostComponent<Config> {
ReactNativeViewConfigRegistry.register(name, () => {
const {native, strict, verify} = getRuntimeConfig?.(name) ?? {
native: true,
native: !global.RN$Bridgeless,
strict: false,
verify: false,
};
const viewConfig = native
? getNativeComponentAttributes(name)
: createViewConfig(viewConfigProvider());
let viewConfig;
if (native) {
viewConfig = getNativeComponentAttributes(name);
} else {
viewConfig = createViewConfig(viewConfigProvider());
if (viewConfig == null) {
viewConfig = getNativeComponentAttributes(name);
}
}
if (verify) {
const nativeViewConfig = native
@@ -22,20 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",
])
end
Pod::Spec.new do |s|
s.name = "React-RCTNetwork"
s.version = version
@@ -57,9 +45,11 @@ Pod::Spec.new do |s|
s.frameworks = "MobileCoreServices"
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "RCTTypeSafety", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTNetworkHeaders", version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTNetworkHeaders"
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
@@ -22,16 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTPushNotification"
s.version = version
@@ -53,9 +45,11 @@ Pod::Spec.new do |s|
}
s.framework = "UserNotifications"
s.dependency "React-Codegen", version
s.dependency "RCTTypeSafety", version
s.dependency "React-Core/RCTPushNotificationHeaders", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "RCTTypeSafety"
s.dependency "React-Core/RCTPushNotificationHeaders"
s.dependency "React-jsi"
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -13,7 +13,6 @@
import type {RootTag} from '../Types/RootTagTypes';
import {unstable_hasComponent} from '../NativeComponent/NativeComponentRegistryUnstable';
import ReactNativeFeatureFlags from './ReactNativeFeatureFlags';
let cachedConstants = null;
@@ -22,6 +21,10 @@ const errorMessageForMethod = (methodName: string): string =>
methodName +
"' is not available in the new React Native architecture.";
function nativeViewConfigsInBridgelessModeEnabled(): boolean {
return global.RN$LegacyInterop_UIManager_getConstants !== undefined;
}
function getCachedConstants(): Object {
if (!cachedConstants) {
cachedConstants = global.RN$LegacyInterop_UIManager_getConstants();
@@ -31,7 +34,7 @@ function getCachedConstants(): Object {
const UIManagerJS: {[string]: $FlowFixMe} = {
getViewManagerConfig: (viewManagerName: string): mixed => {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode()) {
if (nativeViewConfigsInBridgelessModeEnabled()) {
return getCachedConstants()[viewManagerName];
} else {
console.error(
@@ -46,7 +49,7 @@ const UIManagerJS: {[string]: $FlowFixMe} = {
return unstable_hasComponent(viewManagerName);
},
getConstants: (): Object => {
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode()) {
if (nativeViewConfigsInBridgelessModeEnabled()) {
return getCachedConstants();
} else {
console.error(errorMessageForMethod('getConstants'));
@@ -179,7 +182,7 @@ const UIManagerJS: {[string]: $FlowFixMe} = {
console.error(errorMessageForMethod('dismissPopupMenu')),
};
if (ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode()) {
if (nativeViewConfigsInBridgelessModeEnabled()) {
Object.keys(getCachedConstants()).forEach(viewConfigName => {
UIManagerJS[viewConfigName] = getCachedConstants()[viewConfigName];
});
@@ -54,10 +54,6 @@ export type FeatureFlags = {|
* Enables use of setNativeProps in JS driven animations.
*/
shouldUseSetNativePropsInFabric: () => boolean,
/**
* Enables native view configs in brdgeless mode.
*/
enableNativeViewConfigsInBridgelessMode: () => boolean,
/**
* Enables a hotfix for forcing materialization of views with elevation set.
*/
@@ -74,7 +70,6 @@ const ReactNativeFeatureFlags: FeatureFlags = {
enableAccessToHostTreeInFabric: () => false,
shouldUseAnimatedObjectForTransform: () => false,
shouldUseSetNativePropsInFabric: () => false,
enableNativeViewConfigsInBridgelessMode: () => false,
shouldForceUnflattenForElevation: () => false,
};
@@ -22,19 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"",
])
end
Pod::Spec.new do |s|
s.name = "React-RCTSettings"
s.version = version
@@ -56,9 +45,11 @@ Pod::Spec.new do |s|
}
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "RCTTypeSafety", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTSettingsHeaders", version
s.dependency "RCTTypeSafety"
s.dependency "React-jsi"
s.dependency "React-Core/RCTSettingsHeaders"
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
@@ -158,6 +158,8 @@
[attributedText insertAttributedString:propertyAttributedText atIndex:0];
}
[self postprocessAttributedText:attributedText];
NSAttributedString *newAttributedText;
if (![_previousAttributedText isEqualToAttributedString:attributedText]) {
// We have to follow `set prop` pattern:
@@ -191,6 +193,52 @@
}];
}
- (void)postprocessAttributedText:(NSMutableAttributedString *)attributedText
{
__block CGFloat maximumLineHeight = 0;
[attributedText enumerateAttribute:NSParagraphStyleAttributeName
inRange:NSMakeRange(0, attributedText.length)
options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired
usingBlock:^(NSParagraphStyle *paragraphStyle, __unused NSRange range, __unused BOOL *stop) {
if (!paragraphStyle) {
return;
}
maximumLineHeight = MAX(paragraphStyle.maximumLineHeight, maximumLineHeight);
}];
if (maximumLineHeight == 0) {
// `lineHeight` was not specified, nothing to do.
return;
}
__block CGFloat maximumFontLineHeight = 0;
[attributedText enumerateAttribute:NSFontAttributeName
inRange:NSMakeRange(0, attributedText.length)
options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired
usingBlock:^(UIFont *font, NSRange range, __unused BOOL *stop) {
if (!font) {
return;
}
if (maximumFontLineHeight <= font.lineHeight) {
maximumFontLineHeight = font.lineHeight;
}
}];
if (maximumLineHeight < maximumFontLineHeight) {
return;
}
CGFloat baseLineOffset = maximumLineHeight / 2.0 - maximumFontLineHeight / 2.0;
[attributedText addAttribute:NSBaselineOffsetAttributeName
value:@(baseLineOffset)
range:NSMakeRange(0, attributedText.length)];
}
#pragma mark -
- (NSAttributedString *)measurableAttributedText
@@ -22,18 +22,8 @@ folly_version = '2022.05.16.00'
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\""
]
if ENV["USE_FRAMEWORKS"]
header_search_paths = header_search_paths.concat([
"\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/build/generated/ios\"",
"\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\""
])
end
Pod::Spec.new do |s|
s.name = "React-RCTVibration"
s.version = version
@@ -56,8 +46,10 @@ Pod::Spec.new do |s|
s.frameworks = "AudioToolbox"
s.dependency "RCT-Folly", folly_version
s.dependency "React-Codegen", version
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
s.dependency "React-Core/RCTVibrationHeaders", version
s.dependency "React-jsi"
s.dependency "React-Core/RCTVibrationHeaders"
add_dependency(s, "React-Codegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -10,6 +10,8 @@
import typeof {enable} from 'promise/setimmediate/rejection-tracking';
import LogBox from './LogBox/LogBox';
let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
allRejections: true,
onUnhandled: (id, rejection = {}) => {
@@ -32,19 +34,36 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
? rejection
: JSON.stringify((rejection: $FlowFixMe));
}
// It could although this object is not a standard error, it still has stack information to unwind
// $FlowFixMe ignore types just check if stack is there
if (rejection.stack && typeof rejection.stack === 'string') {
stack = rejection.stack;
}
}
const warning =
`Possible Unhandled Promise Rejection (id: ${id}):\n` +
`${message ?? ''}\n` +
(stack == null ? '' : stack);
console.warn(warning);
const warning = `Possible unhandled promise rejection (id: ${id}):\n${
message ?? ''
}`;
if (__DEV__) {
LogBox.addLog({
level: 'warn',
message: {
content: warning,
substitutions: [],
},
componentStack: [],
stack,
category: 'possible_unhandled_promise_rejection',
});
} else {
console.warn(warning);
}
},
onHandled: id => {
const warning =
`Promise Rejection Handled (id: ${id})\n` +
`Promise rejection handled (id: ${id})\n` +
'This means you can ignore any previous messages of the form ' +
`"Possible Unhandled Promise Rejection (id: ${id}):"`;
`"Possible unhandled promise rejection (id: ${id}):"`;
console.warn(warning);
},
};
+2 -10
View File
@@ -18,11 +18,10 @@ end
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2022.05.16.00'
socket_rocket_version = '0.6.0'
socket_rocket_version = '0.6.1'
boost_compiler_flags = '-Wno-documentation'
use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
header_subspecs = {
'CoreModulesHeaders' => 'React/CoreModules/**/*.h',
@@ -40,8 +39,6 @@ header_subspecs = {
frameworks_search_paths = []
frameworks_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-hermes\"" if use_hermes
frameworks_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon\"" if use_frameworks
frameworks_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric\"" if use_frameworks
header_search_paths = [
"$(PODS_TARGET_SRCROOT)/ReactCommon",
@@ -51,15 +48,10 @@ header_search_paths = [
"$(PODS_ROOT)/RCT-Folly",
"${PODS_ROOT}/Headers/Public/FlipperKit",
"$(PODS_ROOT)/Headers/Public/ReactCommon",
"$(PODS_ROOT)/Headers/Public/React-RCTFabric"
].concat(use_hermes ? [
"$(PODS_ROOT)/Headers/Public/React-hermes",
"$(PODS_ROOT)/Headers/Public/hermes-engine"
] : []).concat(use_frameworks ? [
"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers"
] : []).map{|p| "\"#{p}\""}.join(" ")
] : [])
Pod::Spec.new do |s|
s.name = "React-Core"
@@ -351,6 +351,11 @@ using namespace facebook;
return (RCTUIManager *)_uiManagerProxy;
}
- (RCTBridgeProxy *)object
{
return self;
}
/**
* NSProxy setup
*/
@@ -387,12 +392,14 @@ using namespace facebook;
@implementation RCTUIManagerProxy {
RCTViewRegistry *_viewRegistry;
NSMutableDictionary<NSNumber *, UIView *> *_legacyViewRegistry;
}
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
{
self = [super self];
if (self) {
_viewRegistry = viewRegistry;
_legacyViewRegistry = [NSMutableDictionary new];
}
return self;
}
@@ -404,20 +411,21 @@ using namespace facebook;
{
[self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
cmd:_cmd];
return [_viewRegistry viewForReactTag:reactTag];
return [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
: [_legacyViewRegistry objectForKey:reactTag];
}
- (void)addUIBlock:(RCTViewManagerUIBlock)block
{
[self
logWarning:
@"This method isn't implemented faithfully: the viewRegistry passed to RCTViewManagerUIBlock is nil. Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
@"This method isn't implemented faithfully. Please migrate to RCTViewRegistry if possible: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
cmd:_cmd];
__weak __typeof(self) weakSelf = self;
RCTExecuteOnMainQueue(^{
__typeof(self) strongSelf = weakSelf;
if (strongSelf) {
block((RCTUIManager *)strongSelf, nil);
block((RCTUIManager *)strongSelf, strongSelf->_legacyViewRegistry);
}
});
}

Some files were not shown because too many files have changed in this diff Show More