Compare commits

...
Author SHA1 Message Date
Distiller c68669079a [0.74.0-rc.2] Bump version numbers 2024-03-04 19:42:11 +00:00
Luna Wei 1c1b03d6e8 bumped packages versions
#publish-packages-to-npm&0.74-stable
2024-03-04 11:29:35 -08:00
Luna Wei c7e704a0ef bumped packages versions
#publish-packages-to-npm&0.74-stable
2024-03-04 11:29:15 -08:00
Luna Wei 02d38e4eb5 bumped packages versions
#publish-packages-to-npm&0.74-stable
2024-03-04 11:28:55 -08:00
Luna Wei e063a1b0fb bumped packages versions
#publish-packages-to-npm&0.74-stable
2024-03-04 11:27:34 -08:00
Alex Hunt c09e4dacff Bump package versions
#publish-packages-to-npm&0.74-stable
2024-03-04 12:14:00 +00:00
Alex Hunt 011cb3a8d7 Update Podfile.lock 2024-03-04 12:11:28 +00:00
Riccardo Cipolleschi a5b5f6be78 Rename PopupMenuAndroidNativeComponent.js to PopupMenuAndroidNativeComponent.android.js to fix CI
Summary:
This change renames `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`.

The reason is that, without the suffix, Codegen was reading the NativeComponent spec also for iOS, generating some invalid specs and making RNTester fail.

## Changelog:
[Android][Changed] - Rename `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`

Reviewed By: cortinico, dmytrorykun

Differential Revision: D54199736

fbshipit-source-id: 7fd67c4d38a69fe3a84c800c8ee5dcbd8c4f9a6c
2024-03-04 11:02:58 +00:00
Ramanpreet Nara 29b34e70e3 Pull PopupMenuAndroid out of React Native core
Summary:
**History:** This component was originally introduced into React Native core in D52712758, to replace UIManagerModule.showPopupMenu().

**Problem:** But, React Native core should be lean. Adding this component to React Native bloats the core.

**Changes:** So, this diff pulls PopupMenuAndroid out into its own package in the react-native GitHub repository.

In the future, this will be migrated to a community package!

Changelog: [Android][Removed] Move PopupMenu out of React Native core

Reviewed By: NickGerleman

Differential Revision: D53328110

fbshipit-source-id: 469d8dc3e756c06040c72e08fa004aafa1bd6e18
2024-03-04 11:02:52 +00:00
Nicola Corti 6294453980 Undo moving of TurboModule to internal and expose utility function for TurboModule.class.isAssignableFrom (#43219)
Summary:
After discussing with mdvacca, we prefer to undo the change of `TurboModule` package to `.internal` as this is a quite aggressive breaking change for the ecosystem.

Moreover: users should not invoke `TurboModule.class.isAssignableFrom` because `TurboModule` is `.internal`. Therefore I'm exposing another API to check if a class is a TurboModule as a static field of `ReactModuleInfo`.

## Changelog:

[INTERNAL] - Do not use TurboModule.class.isAssignableFrom

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

Test Plan: Tests are attached

Reviewed By: mdvacca, cipolleschi

Differential Revision: D54280882

Pulled By: cortinico

fbshipit-source-id: 9443c8aa23cf70dd5cfe574fe573d83313134358
2024-03-04 11:02:03 +00:00
Oskar Kwaśniewski 7822a7796f fix(iOS) [0.74]: properly warn about createRootViewWithBridge (#43146)
Summary:
This PR fixes an issue that `_logWarnIfCreateRootViewWithBridgeIsOverridden` was called in wrong place.

Assuming user overrides this method and call to `[super]`:

```objc
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
  UIView *view = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
  view.backgroundColor = [UIColor redColor];
  return view;
}
```

This method still wasn't called in bridgeless (and not showing the error).

Checking if user overrides this method in `appDidFinishWithLaunching` works every time

![simulator_screenshot_0E22557C-CE37-4617-A25A-F39A6ED4D3D0](https://github.com/facebook/react-native/assets/52801365/d7865f37-32f0-40ad-a252-74ab7c5b7757)

## Changelog:

[IOS] [FIXED] - Properly warn about `createRootViewWithBridge` being deprecated

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

Test Plan: Check if warning is shown when message is overridden

Reviewed By: huntie

Differential Revision: D54303506

Pulled By: cipolleschi

fbshipit-source-id: cf30555c791493f28b3015a189cf93b60cace8f8
2024-03-04 11:01:37 +00:00
Riccardo Cipolleschi 1ccc7a3e9e Deprecate getSurfacePresenter and getModuleRegistry in favor of their props
Summary:
This change align the `getSurfacePresenter` and `getModuleRegistry` to the iOS convention for which these should be computed properties with no `get` prefix in their name.

We want to land this change and to pick it in 0.74 so we can remove the `get` versions in 0.75.

## Changelog:
[iOS][Deprecated] - Deprecate `getSurfacePresenter` and `getModuleRegistry` for `surfacePresenter` and moduleRegistry` props.

Reviewed By: javache

Differential Revision: D54253805

fbshipit-source-id: e9ff7db744a73a3bd0f8ae1d87875e54ddd9a1a4
2024-03-04 11:01:15 +00:00
Dmitry Rykun 987c1f2880 Fix findLibrariesFromReactNativeConfig
Summary:
This diff removes extra argument from the `extractLibrariesFromJSON` call inside `findLibrariesFromReactNativeConfig`.
This should fix the iOS failurte discribed in https://github.com/facebook/react-native/issues/43204
Changelog: [iOS][Fixed] - Codegen correctly handles react-native.config.js.

Reviewed By: cipolleschi

Differential Revision: D54248400

fbshipit-source-id: 2ae5d0d29f49725877559a5b0edd7d59f8bdefaa
2024-03-04 10:56:27 +00:00
Moti Zilberman f6f3b5cb98 Restore Content-Length header in inspector-proxy JSON responses
Summary:
Changelog: [General][Fixed] Re-enable listing Hermes debugger targets in chrome://inspect, broken in 0.74 RC

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

Reverts D52958725 and fixes the original `Content-Length` Unicode bug using a different approach.

Reviewed By: fabriziocucci

Differential Revision: D54409847

fbshipit-source-id: ed5bb464ab67f37535947646b124814d8bbf797c
2024-03-01 10:45:51 +00:00
Riccardo Cipolleschi f7644be6d4 [RN][iOS]Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE 2024-02-29 10:48:01 +00:00
Distiller ad3f6b5274 [0.74.0-rc.1] Bump version numbers 2024-02-27 01:08:06 +00:00
Nicola Corti ba3cf235f5 bumped packages versions
#publish-packages-to-npm&0.74-stable
2024-02-26 16:54:52 -08:00
Cedric van Putten d032e35f86 feat(cli): warn underlying command when using npx react-native init (#43127)
Summary:
This adds a new warning for React Native 0.74, implementing the [RFC 0759](https://github.com/react-native-community/discussions-and-proposals/blob/nc/rnf/proposals/0759-react-native-frameworks.md#the-init-command) init command changes.

- It's added inside `react-native/cli.js` to avoid warning users when actually executing `npx react-native-community/cli` commands.
- The check is fairly simple: `process.argv[2] === 'init'`. The first two args are the Node bin and the actual script bin paths.
- The message is sent over `console.warn` to avoid potentially mixing JSON with non-JSON output.

## Changelog:

[GENERAL] [ADDED] - Warn with future command when using `npx react-native init`

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

Test Plan:
Any command other than `init` must not warn.

- `$ node ./path/to/react-native/cli.js init`
- `$ node ./path/to/react-native/cli.js init --help`
  - Should warn with `Running: npx react-native-community/cli init`
    ![image](https://github.com/facebook/react-native/assets/1203991/a3f5e3d2-7b59-41fe-9a53-bc9ce5a21fd1)
- `$ node ./path/to/react-native/cli.js --help`
  - Must not warn
    ![image](https://github.com/facebook/react-native/assets/1203991/97679429-db35-47f8-bdeb-33187bb167cf)

Reviewed By: cipolleschi

Differential Revision: D54063131

Pulled By: cortinico

fbshipit-source-id: c60b8b6034087b584e98b51f5bedf68a46caf44c
2024-02-26 11:47:20 -08:00
Nicola Corti b33b80f51c Bump CLI to 13.6.1 (#43153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43153

This contains an hotfix for the CLI needed for 0.74

Changelog:
[Internal] [Changed] - Bump CLI to 13.6.1

Reviewed By: huntie

Differential Revision: D54073715

fbshipit-source-id: a5fdf02f47c5e144efc58e6b7fd355669a21e07b
2024-02-26 11:15:57 -08:00
Nicola Corti b3300d77ea Remove accidental files included inside the template.
Summary:
Those files should not stay in the root `/app` folder but inside the `/app/gradle/wrapper` folder.
I've noticed this in the Upgrade Helper UI hence I'm removing them.

Changelog:
[Internal] [Changed] - Remove accidental files included inside the template

Reviewed By: mdvacca

Differential Revision: D54122995

fbshipit-source-id: 8873a91ffbea20f609c7aabd428a815c77a38db5
2024-02-26 11:10:30 -08:00
Nicola Corti fde94ce307 Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode
Summary:
RN-Tester is currently instacrashing on fast-refresh (pressing r on Metro) as it ends up on `onJSBundleLoadedFromServer`
which throws an exception on Bridgeless mode. I'm fixing it by following the same logic as `onReloadWithJSDebugger`.

Changelog:
[Android] [Fixed] - Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode

Reviewed By: huntie

Differential Revision: D54121838

fbshipit-source-id: 82d98ec0c5b2295f5751525368c956574dd7f3a0
2024-02-26 11:10:23 -08:00
Diego Segura 1f7ed063c9 fix flatlist props being undefined in ios (#43141)
Summary:
When using Flatlist on iOS and Android its failing because props are undefined

The problem is described on https://github.com/facebook/react-native/issues/34783

![Captura de pantalla 2024-02-22 a las 4 13 11](https://github.com/facebook/react-native/assets/1161455/325738d9-2e49-44a0-bb6a-077b2e02e9cd)

![Captura de pantalla 2024-02-22 a las 4 14 58](https://github.com/facebook/react-native/assets/1161455/118f76e1-a818-428e-938e-123b55536b49)

Fixed by setting constructor before any statement and removing unnecessary props declaration at the top of the class.

## 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
-->
[GENERAL] [FIXED] - Fix undefined props crash in FlatList

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

Reviewed By: javache

Differential Revision: D54069559

Pulled By: robhogan

fbshipit-source-id: b39cd9a273eb0279ed353f9efcb66a3c4ccf93b4
2024-02-26 11:09:34 -08:00
Nicola Corti 4def40ee33 Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI (#43049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43049

This connects the OnLoad.cpp file used by OSS apps with the `rncli_cxxModuleProvider`.
This method is created by the CLI and takes care of querying all the TM CXX Modules discovered and returning them.

This PR is currently waiting on https://github.com/react-native-community/cli/pull/2296

Changelog:
[Internal] [Changed] - Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI

Reviewed By: cipolleschi

Differential Revision: D53812109

fbshipit-source-id: 47bc0ea699516993070cfa0127de97853acf8890
2024-02-22 11:01:50 +00:00
Riccardo Cipolleschi 341fbe5486 [RN][Release] Fix release testing script 2024-02-21 17:55:37 +00:00
Distiller 898e207bcf [0.74.0-rc.0] Bump version numbers 2024-02-21 16:33:24 +00:00
Alex Hunt 619b8eb4d0 Bump package versions
#publish-packages-to-npm&0.74-stable
2024-02-21 15:20:42 +00:00
Alex Hunt ebca982365 Update Hermes version 2024-02-20 15:24:28 +00:00
102 changed files with 1141 additions and 638 deletions
+2 -2
View File
@@ -35,11 +35,11 @@ executors:
xcode: *xcode_version
resource_class: macos.x86.medium.gen2
environment:
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
reactnativeios-lts:
<<: *defaults
macos:
xcode: '14.3.1'
resource_class: macos.x86.medium.gen2
environment:
- BUILD_FROM_SOURCE: true
- RCT_BUILD_HERMES_FROM_SOURCE: true
+1 -1
View File
@@ -599,7 +599,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
+1
View File
@@ -42,6 +42,7 @@ project.xcworkspace
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
/packages/react-native/template/android/app/build/
/packages/react-native/template/android/build/
/packages/react-native-popup-menu-android/android/build/
# Buck
.buckd
+2 -2
View File
@@ -59,8 +59,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.74.0",
"@react-native/metro-config": "0.74.0",
"@react-native/metro-babel-transformer": "0.74.2",
"@react-native/metro-config": "0.74.2",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.0.18",
"@typescript-eslint/parser": "^6.7.4",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.74.0",
"version": "0.74.2",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -25,7 +25,7 @@
"index.js"
],
"dependencies": {
"@react-native/codegen": "0.74.0"
"@react-native/codegen": "0.74.2"
},
"devDependencies": {
"@babel/core": "^7.20.0"
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.74.0",
"version": "0.74.4",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,10 +22,10 @@
"dist"
],
"dependencies": {
"@react-native-community/cli-server-api": "13.6.0",
"@react-native-community/cli-tools": "13.6.0",
"@react-native/dev-middleware": "0.74.0",
"@react-native/metro-babel-transformer": "0.74.0",
"@react-native-community/cli-server-api": "13.6.1",
"@react-native-community/cli-tools": "13.6.1",
"@react-native/dev-middleware": "0.74.2",
"@react-native/metro-babel-transformer": "0.74.2",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "^0.80.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.74.0",
"version": "0.74.1",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.74.0",
"version": "0.74.2",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.74.0",
"@react-native/debugger-frontend": "0.74.1",
"@rnx-kit/chromium-edge-launcher": "^1.0.0",
"chrome-launcher": "^0.15.2",
"connect": "^3.6.5",
@@ -14,11 +14,13 @@ import type {
JsonVersionResponse,
} from '../inspector-proxy/types';
import {fetchJson} from './FetchUtils';
import {fetchJson, fetchLocal} from './FetchUtils';
import {createDeviceMock} from './InspectorDeviceUtils';
import {withAbortSignalForEachTest} from './ResourceUtils';
import {withServerForEachTest} from './ServerUtils';
import nullthrows from 'nullthrows';
// Must be greater than or equal to PAGES_POLLING_INTERVAL in `InspectorProxy.js`.
const PAGES_POLLING_DELAY = 1000;
@@ -309,5 +311,67 @@ describe('inspector proxy HTTP API', () => {
}
});
});
test('handles Unicode data safely', async () => {
const device = await createDeviceMock(
`${serverRef.serverBaseWsUrl}/inspector/device?device=device1&name=foo&app=bar`,
autoCleanup.signal,
);
try {
device.getPages.mockImplementation(() => [
{
app: 'bar-app 📱',
id: 'page1 🛂',
title: 'bar-title 📰',
vm: 'bar-vm 🤖',
},
]);
jest.advanceTimersByTime(PAGES_POLLING_DELAY);
const json = await fetchJson<JsonPagesListResponse>(
`${serverRef.serverBaseUrl}${endpoint}`,
);
expect(json).toEqual([
expect.objectContaining({
description: 'bar-app 📱',
deviceName: 'foo',
id: 'device1-page1 🛂',
title: 'bar-title 📰',
vm: 'bar-vm 🤖',
}),
]);
} finally {
device.close();
}
});
test('includes a valid Content-Length header', async () => {
// NOTE: This test is needed because chrome://inspect's HTTP client is picky
// and doesn't accept responses without a Content-Length header.
const device = await createDeviceMock(
`${serverRef.serverBaseWsUrl}/inspector/device?device=device1&name=foo&app=bar`,
autoCleanup.signal,
);
try {
device.getPages.mockImplementation(() => [
{
app: 'bar-app',
id: 'page1',
title: 'bar-title',
vm: 'bar-vm',
},
]);
jest.advanceTimersByTime(PAGES_POLLING_DELAY);
const response = await fetchLocal(
`${serverRef.serverBaseUrl}${endpoint}`,
);
expect(response.headers.get('Content-Length')).not.toBeNull();
} finally {
device.close();
}
});
});
});
@@ -167,6 +167,7 @@ export default class InspectorProxy implements InspectorProxyQueries {
response.writeHead(200, {
'Content-Type': 'application/json; charset=UTF-8',
'Cache-Control': 'no-cache',
'Content-Length': Buffer.byteLength(data).toString(),
Connection: 'close',
});
response.end(data);
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.74.0",
"version": "0.74.1",
"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.74.0",
"@react-native/eslint-plugin": "0.74.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.74.0",
"version": "0.74.1",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.74.0",
"version": "0.74.2",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -31,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": "0.74.0",
"@react-native/codegen": "0.74.2",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.74.0",
"version": "0.74.2",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -27,7 +27,7 @@
],
"dependencies": {
"@react-native/js-polyfills": "0.74.0",
"@react-native/metro-babel-transformer": "0.74.0",
"@react-native/metro-babel-transformer": "0.74.2",
"metro-config": "^0.80.3",
"metro-runtime": "^0.80.3"
}
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.74.0",
"version": "0.74.2",
"description": "Babel preset for React Native applications",
"main": "src/index.js",
"repository": {
@@ -54,7 +54,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": "0.74.0",
"@react-native/babel-plugin-codegen": "0.74.2",
"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.74.0",
"version": "0.74.2",
"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": "0.74.0",
"@react-native/babel-preset": "0.74.2",
"hermes-parser": "0.19.1",
"nullthrows": "^1.1.1"
},
@@ -19,7 +19,7 @@
"prepare": "yarn run build"
},
"dependencies": {
"@react-native/codegen": "0.74.0"
"@react-native/codegen": "0.74.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.74.0",
"version": "0.74.2",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -462,7 +462,7 @@ module.exports = {
'com.facebook.react.bridge.ReactApplicationContext',
'com.facebook.react.bridge.ReactContextBaseJavaModule',
'com.facebook.react.bridge.ReactMethod',
'com.facebook.react.internal.turbomodule.core.interfaces.TurboModule',
'com.facebook.react.turbomodule.core.interfaces.TurboModule',
'com.facebook.proguard.annotations.DoNotStrip',
'javax.annotation.Nonnull',
]);
@@ -20,7 +20,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeSampleTurboModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -66,7 +66,7 @@ import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -136,7 +136,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeSampleTurboModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -178,7 +178,7 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class AliasTurboModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -224,7 +224,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeCameraRollManagerSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -272,7 +272,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeExceptionsManagerSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -338,7 +338,7 @@ import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
@@ -462,7 +462,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeSampleTurboModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
@@ -500,7 +500,7 @@ import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeSampleTurboModule2Spec extends ReactContextBaseJavaModule implements TurboModule {
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.74.0",
"version": "0.74.1",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -0,0 +1,35 @@
/*
* 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.
*/
plugins {
id("com.facebook.react")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
compileSdk = libs.versions.compileSdk.get().toInt()
buildToolsVersion = libs.versions.buildTools.get()
namespace = "com.facebook.react.popupmenu"
defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions { jvmTarget = "17" }
}
dependencies {
// Build React Native from source
implementation(project(":packages:react-native:ReactAndroid"))
}
@@ -0,0 +1,3 @@
# We want to have more fine grained control on the Java version for
# ReactAndroid, therefore we disable RGNP Java version alignment mechanism
react.internal.disableJavaVersionAlignment=true
@@ -0,0 +1,20 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorH.js
*/
#pragma once
#include "ShadowNodes.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
namespace facebook::react {
using AndroidPopupMenuComponentDescriptor = ConcreteComponentDescriptor<AndroidPopupMenuShadowNode>;
} // namespace facebook::react
@@ -0,0 +1,24 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterCpp.js
*/
#include "EventEmitters.h"
namespace facebook::react {
void AndroidPopupMenuEventEmitter::onSelectionChange(OnSelectionChange $event) const {
dispatchEvent("selectionChange", [$event=std::move($event)](jsi::Runtime &runtime) {
auto $payload = jsi::Object(runtime);
$payload.setProperty(runtime, "item", $event.item);
return $payload;
});
}
} // namespace facebook::react
@@ -0,0 +1,25 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterH.js
*/
#pragma once
#include <react/renderer/components/view/ViewEventEmitter.h>
namespace facebook::react {
class AndroidPopupMenuEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;
struct OnSelectionChange {
int item;
};
void onSelectionChange(OnSelectionChange value) const;
};
} // namespace facebook::react
@@ -0,0 +1,25 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsCpp.js
*/
#include "Props.h"
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>
namespace facebook::react {
AndroidPopupMenuProps::AndroidPopupMenuProps(
const PropsParserContext &context,
const AndroidPopupMenuProps &sourceProps,
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
menuItems(convertRawProp(context, rawProps, "menuItems", sourceProps.menuItems, {}))
{}
} // namespace facebook::react
@@ -0,0 +1,28 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsH.js
*/
#pragma once
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <vector>
namespace facebook::react {
class AndroidPopupMenuProps final : public ViewProps {
public:
AndroidPopupMenuProps() = default;
AndroidPopupMenuProps(const PropsParserContext& context, const AndroidPopupMenuProps &sourceProps, const RawProps &rawProps);
#pragma mark - Props
std::vector<std::string> menuItems{};
};
} // namespace facebook::react
@@ -0,0 +1,17 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateShadowNodeCpp.js
*/
#include "ShadowNodes.h"
namespace facebook::react {
extern const char AndroidPopupMenuComponentName[] = "AndroidPopupMenu";
} // namespace facebook::react
@@ -0,0 +1,32 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateShadowNodeH.js
*/
#pragma once
#include "EventEmitters.h"
#include "Props.h"
#include "States.h"
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <jsi/jsi.h>
namespace facebook::react {
JSI_EXPORT extern const char AndroidPopupMenuComponentName[];
/*
* `ShadowNode` for <AndroidPopupMenu> component.
*/
using AndroidPopupMenuShadowNode = ConcreteViewShadowNode<
AndroidPopupMenuComponentName,
AndroidPopupMenuProps,
AndroidPopupMenuEventEmitter,
AndroidPopupMenuState>;
} // namespace facebook::react
@@ -0,0 +1,16 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateStateCpp.js
*/
#include "States.h"
namespace facebook::react {
} // namespace facebook::react
@@ -0,0 +1,34 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateStateH.js
*/
#pragma once
#ifdef ANDROID
#include <folly/dynamic.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif
namespace facebook::react {
class AndroidPopupMenuState {
public:
AndroidPopupMenuState() = default;
#ifdef ANDROID
AndroidPopupMenuState(AndroidPopupMenuState const &previousState, folly::dynamic data){};
folly::dynamic getDynamic() const {
return {};
};
MapBuffer getMapBuffer() const {
return MapBufferBuilder::EMPTY();
};
#endif
};
} // namespace facebook::react
@@ -0,0 +1,56 @@
/*
* 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.popupmenu
import com.facebook.react.BaseReactPackage
import com.facebook.react.ViewManagerOnDemandReactPackage
import com.facebook.react.bridge.ModuleSpec
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.annotations.ReactModuleList
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.uimanager.ViewManager
@ReactModuleList(nativeModules = arrayOf())
class PopupMenuPackage() : BaseReactPackage(), ViewManagerOnDemandReactPackage {
private var viewManagersMap: Map<String, ModuleSpec>? = null
override fun getModule(name: String, context: ReactApplicationContext): NativeModule? {
return null
}
private fun getViewManagersMap(): Map<String, ModuleSpec> {
val viewManagers =
viewManagersMap
?: mapOf(
ReactPopupMenuManager.REACT_CLASS to
ModuleSpec.viewManagerSpec({ ReactPopupMenuManager() }))
viewManagersMap = viewManagers
return viewManagers
}
protected override fun getViewManagers(context: ReactApplicationContext): List<ModuleSpec> {
return ArrayList(getViewManagersMap().values)
}
override fun getViewManagerNames(context: ReactApplicationContext): Collection<String> {
return getViewManagersMap().keys
}
override fun createViewManager(
reactContext: ReactApplicationContext,
viewManagerName: String
): ViewManager<*, *>? {
val spec: ModuleSpec? = getViewManagersMap().get(viewManagerName)
return if (spec != null) (spec.getProvider().get() as ViewManager<*, *>) else null
}
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
return ReactModuleInfoProvider { emptyMap() }
}
}
@@ -5,9 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes
package com.facebook.react.views.popupmenu
package com.facebook.react.popupmenu
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.popupmenu
package com.facebook.react.popupmenu
import android.content.Context
import android.os.Build
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.popupmenu
package com.facebook.react.popupmenu
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.module.annotations.ReactModule
@@ -0,0 +1,41 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;
public class AndroidPopupMenuManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & AndroidPopupMenuManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public AndroidPopupMenuManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "menuItems":
mViewManager.setMenuItems(view, (ReadableArray) value);
break;
default:
super.setProperty(view, propName, value);
}
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
switch (commandName) {
case "show":
mViewManager.show(view);
break;
}
}
}
@@ -0,0 +1,19 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
public interface AndroidPopupMenuManagerInterface<T extends View> {
void setMenuItems(T view, @Nullable ReadableArray value);
void show(T view);
}
+11
View File
@@ -0,0 +1,11 @@
/**
* 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.
*
* @format
*/
export type {default} from './PopupMenuAndroid';
export type {PopupMenuAndroidInstance} from './PopupMenuAndroid';
+12
View File
@@ -0,0 +1,12 @@
/**
* 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
*/
export {default} from './js/PopupMenuAndroid';
export type {PopupMenuAndroidInstance} from './js/PopupMenuAndroid';
@@ -8,13 +8,13 @@
* @flow strict-local
*/
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
import type {RefObject} from 'react';
import type {HostComponent} from 'react-native';
import type {SyntheticEvent} from 'react-native/Libraries/Types/CoreEventTypes';
import PopupMenuAndroidNativeComponent, {
Commands,
} from './PopupMenuAndroidNativeComponent';
} from './PopupMenuAndroidNativeComponent.android';
import nullthrows from 'nullthrows';
import * as React from 'react';
import {useCallback, useImperativeHandle, useRef} from 'react';
@@ -8,7 +8,7 @@
*/
import type * as React from 'react';
import {HostComponent} from '../../../types/public/ReactNativeTypes';
import {HostComponent} from 'react-native';
type PopupMenuAndroidInstance = {
show: () => void;
@@ -12,8 +12,29 @@ import type {RefObject} from 'react';
import type {Node} from 'react';
import * as React from 'react';
import {StyleSheet, View} from 'react-native';
const UnimplementedView = require('../UnimplementedViews/UnimplementedView');
/**
* Common implementation for a simple stubbed view. Simply applies the view's styles to the inner
* View component and renders its children.
*/
class UnimplementedView extends React.Component<{children: Node}> {
render(): React.Node {
return (
<View style={[styles.unimplementedView]}>{this.props.children}</View>
);
}
}
const styles = StyleSheet.create({
unimplementedView: __DEV__
? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1,
}
: {},
});
export type PopupMenuAndroidInstance = {
+show: () => void,
@@ -27,7 +48,7 @@ type Props = {
};
function PopupMenuAndroid(props: Props): Node {
return <UnimplementedView />;
return <UnimplementedView>{props.children}</UnimplementedView>;
}
export default PopupMenuAndroid;
@@ -8,16 +8,16 @@
* @format
*/
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type {
DirectEventHandler,
Int32,
} from '../../../../Libraries/Types/CodegenTypes';
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeCommands from '../../../../Libraries/Utilities/codegenNativeCommands';
import codegenNativeComponent from '../../../../Libraries/Utilities/codegenNativeComponent';
import * as React from 'react';
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
type PopupMenuSelectionEvent = $ReadOnly<{
item: Int32,
@@ -0,0 +1,42 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.74.1",
"description": "PopupMenu for the Android platform",
"react-native": "js/PopupMenuAndroid",
"source": "js/PopupMenuAndroid",
"files": [
"js",
"android",
"!android/build",
"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__"
],
"keywords": [
"react-native",
"android"
],
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "*"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"dependencies": {
"nullthrows": "^1.1.1"
},
"codegenConfig": {
"name": "ReactPopupMenuAndroidSpecs",
"type": "components",
"jsSrcsDir": "js",
"outputDir": {
"android": "android"
},
"includesGeneratedCode": true,
"android": {
"javaPackageName": "com.facebook.react.viewmanagers"
}
}
}
@@ -116,6 +116,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
}
rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
}
[self _logWarnIfCreateRootViewWithBridgeIsOverridden];
[self customizeRootView:(RCTRootView *)rootView];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self createRootViewController];
@@ -158,7 +159,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
moduleName:(NSString *)moduleName
initProps:(NSDictionary *)initProps
{
[self _logWarnIfCreateRootViewWithBridgeIsOverridden];
BOOL enableFabric = self.fabricEnabled;
UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, enableFabric);
@@ -1,13 +0,0 @@
/**
* 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.
*
* @format
* @flow strict-local
*/
export * from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
import PopupMenuAndroidNativeComponent from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
export default PopupMenuAndroidNativeComponent;
+3 -3
View File
@@ -14,10 +14,10 @@ const version: $ReadOnly<{
patch: number,
prerelease: string | null,
}> = {
major: 1000,
minor: 0,
major: 0,
minor: 74,
patch: 0,
prerelease: null,
prerelease: 'rc.2',
};
module.exports = {version};
-1
View File
@@ -308,7 +308,6 @@ export type Props<ItemT> = {
* Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.
*/
class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
props: Props<ItemT>;
/**
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
*/
@@ -1773,41 +1773,6 @@ declare export default typeof NativeKeyboardObserver;
"
`;
exports[`public API should not change unintentionally Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js 1`] = `
"export type PopupMenuAndroidInstance = {
+show: () => void,
};
type Props = {
menuItems: $ReadOnlyArray<string>,
onSelectionChange: (number) => void,
children: React.Node,
instanceRef: RefObject<?PopupMenuAndroidInstance>,
};
declare export default function PopupMenuAndroid(Props): React.Node;
"
`;
exports[`public API should not change unintentionally Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js 1`] = `
"export type PopupMenuAndroidInstance = {
+show: () => void,
};
type Props = {
menuItems: $ReadOnlyArray<string>,
onSelectionChange: (number) => void,
children: Node,
instanceRef: RefObject<?PopupMenuAndroidInstance>,
};
declare function PopupMenuAndroid(props: Props): Node;
declare export default typeof PopupMenuAndroid;
"
`;
exports[`public API should not change unintentionally Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js 1`] = `
"export * from \\"../../../src/private/specs/components/PopupMenuAndroidNativeComponent\\";
declare export default typeof PopupMenuAndroidNativeComponent;
"
`;
exports[`public API should not change unintentionally Libraries/Components/Pressable/Pressable.js 1`] = `
"type ViewStyleProp = $ElementType<React.ElementConfig<typeof View>, \\"style\\">;
export type StateCallbackType = $ReadOnly<{|
@@ -9026,7 +8991,6 @@ declare module.exports: {
get ImageBackground(): ImageBackground,
get InputAccessoryView(): InputAccessoryView,
get KeyboardAvoidingView(): KeyboardAvoidingView,
get PopupMenuAndroid(): PopupMenuAndroid,
get Modal(): Modal,
get Pressable(): Pressable,
get ProgressBarAndroid(): ProgressBarAndroid,
@@ -21,10 +21,10 @@ NSDictionary* RCTGetReactNativeVersion(void)
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(1000),
RCTVersionMinor: @(0),
RCTVersionMajor: @(0),
RCTVersionMinor: @(74),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
RCTVersionPrerelease: @"rc.2",
};
});
return __rnVersion;
@@ -322,7 +322,7 @@ public abstract class com/facebook/react/ReactPackageTurboModuleManagerDelegate
protected fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/util/List;Lcom/facebook/jni/HybridData;)V
public fun getEagerInitModuleNames ()Ljava/util/List;
public fun getLegacyModule (Ljava/lang/String;)Lcom/facebook/react/bridge/NativeModule;
public fun getModule (Ljava/lang/String;)Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModule;
public fun getModule (Ljava/lang/String;)Lcom/facebook/react/turbomodule/core/interfaces/TurboModule;
public fun unstable_enableSyncVoidMethods ()Z
public fun unstable_isLegacyModuleRegistered (Ljava/lang/String;)Z
public fun unstable_isModuleRegistered (Ljava/lang/String;)Z
@@ -2856,6 +2856,7 @@ public class com/facebook/react/module/model/ReactModuleInfo {
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
public fun canOverrideExistingModule ()Z
public static fun classIsTurboModule (Ljava/lang/Class;)Z
public fun className ()Ljava/lang/String;
public fun hasConstants ()Z
public fun isCxxModule ()Z
@@ -3199,7 +3200,7 @@ public class com/facebook/react/modules/dialog/DialogModule : com/facebook/fbrea
public fun showAlert (Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
}
public class com/facebook/react/modules/fresco/FrescoModule : com/facebook/react/bridge/ReactContextBaseJavaModule, com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/internal/turbomodule/core/interfaces/TurboModule, com/facebook/react/modules/common/ModuleDataCleaner$Cleanable {
public class com/facebook/react/modules/fresco/FrescoModule : com/facebook/react/bridge/ReactContextBaseJavaModule, com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/modules/common/ModuleDataCleaner$Cleanable, com/facebook/react/turbomodule/core/interfaces/TurboModule {
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/imagepipeline/core/ImagePipeline;Z)V
@@ -3440,7 +3441,7 @@ public class com/facebook/react/modules/systeminfo/AndroidInfoHelpers {
public static fun getServerHost (Ljava/lang/Integer;)Ljava/lang/String;
}
public class com/facebook/react/modules/systeminfo/AndroidInfoModule : com/facebook/fbreact/specs/NativePlatformConstantsAndroidSpec, com/facebook/react/internal/turbomodule/core/interfaces/TurboModule {
public class com/facebook/react/modules/systeminfo/AndroidInfoModule : com/facebook/fbreact/specs/NativePlatformConstantsAndroidSpec, com/facebook/react/turbomodule/core/interfaces/TurboModule {
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun getAndroidID ()Ljava/lang/String;
public fun getTypedExportedConstants ()Ljava/util/Map;
@@ -3806,7 +3807,9 @@ public abstract interface class com/facebook/react/turbomodule/core/interfaces/C
public abstract interface class com/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder {
}
public abstract interface class com/facebook/react/turbomodule/core/interfaces/TurboModule : com/facebook/react/internal/turbomodule/core/interfaces/TurboModule {
public abstract interface class com/facebook/react/turbomodule/core/interfaces/TurboModule {
public abstract fun initialize ()V
public abstract fun invalidate ()V
}
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener, com/facebook/react/uimanager/BaseViewManagerInterface {
@@ -5673,17 +5676,6 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidHorizonta
public abstract fun setRemoveClippedSubviews (Landroid/view/View;Z)V
}
public class com/facebook/react/viewmanagers/AndroidPopupMenuManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/viewmanagers/AndroidPopupMenuManagerInterface {
public abstract fun setMenuItems (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public abstract fun show (Landroid/view/View;)V
}
public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
@@ -6153,47 +6145,6 @@ public abstract interface class com/facebook/react/views/modal/ReactModalHostVie
public abstract fun onRequestClose (Landroid/content/DialogInterface;)V
}
public final class com/facebook/react/views/popupmenu/PopupMenuSelectionEvent : com/facebook/react/uimanager/events/Event {
public static final field Companion Lcom/facebook/react/views/popupmenu/PopupMenuSelectionEvent$Companion;
public static final field EVENT_NAME Ljava/lang/String;
public fun <init> (III)V
public fun dispatch (Lcom/facebook/react/uimanager/events/RCTEventEmitter;)V
public fun getEventName ()Ljava/lang/String;
}
public final class com/facebook/react/views/popupmenu/PopupMenuSelectionEvent$Companion {
}
public final class com/facebook/react/views/popupmenu/ReactPopupMenuContainer : android/widget/FrameLayout {
public fun <init> (Landroid/content/Context;)V
public final fun setMenuItems (Lcom/facebook/react/bridge/ReadableArray;)V
public final fun showPopupMenu ()V
}
public final class com/facebook/react/views/popupmenu/ReactPopupMenuManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/AndroidPopupMenuManagerInterface {
public static final field Companion Lcom/facebook/react/views/popupmenu/ReactPopupMenuManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public synthetic fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun receiveCommand (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun setMenuItems (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun setMenuItems (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun show (Landroid/view/View;)V
public fun show (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;)V
}
public class com/facebook/react/views/popupmenu/ReactPopupMenuManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/popupmenu/ReactPopupMenuManager;Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/popupmenu/ReactPopupMenuManager$Companion {
}
public class com/facebook/react/views/progressbar/ProgressBarShadowNode : com/facebook/react/uimanager/LayoutShadowNode, com/facebook/yoga/YogaMeasureFunction {
public fun <init> ()V
public fun getStyle ()Ljava/lang/String;
@@ -62,8 +62,16 @@ void registerComponents(
std::shared_ptr<TurboModule> cxxModuleProvider(
const std::string& name,
const std::shared_ptr<CallInvoker>& jsInvoker) {
// Not implemented yet: provide pure-C++ NativeModules here.
return nullptr;
// Here you can provide your CXX Turbo Modules coming from
// either your application or from external libraries. The approach to follow
// is similar to the following (for a module called `NativeCxxModuleExample`):
//
// if (name == NativeCxxModuleExample::kModuleName) {
// return std::make_shared<NativeCxxModuleExample>(jsInvoker);
// }
// And we fallback to the CXX module providers autolinked by RN CLI
return rncli_cxxModuleProvider(name, jsInvoker);
}
std::shared_ptr<TurboModule> javaModuleProvider(
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0
VERSION_NAME=0.74.0-rc.2
react.internal.publishingGroup=com.facebook.react
android.useAndroidX=true
@@ -17,7 +17,6 @@ import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.devsupport.LogBoxModule;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
@@ -115,7 +114,7 @@ class CoreModulesPackage extends TurboReactPackage implements ReactPackageLogger
reactModule.canOverrideExistingModule(),
reactModule.needsEagerInit(),
reactModule.isCxxModule(),
TurboModule.class.isAssignableFrom(moduleClass)));
ReactModuleInfo.classIsTurboModule(moduleClass)));
}
return () -> reactModuleInfoMap;
@@ -12,7 +12,6 @@ import com.facebook.react.bridge.ModuleSpec;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.devsupport.JSCHeapCapture;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
@@ -74,7 +73,7 @@ class DebugCorePackage extends TurboReactPackage implements ViewManagerOnDemandR
reactModule.canOverrideExistingModule(),
reactModule.needsEagerInit(),
reactModule.isCxxModule(),
TurboModule.class.isAssignableFrom(moduleClass)));
ReactModuleInfo.classIsTurboModule(moduleClass)));
}
return () -> reactModuleInfoMap;
@@ -18,9 +18,9 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.internal.turbomodule.core.TurboModuleManagerDelegate;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -123,14 +123,14 @@ public abstract class ReactPackageTurboModuleManagerDelegate extends TurboModule
reactModule.canOverrideExistingModule(),
true,
reactModule.isCxxModule(),
TurboModule.class.isAssignableFrom(moduleClass))
ReactModuleInfo.classIsTurboModule(moduleClass))
: new ReactModuleInfo(
moduleName,
moduleClass.getName(),
module.canOverrideExistingModule(),
true,
CxxModuleWrapper.class.isAssignableFrom(moduleClass),
TurboModule.class.isAssignableFrom(moduleClass));
ReactModuleInfo.classIsTurboModule(moduleClass));
reactModuleInfoMap.put(moduleName, moduleInfo);
moduleMap.put(moduleName, module);
@@ -15,7 +15,7 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
import androidx.annotation.Nullable;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import com.facebook.systrace.Systrace;
import com.facebook.systrace.SystraceMessage;
import java.lang.reflect.Method;
@@ -20,7 +20,6 @@ import com.facebook.debug.tags.ReactDebugOverlayTags;
import com.facebook.infer.annotation.Assertions;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.systrace.SystraceMessage;
import java.util.concurrent.atomic.AtomicInteger;
@@ -73,7 +72,7 @@ public class ModuleHolder {
nativeModule.canOverrideExistingModule(),
true,
CxxModuleWrapper.class.isAssignableFrom(nativeModule.getClass()),
TurboModule.class.isAssignableFrom(nativeModule.getClass()));
ReactModuleInfo.classIsTurboModule(nativeModule.getClass()));
mModule = nativeModule;
PrinterHolder.getPrinter()
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashSet;
@@ -19,12 +19,12 @@ import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactNoCrashSoftException;
import com.facebook.react.bridge.ReactSoftExceptionLogger;
import com.facebook.react.bridge.RuntimeExecutor;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry;
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl;
import com.facebook.react.turbomodule.core.NativeMethodCallInvokerHolderImpl;
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -12,7 +12,7 @@ import com.facebook.infer.annotation.Nullsafe;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.ArrayList;
import java.util.List;
@@ -1,19 +0,0 @@
/*
* 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.internal.turbomodule.core.interfaces
/** All turbo modules should inherit from this interface */
public interface TurboModule {
/** Initialize the TurboModule. */
public fun initialize()
/**
* Called during the turn down process of ReactHost. This method is called before React Native is
* stopped. Override this method to clean up resources used by the TurboModule.
*/
public fun invalidate()
}
@@ -7,6 +7,8 @@
package com.facebook.react.module.model;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
/**
* Data holder class holding native module specifications. {@link ReactModuleSpecProcessor} creates
* these so Java modules don't have to be instantiated at React Native start up.
@@ -80,4 +82,12 @@ public class ReactModuleInfo {
public boolean isTurboModule() {
return mIsTurboModule;
}
/**
* Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
* in the constructor of ReactModuleInfo.
*/
public static boolean classIsTurboModule(Class<?> clazz) {
return TurboModule.class.isAssignableFrom(clazz);
}
}
@@ -161,13 +161,13 @@ public class ReactModuleSpecProcessor extends ProcessorBase {
builder.addStatement("$T map = new $T()", MAP_TYPE, INSTANTIATED_MAP_TYPE);
String turboModuleInterfaceCanonicalName =
"com.facebook.react.internal.turbomodule.core.interfaces.TurboModule";
"com.facebook.react.turbomodule.core.interfaces.TurboModule";
TypeMirror turboModuleInterface =
mElements.getTypeElement(turboModuleInterfaceCanonicalName).asType();
if (turboModuleInterface == null) {
throw new RuntimeException(
"com.facebook.react.internal.turbomodule.core.interfaces.TurboModule interface not found.");
"com.facebook.react.turbomodule.core.interfaces.TurboModule interface not found.");
}
for (String nativeModule : nativeModules) {
@@ -19,12 +19,12 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.modules.common.ModuleDataCleaner;
import com.facebook.react.modules.network.CookieJarContainer;
import com.facebook.react.modules.network.ForwardingCookieHandler;
import com.facebook.react.modules.network.OkHttpClientProvider;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.HashSet;
import okhttp3.JavaNetCookieJar;
import okhttp3.OkHttpClient;
@@ -18,8 +18,8 @@ import androidx.annotation.Nullable;
import com.facebook.fbreact.specs.NativePlatformConstantsAndroidSpec;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.HashMap;
import java.util.Map;
@@ -15,8 +15,8 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 1000,
"minor", 0,
"major", 0,
"minor", 74,
"patch", 0,
"prerelease", null);
"prerelease", "rc.2");
}
@@ -119,7 +119,7 @@ class BridgelessDevSupportManager extends DevSupportManagerBase {
@Override
public void onJSBundleLoadedFromServer() {
throw new IllegalStateException("Not implemented for bridgeless mode");
// Not implemented
}
@Override
@@ -14,7 +14,6 @@ import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.devsupport.LogBoxModule;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
@@ -103,7 +102,7 @@ class CoreReactPackage extends TurboReactPackage {
reactModule.canOverrideExistingModule(),
reactModule.needsEagerInit(),
reactModule.isCxxModule(),
TurboModule.class.isAssignableFrom(moduleClass)));
ReactModuleInfo.classIsTurboModule(moduleClass)));
}
}
return () -> reactModuleInfoMap;
@@ -15,7 +15,6 @@ import com.facebook.react.animated.NativeAnimatedModule;
import com.facebook.react.bridge.ModuleSpec;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
@@ -47,7 +46,6 @@ import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.views.drawer.ReactDrawerLayoutManager;
import com.facebook.react.views.image.ReactImageManager;
import com.facebook.react.views.modal.ReactModalHostManager;
import com.facebook.react.views.popupmenu.ReactPopupMenuManager;
import com.facebook.react.views.progressbar.ReactProgressBarViewManager;
import com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager;
import com.facebook.react.views.scroll.ReactHorizontalScrollViewManager;
@@ -171,7 +169,6 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
viewManagers.add(new ReactScrollViewManager());
viewManagers.add(new ReactSwitchManager());
viewManagers.add(new SwipeRefreshLayoutManager());
viewManagers.add(new ReactPopupMenuManager());
// Native equivalents
viewManagers.add(new FrescoBasedReactTextInlineImageViewManager());
@@ -213,7 +210,6 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
appendMap(viewManagers, ReactSwitchManager.REACT_CLASS, ReactSwitchManager::new);
appendMap(
viewManagers, SwipeRefreshLayoutManager.REACT_CLASS, SwipeRefreshLayoutManager::new);
appendMap(viewManagers, ReactPopupMenuManager.REACT_CLASS, ReactPopupMenuManager::new);
appendMap(
viewManagers,
FrescoBasedReactTextInlineImageViewManager.REACT_CLASS,
@@ -300,7 +296,7 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
reactModule.canOverrideExistingModule(),
reactModule.needsEagerInit(),
reactModule.isCxxModule(),
TurboModule.class.isAssignableFrom(moduleClass)));
ReactModuleInfo.classIsTurboModule(moduleClass)));
}
}
return () -> reactModuleInfoMap;
@@ -6,15 +6,14 @@
*/
package com.facebook.react.turbomodule.core.interfaces
/** All turbo modules should inherit from this interface */
public interface TurboModule {
/** Initialize the TurboModule. */
public fun initialize()
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
/**
* This interface was introduced for backward compatibility purposes. This interface will be
* deprecated as part of the deprecation and removal of ReactModuleInfoProvider in the near future.
*
* See description of https://github.com/facebook/react-native/pull/41412 for more context.
*/
@DeprecatedInNewArchitecture
public interface TurboModule :
com.facebook.react.internal.turbomodule.core.interfaces.TurboModule {}
/**
* Called during the turn down process of ReactHost. This method is called before React Native is
* stopped. Override this method to clean up resources used by the TurboModule.
*/
public fun invalidate()
}
@@ -67,8 +67,6 @@ CoreComponentsRegistry::sharedProviderRegistry() {
AndroidDrawerLayoutComponentDescriptor>());
providerRegistry->add(concreteComponentDescriptorProvider<
DebuggingOverlayComponentDescriptor>());
providerRegistry->add(concreteComponentDescriptorProvider<
AndroidPopupMenuComponentDescriptor>());
return providerRegistry;
}();
@@ -7,7 +7,7 @@
package com.facebook.react.bridge
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule
import com.facebook.react.turbomodule.core.interfaces.TurboModule
import com.facebook.testutils.shadows.ShadowSoLoader
import org.junit.Before
import org.junit.Test
@@ -0,0 +1,51 @@
/*
* 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.modules.model
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.turbomodule.core.interfaces.TurboModule
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class ReactModuleInfoTest {
@Test
fun testCreateReactModuleInfo() {
val reactModuleInfo =
ReactModuleInfo(
/* name = */ "name",
/* className = */ "class",
/* canOverrideExistingModule = */ false,
/* needsEagerInit = */ false,
/* isCxxModule = */ false,
/* isTurboModule = */ false)
assertEquals("name", reactModuleInfo.name())
assertFalse(reactModuleInfo.canOverrideExistingModule())
assertFalse(reactModuleInfo.needsEagerInit())
assertFalse(reactModuleInfo.isCxxModule)
assertFalse(reactModuleInfo.isTurboModule)
}
@Test
fun classIsTurboModule_withRandomClass() {
assertFalse(ReactModuleInfo.classIsTurboModule(String::class.java))
}
@Test
fun classIsTurboModule_withTurboModule() {
assertTrue(ReactModuleInfo.classIsTurboModule(TestTurboModule::class.java))
}
inner class TestTurboModule : TurboModule {
override fun initialize() = Unit
override fun invalidate() = Unit
}
}
@@ -15,10 +15,10 @@
namespace facebook::react {
constexpr struct {
int32_t Major = 1000;
int32_t Minor = 0;
int32_t Major = 0;
int32_t Minor = 74;
int32_t Patch = 0;
std::string_view Prerelease = "";
std::string_view Prerelease = "rc.2";
} ReactNativeVersion;
} // namespace facebook::react
@@ -19,7 +19,7 @@ namespace facebook::react {
struct JTurboModule : jni::JavaClass<JTurboModule> {
static auto constexpr kJavaDescriptor =
"Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModule;";
"Lcom/facebook/react/turbomodule/core/interfaces/TurboModule;";
};
class JSI_EXPORT JavaTurboModule : public TurboModule {
@@ -19,7 +19,7 @@ import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
@@ -52,6 +52,10 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
@property (nonatomic, weak, nullable) id<RCTHostRuntimeDelegate> runtimeDelegate;
@property (nonatomic, readonly) RCTSurfacePresenter *surfacePresenter;
@property (nonatomic, readonly) RCTModuleRegistry *moduleRegistry;
- (void)start;
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
@@ -64,11 +68,11 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
- (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)properties;
- (RCTSurfacePresenter *)getSurfacePresenter;
- (RCTSurfacePresenter *)getSurfacePresenter __attribute__((deprecated("Use `surfacePresenter` property instead.")));
// Native module API
- (RCTModuleRegistry *)getModuleRegistry;
- (RCTModuleRegistry *)getModuleRegistry __attribute__((deprecated("Use `moduleRegistry` property instead.")));
@end
@@ -212,7 +212,7 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
mode:(DisplayMode)displayMode
initialProperties:(NSDictionary *)properties
{
RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithSurfacePresenter:[self getSurfacePresenter]
RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithSurfacePresenter:self.surfacePresenter
moduleName:moduleName
initialProperties:properties];
surface.surfaceHandler.setDisplayMode(displayMode);
@@ -235,16 +235,28 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
return [self createSurfaceWithModuleName:moduleName mode:DisplayMode::Visible initialProperties:properties];
}
- (RCTModuleRegistry *)getModuleRegistry
- (RCTModuleRegistry *)moduleRegistry
{
return _moduleRegistry;
}
- (RCTSurfacePresenter *)getSurfacePresenter
// Deprecated
- (RCTModuleRegistry *)getModuleRegistry
{
return self.moduleRegistry;
}
- (RCTSurfacePresenter *)surfacePresenter
{
return [_instance surfacePresenter];
}
// Deprecated
- (RCTSurfacePresenter *)getSurfacePresenter
{
return self.surfacePresenter;
}
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args
{
[_instance callFunctionOnJSModule:moduleName method:method args:args];
@@ -276,7 +288,7 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
[_hostDelegate hostDidStart:self];
for (RCTFabricSurface *surface in [self _getAttachedSurfaces]) {
[surface resetWithSurfacePresenter:[self getSurfacePresenter]];
[surface resetWithSurfacePresenter:self.surfacePresenter];
}
}
+13
View File
@@ -39,6 +39,16 @@ async function getLatestVersion(registryHost = DEFAULT_REGISTRY_HOST) {
});
}
/**
* Warn when users are using `npx react-native init`, to raise awareness of the changes from RFC 0759.
* @see https://github.com/react-native-community/discussions-and-proposals/tree/main/proposals/0759-react-native-frameworks.md
*/
function warnWhenRunningInit() {
if (process.argv[2] === 'init') {
console.warn('\nRunning: npx @react-native-community/cli init\n');
}
}
/**
* npx react-native -> @react-native-community/cli
*
@@ -66,6 +76,9 @@ async function main() {
// Ignore errors, since it's a nice to have warning
}
}
warnWhenRunningInit();
return cli.run(name);
}
-5
View File
@@ -27,7 +27,6 @@ import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
import typeof PopupMenuAndroid from './Libraries/Components/PopupMenuAndroid/PopupMenuAndroid';
import typeof Pressable from './Libraries/Components/Pressable/Pressable';
import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
@@ -135,10 +134,6 @@ module.exports = {
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
.default;
},
get PopupMenuAndroid(): PopupMenuAndroid {
return require('./Libraries/Components/PopupMenuAndroid/PopupMenuAndroid')
.default;
},
get Modal(): Modal {
return require('./Libraries/Modal/Modal');
},
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.74.0-rc.2",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": {
@@ -98,16 +98,16 @@
},
"dependencies": {
"@jest/create-cache-key-function": "^29.6.3",
"@react-native-community/cli": "13.6.0",
"@react-native-community/cli-platform-android": "13.6.0",
"@react-native-community/cli-platform-ios": "13.6.0",
"@react-native-community/cli": "13.6.1",
"@react-native-community/cli-platform-android": "13.6.1",
"@react-native-community/cli-platform-ios": "13.6.1",
"@react-native/assets-registry": "0.74.0",
"@react-native/codegen": "0.74.0",
"@react-native/community-cli-plugin": "0.74.0",
"@react-native/gradle-plugin": "0.74.0",
"@react-native/codegen": "0.74.2",
"@react-native/community-cli-plugin": "0.74.4",
"@react-native/gradle-plugin": "0.74.1",
"@react-native/js-polyfills": "0.74.0",
"@react-native/normalize-colors": "0.74.1",
"@react-native/virtualized-lists": "0.74.0",
"@react-native/virtualized-lists": "0.74.1",
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"ansi-regex": "^5.0.0",
@@ -153,4 +153,4 @@
}
]
}
}
}
@@ -283,11 +283,7 @@ function findLibrariesFromReactNativeConfig(projectRoot) {
return [];
}
return extractLibrariesFromJSON(
configFile,
configFile.name,
codegenConfigFileDir,
);
return extractLibrariesFromJSON(configFile, codegenConfigFileDir);
});
}
@@ -0,0 +1 @@
hermes-2024-02-20-RNv0.74.0-999cfd9979b5f57b1269119679ab8cdf60897de9
@@ -7,6 +7,7 @@ require 'net/http'
require 'rexml/document'
HERMES_GITHUB_URL = "https://github.com/facebook/hermes.git"
ENV_BUILD_FROM_SOURCE = "RCT_BUILD_HERMES_FROM_SOURCE"
module HermesEngineSourceType
LOCAL_PREBUILT_TARBALL = :local_prebuilt_tarball
@@ -30,7 +31,7 @@ end
# - To use a specific tarball, install the dependencies with:
# `HERMES_ENGINE_TARBALL_PATH=<path_to_tarball> bundle exec pod install`
# - To force a build from source, install the dependencies with:
# `BUILD_FROM_SOURCE=true bundle exec pod install`
# `RCT_BUILD_HERMES_FROM_SOURCE=true bundle exec pod install`
# If none of the two are provided, Cocoapods will check whether there is a tarball for the current version
# (either release or nightly). If not, it will fall back to building from source (the latest commit on main).
#
@@ -85,11 +86,11 @@ def hermes_commit_envvar_defined()
end
def force_build_from_tag(react_native_path)
return ENV['BUILD_FROM_SOURCE'] === 'true' && File.exist?(hermestag_file(react_native_path))
return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && File.exist?(hermestag_file(react_native_path))
end
def force_build_from_main(react_native_path)
return ENV['BUILD_FROM_SOURCE'] === 'true' && !File.exist?(hermestag_file(react_native_path))
return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && !File.exist?(hermestag_file(react_native_path))
end
def release_artifact_exists(version)
@@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+5 -5
View File
@@ -11,16 +11,16 @@
},
"dependencies": {
"react": "18.2.0",
"react-native": "1000.0.0"
"react-native": "0.74.0-rc.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.74.0",
"@react-native/eslint-config": "0.74.0",
"@react-native/metro-config": "0.74.0",
"@react-native/typescript-config": "0.74.0",
"@react-native/babel-preset": "0.74.2",
"@react-native/eslint-config": "0.74.1",
"@react-native/metro-config": "0.74.2",
"@react-native/typescript-config": "0.74.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
File diff suppressed because it is too large Load Diff
@@ -7,15 +7,15 @@
objects = {
/* Begin PBXBuildFile section */
00915AE8006CF5DB156153DD /* Pods_RNTester.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9DA138FE541ED31A6C589D7 /* Pods_RNTester.framework */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */; };
383889DA23A7398900D06C3E /* RCTConvert_UIColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */; };
3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };
54DAEFC777EF7A9E22099B94 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9368D28C48530F880026CC0B /* libPods-RNTesterIntegrationTests.a */; };
5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; };
8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; };
832F45BB2A8A6E1F0097B4E6 /* SwiftTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 832F45BA2A8A6E1F0097B4E6 /* SwiftTest.swift */; };
836E54623F6567BB812F3F6A /* Pods_RNTesterUnitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B5084412F9118F6F7FA99DA /* Pods_RNTesterUnitTests.framework */; };
912B05F7071A5E728F4FCB06 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88A9803AE5329EAB6C8B76DA /* libPods-RNTester.a */; };
CD10C7A5290BD4EB0033E1ED /* RCTEventEmitterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD10C7A4290BD4EB0033E1ED /* RCTEventEmitterTests.m */; };
E62F11832A5C6580000BF1C8 /* FlexibleSizeExampleView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.mm */; };
E62F11842A5C6584000BF1C8 /* UpdatePropertiesExampleView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.mm */; };
@@ -55,7 +55,7 @@
E7DB216422B2F3EC005AC45F /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB215F22B2F3EC005AC45F /* RCTUIManagerScenarioTests.m */; };
E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7DB213022B2C649005AC45F /* JavaScriptCore.framework */; };
E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7DB218B22B41FCD005AC45F /* XCTest.framework */; };
FA45ED19FFAECF4CFEFE0DC7 /* Pods_RNTesterIntegrationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 87E71F82CA94BF2D3CA3110A /* Pods_RNTesterIntegrationTests.framework */; };
E90FBDC7517BC8FEF761521D /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 90C5823BEF0D3A36982EFD41 /* libPods-RNTesterUnitTests.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -88,15 +88,16 @@
2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = "<group>"; };
359825B9A5AE4A3F4AA612DD /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIColorTests.m; sourceTree = "<group>"; };
3B5084412F9118F6F7FA99DA /* Pods_RNTesterUnitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNTesterUnitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "RNTester/legacy_image@2x.png"; sourceTree = "<group>"; };
5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = "<group>"; };
66C3087F2D5BF762FE9E6422 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = "<group>"; };
7CDA7A212644C6BB8C0D00D8 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = "<group>"; };
8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = "<group>"; };
832F45BA2A8A6E1F0097B4E6 /* SwiftTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SwiftTest.swift; path = RNTester/SwiftTest.swift; sourceTree = "<group>"; };
87E71F82CA94BF2D3CA3110A /* Pods_RNTesterIntegrationTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNTesterIntegrationTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
88A9803AE5329EAB6C8B76DA /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8BFB9C61D7BDE894E24BF24F /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = "<group>"; };
90C5823BEF0D3A36982EFD41 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9368D28C48530F880026CC0B /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9B8542B8C590B51BD0588751 /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = "<group>"; };
AC474BFB29BBD4A1002BDAED /* RNTester.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = RNTester.xctestplan; path = RNTester/RNTester.xctestplan; sourceTree = "<group>"; };
CD10C7A4290BD4EB0033E1ED /* RCTEventEmitterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventEmitterTests.m; sourceTree = "<group>"; };
@@ -161,7 +162,6 @@
E7DB215E22B2F3EC005AC45F /* RCTLoggingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLoggingTests.m; sourceTree = "<group>"; };
E7DB215F22B2F3EC005AC45F /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = "<group>"; };
E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XCTest.framework; sourceTree = DEVELOPER_DIR; };
F9DA138FE541ED31A6C589D7 /* Pods_RNTester.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNTester.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -169,7 +169,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
00915AE8006CF5DB156153DD /* Pods_RNTester.framework in Frameworks */,
912B05F7071A5E728F4FCB06 /* libPods-RNTester.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -178,7 +178,7 @@
buildActionMask = 2147483647;
files = (
E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */,
836E54623F6567BB812F3F6A /* Pods_RNTesterUnitTests.framework in Frameworks */,
E90FBDC7517BC8FEF761521D /* libPods-RNTesterUnitTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -188,7 +188,7 @@
files = (
E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */,
E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */,
FA45ED19FFAECF4CFEFE0DC7 /* Pods_RNTesterIntegrationTests.framework in Frameworks */,
54DAEFC777EF7A9E22099B94 /* libPods-RNTesterIntegrationTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -258,9 +258,9 @@
E7DB211822B2BD53005AC45F /* libReact-RCTText.a */,
E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */,
E7DB212222B2BD53005AC45F /* libyoga.a */,
F9DA138FE541ED31A6C589D7 /* Pods_RNTester.framework */,
87E71F82CA94BF2D3CA3110A /* Pods_RNTesterIntegrationTests.framework */,
3B5084412F9118F6F7FA99DA /* Pods_RNTesterUnitTests.framework */,
88A9803AE5329EAB6C8B76DA /* libPods-RNTester.a */,
9368D28C48530F880026CC0B /* libPods-RNTesterIntegrationTests.a */,
90C5823BEF0D3A36982EFD41 /* libPods-RNTesterUnitTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -151,6 +151,7 @@ android {
dependencies {
// Build React Native from source
implementation(project(":packages:react-native:ReactAndroid"))
implementation(project(":packages:react-native-popup-menu-android:android"))
// Consume Hermes as built from source only for the Hermes variant.
"hermesImplementation"(project(":packages:react-native:ReactAndroid:hermes-engine"))
@@ -25,6 +25,7 @@ import com.facebook.react.defaults.DefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.popupmenu.PopupMenuPackage
import com.facebook.react.shell.MainReactPackage
import com.facebook.react.uiapp.component.MyLegacyViewManager
import com.facebook.react.uiapp.component.MyNativeViewManager
@@ -44,6 +45,7 @@ class RNTesterApplication : Application(), ReactApplication {
public override fun getPackages(): List<ReactPackage> {
return listOf(
MainReactPackage(),
PopupMenuPackage(),
object : TurboReactPackage() {
override fun getModule(
name: String,
@@ -10,11 +10,12 @@
'use strict';
import type {PopupMenuAndroidInstance} from '@react-native/popup-menu-android';
import type {Node} from 'react';
import type {PopupMenuAndroidInstance} from 'react-native/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid';
import PopupMenuAndroid from '@react-native/popup-menu-android';
import * as React from 'react';
import {Button, PopupMenuAndroid, StyleSheet, Text, View} from 'react-native';
import {Button, StyleSheet, Text, View} from 'react-native';
type Fruit = 'Apple' | 'Pear' | 'Banana' | 'Orange' | 'Kiwi';
+1
View File
@@ -30,6 +30,7 @@ const config = {
path.resolve(__dirname, '../polyfills'),
path.resolve(__dirname, '../react-native'),
path.resolve(__dirname, '../virtualized-lists'),
path.resolve(__dirname, '../react-native-popup-menu-android'),
],
resolver: {
blockList: [/..\/react-native\/sdks\/hermes/],
+2 -1
View File
@@ -25,7 +25,8 @@
"dependencies": {
"flow-enums-runtime": "^0.0.6",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1"
"nullthrows": "^1.1.1",
"@react-native/popup-menu-android": "^0.74.1"
},
"peerDependencies": {
"react": "18.2.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/typescript-config",
"version": "0.74.0",
"version": "0.74.1",
"description": "Default TypeScript configuration for React Native apps",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/virtualized-lists",
"version": "0.74.0",
"version": "0.74.1",
"description": "Virtualized lists for React Native.",
"license": "MIT",
"repository": {
+20 -18
View File
@@ -22,6 +22,8 @@ const {
const {parseArgs} = require('@pkgjs/parseargs');
const chalk = require('chalk');
const {execSync} = require('child_process');
const {promises: fs} = require('fs');
const path = require('path');
const config = {
options: {
@@ -64,6 +66,10 @@ async function main() {
}
await initNewProjectFromSource(options);
// TODO(T179377112): Fix memory leak from `spawn` in `setupVerdaccio` (above
// kill command does not wait for kill success).
process.exit(0);
}
async function initNewProjectFromSource(
@@ -119,48 +125,44 @@ async function initNewProjectFromSource(
{
// Avoid loading packages/react-native/react-native.config.js
cwd: REPO_ROOT,
stdio: verbose ? 'inherit' : [process.stderr],
stdio: 'inherit',
},
);
console.log('\nDone ✅');
console.log('Installing project dependencies');
await runYarnUsingProxy(directory);
await installProjectUsingProxy(directory);
console.log('Done ✅');
} catch (e) {
console.log('Failed ❌');
throw e;
} finally {
console.log(`Cleanup: Killing Verdaccio process (PID: ${verdaccioPid})`);
execSync(`kill -9 ${verdaccioPid}`);
console.log('Done ✅');
try {
execSync(`kill -9 ${verdaccioPid}`);
console.log('Done ✅');
} catch {
console.warn('Failed to kill Verdaccio process');
}
console.log('Cleanup: Removing Verdaccio storage directory');
execSync(`rm -rf ${VERDACCIO_STORAGE_PATH}`);
console.log('Done ✅');
// TODO(huntie): Fix memory leak from `spawn` in `setupVerdaccio` (above
// kill command does not wait for kill success).
process.exit(0);
}
}
async function runYarnUsingProxy(cwd /*: string */) {
async function installProjectUsingProxy(cwd /*: string */) {
const execOptions = {
cwd,
stdio: 'inherit',
};
execSync(
`yarn config set npmRegistryServer "${VERDACCIO_SERVER_URL}"`,
execOptions,
);
execSync(
'yarn config set unsafeHttpWhitelist --json \'["localhost"]\'',
execOptions,
);
// TODO(huntie): Review pre-existing retry limit
const success = await retry('yarn', execOptions, 3, 500, ['install']);
const success = await retry('npm', execOptions, 3, 500, [
'install',
'--registry',
VERDACCIO_SERVER_URL,
]);
if (!success) {
throw new Error('Failed to install project dependencies');
+13 -3
View File
@@ -27,6 +27,7 @@ const {
prepareArtifacts,
setupCircleCIArtifacts,
} = require('./utils/testing-utils');
const chalk = require('chalk');
const debug = require('debug')('test-e2e-local');
const fs = require('fs');
const path = require('path');
@@ -301,10 +302,10 @@ async function testRNTestProject(
);
cd('..');
exec('yarn ios');
exec('npm run ios');
} else {
// android
exec('yarn android');
exec('npm run android');
}
popd();
}
@@ -329,7 +330,7 @@ async function main() {
let circleCIArtifacts = await setupCircleCIArtifacts(
// $FlowIgnoreError[prop-missing]
argv.circleCIToken,
argv.circleciToken,
branchName,
);
@@ -337,6 +338,15 @@ async function main() {
await testRNTester(circleCIArtifacts, onReleaseBranch);
} else {
await testRNTestProject(circleCIArtifacts);
console.warn(
chalk.yellow(`
================================================================================
NOTE: Verdaccio may still be running on after this script has finished. Please
Force Quit via Activity Monitor.
================================================================================
`),
);
}
}

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