mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
52
Commits
@@ -24,6 +24,6 @@ jobs:
|
||||
with:
|
||||
script: |
|
||||
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
|
||||
const version = ${{ github.ref_name }}';
|
||||
const version = '${{ github.ref_name }}';
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
## Summary:
|
||||
This change fixes the script that updates the RN Version to also update the Codegen snapshots so that they are in sync with the current version of React Native.
|
||||
It also updates the Snapshot as it was failing in rc.0
|
||||
|
||||
## Changelog:
|
||||
[Internal] - Fixed script that updates the react native versions
|
||||
|
||||
## Test Plan:
|
||||
Tested locally by running `node ./scripts/releases/set-rn-artifacts-version --built-type release --to-version 0.80.0-rc.0` and verifying that the snapshot file was getting updated. I then run the `yarn test
|
||||
generate-artifacts-executor-test.js` command to verify that the tests were passing.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+3
-5
@@ -30,8 +30,7 @@
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib packages/react-native/types",
|
||||
"test-typescript": "dtslint packages/react-native/types",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.test.json",
|
||||
"test": "jest",
|
||||
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
|
||||
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
|
||||
@@ -50,10 +49,9 @@
|
||||
"@babel/plugin-transform-regenerator": "^7.24.7",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@react-native/metro-babel-transformer": "0.80.0-main",
|
||||
"@react-native/metro-config": "0.80.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.80.0",
|
||||
"@react-native/metro-config": "0.80.0",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^19.0.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.80.0-main"
|
||||
"@react-native/codegen": "0.80.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,7 +22,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.80.0-main",
|
||||
"@react-native/dev-middleware": "0.80.0",
|
||||
"chalk": "^4.0.0",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@generated SignedSource<<c5f3f1de013841faf72c0a6052f5dc08>>
|
||||
Git revision: bc635fa428baf08a0667f89e3ee03f92c2f96416
|
||||
@generated SignedSource<<5409495e2dce8fc29e2085031ea1d9f7>>
|
||||
Git revision: 343405ba784fca9290486cbce57e7f2ca953dc14
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebook/react-native-devtools-frontend
|
||||
Remote branch: main
|
||||
Remote branch: 0.80-stable
|
||||
GN build args (overrides only):
|
||||
is_official_build = true
|
||||
Git status in checkout:
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+31
-24
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import*as e from"../../core/common/common.js";import"../../core/root/root.js";import*as i from"../../core/i18n/i18n.js";import*as t from"../../ui/legacy/legacy.js";const n={performance:"Performance",showPerformance:"Show Performance",record:"Record",stop:"Stop",recordAndReload:"Record and reload",saveProfile:"Save profile…",loadProfile:"Load profile…",previousFrame:"Previous frame",nextFrame:"Next frame",showRecentTimelineSessions:"Show recent timeline sessions",previousRecording:"Previous recording",nextRecording:"Next recording",hideChromeFrameInLayersView:"Hide `chrome` frame in Layers view"},o=i.i18n.registerUIStrings("panels/timeline/timeline-meta.ts",n),a=i.i18n.getLazilyComputedLocalizedString.bind(void 0,o);let r;async function l(){return r||(r=await import("./timeline.js")),r}function c(e){return void 0===r?[]:e(r)}t.ViewManager.registerViewExtension({location:"panel",id:"timeline",title:a(n.performance),commandPrompt:a(n.showPerformance),order:50,experiment:"enable-performance-panel",loadView:async()=>(await l()).TimelinePanel.TimelinePanel.instance()}),t.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:"PERFORMANCE",iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),options:[{value:!0,title:a(n.record)},{value:!1,title:a(n.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),category:"PERFORMANCE",title:a(n.recordAndReload),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}],experiment:"!react-native-specific-ui"}),t.ActionRegistration.registerActionExtension({category:"PERFORMANCE",actionId:"timeline.save-to-file",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.saveProfile),bindings:[{platform:"windows,linux",shortcut:"Ctrl+S"},{platform:"mac",shortcut:"Meta+S"}]}),t.ActionRegistration.registerActionExtension({category:"PERFORMANCE",actionId:"timeline.load-from-file",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.loadProfile),bindings:[{platform:"windows,linux",shortcut:"Ctrl+O"},{platform:"mac",shortcut:"Meta+O"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.jump-to-previous-frame",category:"PERFORMANCE",title:a(n.previousFrame),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{shortcut:"["}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.jump-to-next-frame",category:"PERFORMANCE",title:a(n.nextFrame),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{shortcut:"]"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),category:"PERFORMANCE",title:a(n.showRecentTimelineSessions),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.previous-recording",category:"PERFORMANCE",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.previousRecording),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Alt+Left"},{platform:"mac",shortcut:"Meta+Left"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.next-recording",category:"PERFORMANCE",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.nextRecording),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Alt+Right"},{platform:"mac",shortcut:"Meta+Right"}]}),e.Settings.registerSettingExtension({category:"PERFORMANCE",storageType:"Synced",title:a(n.hideChromeFrameInLayersView),settingName:"frame-viewer-hide-chrome-window",settingType:"boolean",defaultValue:!1}),e.Linkifier.registerLinkifier({contextTypes:()=>c((e=>[e.CLSLinkifier.CLSRect])),loadLinkifier:async()=>(await l()).CLSLinkifier.Linkifier.instance()}),t.ContextMenu.registerItem({location:"timelineMenu/open",actionId:"timeline.load-from-file",order:10}),t.ContextMenu.registerItem({location:"timelineMenu/open",actionId:"timeline.save-to-file",order:15});
|
||||
import*as e from"../../core/common/common.js";import"../../core/root/root.js";import*as i from"../../core/i18n/i18n.js";import*as t from"../../ui/legacy/legacy.js";const n={performance:"Performance",showPerformance:"Show Performance",record:"Record",stop:"Stop",recordAndReload:"Record and reload",saveProfile:"Save profile…",loadProfile:"Load profile…",previousFrame:"Previous frame",nextFrame:"Next frame",showRecentTimelineSessions:"Show recent timeline sessions",previousRecording:"Previous recording",nextRecording:"Next recording",hideChromeFrameInLayersView:"Hide `chrome` frame in Layers view"},o=i.i18n.registerUIStrings("panels/timeline/timeline-meta.ts",n),a=i.i18n.getLazilyComputedLocalizedString.bind(void 0,o);let r;async function l(){return r||(r=await import("./timeline.js")),r}function c(e){return void 0===r?[]:e(r)}t.ViewManager.registerViewExtension({location:"panel",id:"timeline",title:a(n.performance),commandPrompt:a(n.showPerformance),order:50,experiment:!0===globalThis.FB_ONLY__enablePerformance?void 0:"enable-performance-panel",loadView:async()=>(await l()).TimelinePanel.TimelinePanel.instance()}),t.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:"PERFORMANCE",iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),options:[{value:!0,title:a(n.record)},{value:!1,title:a(n.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),category:"PERFORMANCE",title:a(n.recordAndReload),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}],experiment:"!react-native-specific-ui"}),t.ActionRegistration.registerActionExtension({category:"PERFORMANCE",actionId:"timeline.save-to-file",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.saveProfile),bindings:[{platform:"windows,linux",shortcut:"Ctrl+S"},{platform:"mac",shortcut:"Meta+S"}]}),t.ActionRegistration.registerActionExtension({category:"PERFORMANCE",actionId:"timeline.load-from-file",contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.loadProfile),bindings:[{platform:"windows,linux",shortcut:"Ctrl+O"},{platform:"mac",shortcut:"Meta+O"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.jump-to-previous-frame",category:"PERFORMANCE",title:a(n.previousFrame),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{shortcut:"["}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.jump-to-next-frame",category:"PERFORMANCE",title:a(n.nextFrame),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),bindings:[{shortcut:"]"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),category:"PERFORMANCE",title:a(n.showRecentTimelineSessions),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.previous-recording",category:"PERFORMANCE",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.previousRecording),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Alt+Left"},{platform:"mac",shortcut:"Meta+Left"}]}),t.ActionRegistration.registerActionExtension({actionId:"timeline.next-recording",category:"PERFORMANCE",loadActionDelegate:async()=>new((await l()).TimelinePanel.ActionDelegate),title:a(n.nextRecording),contextTypes:()=>c((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Alt+Right"},{platform:"mac",shortcut:"Meta+Right"}]}),e.Settings.registerSettingExtension({category:"PERFORMANCE",storageType:"Synced",title:a(n.hideChromeFrameInLayersView),settingName:"frame-viewer-hide-chrome-window",settingType:"boolean",defaultValue:!1}),e.Linkifier.registerLinkifier({contextTypes:()=>c((e=>[e.CLSLinkifier.CLSRect])),loadLinkifier:async()=>(await l()).CLSLinkifier.Linkifier.instance()}),t.ContextMenu.registerItem({location:"timelineMenu/open",actionId:"timeline.load-from-file",order:10}),t.ContextMenu.registerItem({location:"timelineMenu/open",actionId:"timeline.save-to-file",order:15});
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"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.80.0-main",
|
||||
"@react-native/debugger-frontend": "0.80.0",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.80.0-main",
|
||||
"@react-native/eslint-plugin": "0.80.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@react-native/codegen": "0.80.0-main",
|
||||
"@react-native/codegen": "0.80.0",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -13,16 +13,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.1.0",
|
||||
"react-native": "1000.0.0"
|
||||
"react-native": "0.80.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/runtime": "^7.25.0",
|
||||
"@react-native/babel-preset": "0.80.0-main",
|
||||
"@react-native/core-cli-utils": "0.80.0-main",
|
||||
"@react-native/eslint-config": "0.80.0-main",
|
||||
"@react-native/metro-config": "0.80.0-main",
|
||||
"@react-native/babel-preset": "0.80.0",
|
||||
"@react-native/core-cli-utils": "0.80.0",
|
||||
"@react-native/eslint-config": "0.80.0",
|
||||
"@react-native/metro-config": "0.80.0",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
"eslint": "^8.19.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.80.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.80.0-main",
|
||||
"@react-native/js-polyfills": "0.80.0",
|
||||
"@react-native/metro-babel-transformer": "0.80.0",
|
||||
"metro-config": "^0.82.2",
|
||||
"metro-runtime": "^0.82.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/new-app-screen",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "NewAppScreen component for React Native",
|
||||
"keywords": [
|
||||
"react-native"
|
||||
|
||||
@@ -51,7 +51,7 @@ const Links: Array<{
|
||||
{
|
||||
title: 'Networking',
|
||||
description: 'Use the Fetch API',
|
||||
url: 'https://reactnative.dev/docs/navigation',
|
||||
url: 'https://reactnative.dev/docs/network',
|
||||
},
|
||||
{
|
||||
title: 'Showcase',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -66,7 +66,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.25.2",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.24.7",
|
||||
"@babel/template": "^7.25.0",
|
||||
"@react-native/babel-plugin-codegen": "0.80.0-main",
|
||||
"@react-native/babel-plugin-codegen": "0.80.0",
|
||||
"babel-plugin-syntax-hermes-parser": "0.28.1",
|
||||
"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.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -27,7 +27,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.80.0-main",
|
||||
"@react-native/babel-preset": "0.80.0",
|
||||
"hermes-parser": "0.28.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/bots",
|
||||
"description": "React Native Bots",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"private": true,
|
||||
"description": "TypeScript related unit test for @react-native/codegen",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.80.0-main"
|
||||
"@react-native/codegen": "0.80.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/compatibility-check",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -29,7 +29,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.80.0-main"
|
||||
"@react-native/codegen": "0.80.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-remove-types": "^2.237.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/fantom",
|
||||
"private": true,
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"main": "src/index.js",
|
||||
"description": "Internal integration testing and benchmarking tool for React Native",
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.80.0-main"
|
||||
"@react-native/codegen": "0.80.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.80.0-main",
|
||||
"version": "0.80.0",
|
||||
"private": true,
|
||||
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.80.0-main",
|
||||
"react-native": "1000.0.0"
|
||||
"@react-native/babel-preset": "0.80.0",
|
||||
"react-native": "0.80.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -25,7 +25,7 @@ const Animated: typeof AnimatedImplementation = Platform.isDisableAnimations
|
||||
: AnimatedImplementation;
|
||||
|
||||
export default {
|
||||
get FlatList(): AnimatedFlatList {
|
||||
get FlatList(): AnimatedFlatList<any> {
|
||||
return require('./components/AnimatedFlatList').default;
|
||||
},
|
||||
get Image(): AnimatedImage {
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
get ScrollView(): AnimatedScrollView {
|
||||
return require('./components/AnimatedScrollView').default;
|
||||
},
|
||||
get SectionList(): AnimatedSectionList {
|
||||
get SectionList(): AnimatedSectionList<any, any> {
|
||||
return require('./components/AnimatedSectionList').default;
|
||||
},
|
||||
get Text(): AnimatedText {
|
||||
|
||||
@@ -37,7 +37,7 @@ export type {default as AnimatedDivision} from './nodes/AnimatedDivision';
|
||||
export type {default as AnimatedModulo} from './nodes/AnimatedModulo';
|
||||
export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication';
|
||||
export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction';
|
||||
export type {WithAnimatedValue} from './createAnimatedComponent';
|
||||
export type {WithAnimatedValue, AnimatedProps} from './createAnimatedComponent';
|
||||
export type {AnimatedComponentType as AnimatedComponent} from './createAnimatedComponent';
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
||||
import type {AnimatedProps} from '../createAnimatedComponent';
|
||||
|
||||
import FlatList from '../../Lists/FlatList';
|
||||
import FlatList, {type FlatListProps} from '../../Lists/FlatList';
|
||||
import createAnimatedComponent from '../createAnimatedComponent';
|
||||
import * as React from 'react';
|
||||
|
||||
export default (createAnimatedComponent(FlatList): AnimatedComponentType<
|
||||
React.ElementConfig<typeof FlatList>,
|
||||
FlatList<mixed>,
|
||||
>);
|
||||
// $FlowExpectedError[unclear-type]
|
||||
export default (createAnimatedComponent(FlatList): component<ItemT = any>(
|
||||
ref?: React.RefSetter<FlatList<ItemT>>,
|
||||
...props: AnimatedProps<FlatListProps<ItemT>>
|
||||
));
|
||||
|
||||
+11
-7
@@ -8,15 +8,19 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {SectionBase} from '../../Lists/SectionList';
|
||||
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
||||
import type {AnimatedProps} from '../createAnimatedComponent';
|
||||
|
||||
import SectionList from '../../Lists/SectionList';
|
||||
import SectionList, {type SectionListProps} from '../../Lists/SectionList';
|
||||
import createAnimatedComponent from '../createAnimatedComponent';
|
||||
import * as React from 'react';
|
||||
|
||||
export default (createAnimatedComponent(SectionList): AnimatedComponentType<
|
||||
React.ElementConfig<typeof SectionList>,
|
||||
// $FlowFixMe
|
||||
export default (createAnimatedComponent(SectionList): component<
|
||||
// $FlowExpectedError[unclear-type]
|
||||
SectionList<any, SectionBase<any>>,
|
||||
>);
|
||||
ItemT = any,
|
||||
// $FlowExpectedError[unclear-type]
|
||||
SectionT = any,
|
||||
>(
|
||||
ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
|
||||
...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
|
||||
));
|
||||
|
||||
@@ -22,7 +22,7 @@ import invariant from 'invariant';
|
||||
|
||||
export type AnimatedPropsAllowlist = $ReadOnly<{
|
||||
style?: ?AnimatedStyleAllowlist,
|
||||
[string]: true,
|
||||
[key: string]: true | AnimatedStyleAllowlist,
|
||||
}>;
|
||||
|
||||
type TargetView = {
|
||||
|
||||
+6
-1
@@ -22,7 +22,12 @@ import NativeAppState from './NativeAppState';
|
||||
* - @platform android - on another Activity (even if it was launched by your app)
|
||||
* @platform ios - inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
|
||||
*/
|
||||
export type AppStateStatus = 'inactive' | 'background' | 'active';
|
||||
export type AppStateStatus =
|
||||
| 'inactive'
|
||||
| 'background'
|
||||
| 'active'
|
||||
| 'extension'
|
||||
| 'unknown';
|
||||
|
||||
/**
|
||||
* change - This even is received when the app state has changed.
|
||||
|
||||
+1
@@ -110,6 +110,7 @@ const ActivityIndicator = (
|
||||
style={StyleSheet.compose(styles.container, style)}>
|
||||
{Platform.OS === 'android' ? (
|
||||
// $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
|
||||
// $FlowFixMe[incompatible-type]
|
||||
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
|
||||
) : (
|
||||
/* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
|
||||
|
||||
+13
-1
@@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform';
|
||||
|
||||
export type {ProgressBarAndroidProps};
|
||||
|
||||
// A utility type to preserve the semantics of the union uses in the definition
|
||||
// of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
|
||||
// we define our own version which does. This does not affect Flow.
|
||||
// $FlowExpectedError[unclear-type]
|
||||
type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
|
||||
|
||||
/**
|
||||
* ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
|
||||
* It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
|
||||
* @see https://github.com/react-native-community/progress-bar-android
|
||||
* @deprecated
|
||||
*/
|
||||
let ProgressBarAndroid: component(
|
||||
ref?: React.RefSetter<
|
||||
React.ElementRef<ProgressBarAndroidNativeComponentType>,
|
||||
>,
|
||||
...props: ProgressBarAndroidProps
|
||||
...props: Omit<ProgressBarAndroidProps, empty>
|
||||
);
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
|
||||
+29
-20
@@ -17,28 +17,25 @@ import type {ViewProps} from '../View/ViewPropTypes';
|
||||
* `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
|
||||
* `progress` value.
|
||||
*/
|
||||
type ProgressBarAndroidStyleAttrProp =
|
||||
| {
|
||||
styleAttr: 'Horizontal',
|
||||
indeterminate: false,
|
||||
progress: number,
|
||||
}
|
||||
| {
|
||||
styleAttr:
|
||||
| 'Horizontal'
|
||||
| 'Normal'
|
||||
| 'Small'
|
||||
| 'Large'
|
||||
| 'Inverse'
|
||||
| 'SmallInverse'
|
||||
| 'LargeInverse',
|
||||
indeterminate: true,
|
||||
};
|
||||
type DeterminateProgressBarAndroidStyleAttrProp = {
|
||||
styleAttr: 'Horizontal',
|
||||
indeterminate: false,
|
||||
progress: number,
|
||||
};
|
||||
|
||||
export type ProgressBarAndroidProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidStyleAttrProp,
|
||||
type IndeterminateProgressBarAndroidStyleAttrProp = {
|
||||
styleAttr:
|
||||
| 'Horizontal'
|
||||
| 'Normal'
|
||||
| 'Small'
|
||||
| 'Large'
|
||||
| 'Inverse'
|
||||
| 'SmallInverse'
|
||||
| 'LargeInverse',
|
||||
indeterminate: true,
|
||||
};
|
||||
|
||||
type ProgressBarAndroidBaseProps = $ReadOnly<{
|
||||
/**
|
||||
* Whether to show the ProgressBar (true, the default) or hide it (false).
|
||||
*/
|
||||
@@ -52,3 +49,15 @@ export type ProgressBarAndroidProps = $ReadOnly<{
|
||||
*/
|
||||
testID?: ?string,
|
||||
}>;
|
||||
|
||||
export type ProgressBarAndroidProps =
|
||||
| $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidBaseProps,
|
||||
...DeterminateProgressBarAndroidStyleAttrProp,
|
||||
}>
|
||||
| $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidBaseProps,
|
||||
...IndeterminateProgressBarAndroidStyleAttrProp,
|
||||
}>;
|
||||
|
||||
@@ -14,8 +14,8 @@ export const version: $ReadOnly<{
|
||||
patch: number,
|
||||
prerelease: string | null,
|
||||
}> = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
major: 0,
|
||||
minor: 80,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ export default class NativeEventEmitter<
|
||||
{
|
||||
_nativeModule: ?NativeModule;
|
||||
|
||||
constructor(nativeModule: ?NativeModule) {
|
||||
constructor(nativeModule?: ?NativeModule) {
|
||||
if (Platform.OS === 'ios') {
|
||||
invariant(
|
||||
nativeModule != null,
|
||||
|
||||
@@ -18,10 +18,23 @@ export type ResolvedAssetSource = {
|
||||
+scale: number,
|
||||
};
|
||||
|
||||
import type {
|
||||
AssetDestPathResolver,
|
||||
PackagerAsset,
|
||||
} from '@react-native/assets-registry/registry';
|
||||
// From @react-native/assets-registry
|
||||
type AssetDestPathResolver = 'android' | 'generic';
|
||||
|
||||
// From @react-native/assets-registry
|
||||
type PackagerAsset = $ReadOnly<{
|
||||
__packager_asset: boolean,
|
||||
fileSystemLocation: string,
|
||||
httpServerLocation: string,
|
||||
width: ?number,
|
||||
height: ?number,
|
||||
scales: Array<number>,
|
||||
hash: string,
|
||||
name: string,
|
||||
type: string,
|
||||
resolver?: AssetDestPathResolver,
|
||||
...
|
||||
}>;
|
||||
|
||||
const PixelRatio = require('../Utilities/PixelRatio').default;
|
||||
const Platform = require('../Utilities/Platform').default;
|
||||
|
||||
@@ -107,4 +107,6 @@ declare export const setStyleAttributePreprocessor: (
|
||||
* An identity function for creating style sheets.
|
||||
*/
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
declare export const create: <+S: ____Styles_Internal>(obj: S) => $ReadOnly<S>;
|
||||
declare export const create: <+S: ____Styles_Internal>(
|
||||
obj: S & ____Styles_Internal,
|
||||
) => $ReadOnly<S>;
|
||||
|
||||
@@ -21,6 +21,7 @@ import type {
|
||||
____ViewStyle_InternalOverrides,
|
||||
} from './private/_StyleSheetTypesOverrides';
|
||||
import type {____TransformStyle_Internal} from './private/_TransformStyle';
|
||||
import type {ColorValue} from './StyleSheet';
|
||||
|
||||
export type {____TransformStyle_Internal};
|
||||
|
||||
@@ -1001,7 +1002,8 @@ export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
overlayColor?: ColorValue,
|
||||
overflow?: 'visible' | 'hidden',
|
||||
}>;
|
||||
|
||||
export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
@@ -1014,7 +1016,7 @@ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
overlayColor?: ColorValue,
|
||||
}>;
|
||||
|
||||
export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
|
||||
|
||||
@@ -10,6 +10,25 @@
|
||||
|
||||
import type AnimatedNode from '../../Animated/nodes/AnimatedNode';
|
||||
|
||||
// Helper types to enforce that a single key is used in a transform object
|
||||
// after generating a TypeScript definition file from the Flow types.
|
||||
// $FlowExpectedError[unclear-type]
|
||||
type KeysOfUnion<T> = T extends any ? $Keys<T> : empty;
|
||||
// $FlowExpectedError[unclear-type]
|
||||
type ValueOfUnion<T, K> = T extends any
|
||||
? K extends $Keys<T>
|
||||
? T[K]
|
||||
: empty
|
||||
: empty;
|
||||
type MergeUnion<T> = {
|
||||
[K in KeysOfUnion<T>]?: ValueOfUnion<T, K>,
|
||||
};
|
||||
type MaximumOneOf<T: {...}> = $Values<{
|
||||
[K in keyof T]: $Exact<{
|
||||
[P in keyof T]?: P extends K ? T[P] : empty,
|
||||
}>,
|
||||
}>;
|
||||
|
||||
export type ____TransformStyle_Internal = $ReadOnly<{
|
||||
/**
|
||||
* `transform` accepts an array of transformation objects. Each object specifies
|
||||
@@ -29,27 +48,36 @@ export type ____TransformStyle_Internal = $ReadOnly<{
|
||||
*/
|
||||
transform?:
|
||||
| $ReadOnlyArray<
|
||||
| {+perspective: number | AnimatedNode}
|
||||
| {+rotate: string | AnimatedNode}
|
||||
| {+rotateX: string | AnimatedNode}
|
||||
| {+rotateY: string | AnimatedNode}
|
||||
| {+rotateZ: string | AnimatedNode}
|
||||
| {+scale: number | AnimatedNode}
|
||||
| {+scaleX: number | AnimatedNode}
|
||||
| {+scaleY: number | AnimatedNode}
|
||||
| {+translateX: number | string | AnimatedNode}
|
||||
| {+translateY: number | string | AnimatedNode}
|
||||
| {
|
||||
+translate:
|
||||
| [number | string | AnimatedNode, number | string | AnimatedNode]
|
||||
| AnimatedNode,
|
||||
}
|
||||
| {+skewX: string | AnimatedNode}
|
||||
| {+skewY: string | AnimatedNode}
|
||||
// TODO: what is the actual type it expects?
|
||||
| {
|
||||
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|
||||
},
|
||||
$ReadOnly<
|
||||
MaximumOneOf<
|
||||
MergeUnion<
|
||||
| {+perspective: number | AnimatedNode}
|
||||
| {+rotate: string | AnimatedNode}
|
||||
| {+rotateX: string | AnimatedNode}
|
||||
| {+rotateY: string | AnimatedNode}
|
||||
| {+rotateZ: string | AnimatedNode}
|
||||
| {+scale: number | AnimatedNode}
|
||||
| {+scaleX: number | AnimatedNode}
|
||||
| {+scaleY: number | AnimatedNode}
|
||||
| {+translateX: number | string | AnimatedNode}
|
||||
| {+translateY: number | string | AnimatedNode}
|
||||
| {
|
||||
+translate:
|
||||
| [
|
||||
number | string | AnimatedNode,
|
||||
number | string | AnimatedNode,
|
||||
]
|
||||
| AnimatedNode,
|
||||
}
|
||||
| {+skewX: string | AnimatedNode}
|
||||
| {+skewY: string | AnimatedNode}
|
||||
// TODO: what is the actual type it expects?
|
||||
| {
|
||||
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|
||||
},
|
||||
>,
|
||||
>,
|
||||
>,
|
||||
>
|
||||
| string,
|
||||
/**
|
||||
|
||||
+2
-31
@@ -13,6 +13,7 @@
|
||||
import type {
|
||||
AccessibilityActionEvent,
|
||||
AccessibilityActionInfo,
|
||||
AccessibilityProps,
|
||||
AccessibilityRole,
|
||||
AccessibilityState,
|
||||
Role,
|
||||
@@ -124,20 +125,7 @@ export type TextPropsAndroid = {
|
||||
};
|
||||
|
||||
type TextBaseProps = $ReadOnly<{
|
||||
/**
|
||||
* Indicates whether the view is an accessibility element.
|
||||
*
|
||||
* See https://reactnative.dev/docs/text#accessible
|
||||
*/
|
||||
accessible?: ?boolean,
|
||||
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
||||
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
||||
accessibilityHint?: ?Stringish,
|
||||
accessibilityLanguage?: ?Stringish,
|
||||
accessibilityLabel?: ?Stringish,
|
||||
accessibilityRole?: ?AccessibilityRole,
|
||||
accessibilityState?: ?AccessibilityState,
|
||||
'aria-label'?: ?string,
|
||||
|
||||
/**
|
||||
* Whether fonts should scale to respect Text Size accessibility settings.
|
||||
@@ -152,24 +140,6 @@ type TextBaseProps = $ReadOnly<{
|
||||
*
|
||||
*/
|
||||
android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
|
||||
|
||||
/**
|
||||
* alias for accessibilityState
|
||||
*
|
||||
* see https://reactnative.dev/docs/accessibility#accessibilitystate
|
||||
*/
|
||||
'aria-busy'?: ?boolean,
|
||||
'aria-checked'?: ?boolean | 'mixed',
|
||||
'aria-disabled'?: ?boolean,
|
||||
'aria-expanded'?: ?boolean,
|
||||
'aria-selected'?: ?boolean,
|
||||
|
||||
/**
|
||||
* Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
|
||||
* This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
|
||||
*/
|
||||
'aria-labelledby'?: ?string,
|
||||
|
||||
children?: ?React.Node,
|
||||
|
||||
/**
|
||||
@@ -306,4 +276,5 @@ export type TextProps = $ReadOnly<{
|
||||
...TextPropsIOS,
|
||||
...TextPropsAndroid,
|
||||
...TextBaseProps,
|
||||
...AccessibilityProps,
|
||||
}>;
|
||||
|
||||
@@ -156,10 +156,10 @@ declare export class AnimatedEvent {
|
||||
exports[`public API should not change unintentionally Libraries/Animated/AnimatedExports.js 1`] = `
|
||||
"declare const Animated: typeof AnimatedImplementation;
|
||||
declare export default {
|
||||
get FlatList(): AnimatedFlatList,
|
||||
get FlatList(): AnimatedFlatList<any>,
|
||||
get Image(): AnimatedImage,
|
||||
get ScrollView(): AnimatedScrollView,
|
||||
get SectionList(): AnimatedSectionList,
|
||||
get SectionList(): AnimatedSectionList<any, any>,
|
||||
get Text(): AnimatedText,
|
||||
get View(): AnimatedView,
|
||||
...typeof Animated,
|
||||
@@ -190,7 +190,10 @@ export type { default as AnimatedDivision } from \\"./nodes/AnimatedDivision\\";
|
||||
export type { default as AnimatedModulo } from \\"./nodes/AnimatedModulo\\";
|
||||
export type { default as AnimatedMultiplication } from \\"./nodes/AnimatedMultiplication\\";
|
||||
export type { default as AnimatedSubtraction } from \\"./nodes/AnimatedSubtraction\\";
|
||||
export type { WithAnimatedValue } from \\"./createAnimatedComponent\\";
|
||||
export type {
|
||||
WithAnimatedValue,
|
||||
AnimatedProps,
|
||||
} from \\"./createAnimatedComponent\\";
|
||||
export type { AnimatedComponentType as AnimatedComponent } from \\"./createAnimatedComponent\\";
|
||||
declare export const add: typeof AnimatedImplementation.add;
|
||||
declare export const attachNativeEvent: typeof AnimatedImplementation.attachNativeEvent;
|
||||
@@ -611,10 +614,10 @@ exports[`public API should not change unintentionally Libraries/Animated/bezier.
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Animated/components/AnimatedFlatList.js 1`] = `
|
||||
"declare export default AnimatedComponentType<
|
||||
React.ElementConfig<typeof FlatList>,
|
||||
FlatList<mixed>,
|
||||
>;
|
||||
"declare export default component<ItemT = any>(
|
||||
ref?: React.RefSetter<FlatList<ItemT>>,
|
||||
...props: AnimatedProps<FlatListProps<ItemT>>
|
||||
);
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -638,10 +641,10 @@ declare export default typeof AnimatedScrollView;
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Animated/components/AnimatedSectionList.js 1`] = `
|
||||
"declare export default AnimatedComponentType<
|
||||
React.ElementConfig<typeof SectionList>,
|
||||
SectionList<any, SectionBase<any>>,
|
||||
>;
|
||||
"declare export default component<ItemT = any, SectionT = any>(
|
||||
ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
|
||||
...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
|
||||
);
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -904,7 +907,7 @@ declare export default class AnimatedObject extends AnimatedWithChildren {
|
||||
exports[`public API should not change unintentionally Libraries/Animated/nodes/AnimatedProps.js 1`] = `
|
||||
"export type AnimatedPropsAllowlist = $ReadOnly<{
|
||||
style?: ?AnimatedStyleAllowlist,
|
||||
[string]: true,
|
||||
[key: string]: true | AnimatedStyleAllowlist,
|
||||
}>;
|
||||
type TargetViewInstance = React.ElementRef<React.ElementType>;
|
||||
declare export default class AnimatedProps extends AnimatedNode {
|
||||
@@ -1077,7 +1080,12 @@ exports[`public API should not change unintentionally Libraries/Animated/useAnim
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/AppState/AppState.js 1`] = `
|
||||
"export type AppStateStatus = \\"inactive\\" | \\"background\\" | \\"active\\";
|
||||
"export type AppStateStatus =
|
||||
| \\"inactive\\"
|
||||
| \\"background\\"
|
||||
| \\"active\\"
|
||||
| \\"extension\\"
|
||||
| \\"unknown\\";
|
||||
type AppStateEventDefinitions = {
|
||||
change: [AppStateStatus],
|
||||
memoryWarning: [],
|
||||
@@ -1818,11 +1826,12 @@ declare export default function useAndroidRippleForView(
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js 1`] = `
|
||||
"export type { ProgressBarAndroidProps };
|
||||
type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
|
||||
declare let ProgressBarAndroid: component(
|
||||
ref?: React.RefSetter<
|
||||
React.ElementRef<ProgressBarAndroidNativeComponentType>,
|
||||
>,
|
||||
...props: ProgressBarAndroidProps
|
||||
...props: Omit<ProgressBarAndroidProps, empty>
|
||||
);
|
||||
declare export default typeof ProgressBarAndroid;
|
||||
"
|
||||
@@ -1835,30 +1844,38 @@ declare export default typeof ProgressBarAndroidNativeComponent;
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js 1`] = `
|
||||
"type ProgressBarAndroidStyleAttrProp =
|
||||
| {
|
||||
styleAttr: \\"Horizontal\\",
|
||||
indeterminate: false,
|
||||
progress: number,
|
||||
}
|
||||
| {
|
||||
styleAttr:
|
||||
| \\"Horizontal\\"
|
||||
| \\"Normal\\"
|
||||
| \\"Small\\"
|
||||
| \\"Large\\"
|
||||
| \\"Inverse\\"
|
||||
| \\"SmallInverse\\"
|
||||
| \\"LargeInverse\\",
|
||||
indeterminate: true,
|
||||
};
|
||||
export type ProgressBarAndroidProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidStyleAttrProp,
|
||||
"type DeterminateProgressBarAndroidStyleAttrProp = {
|
||||
styleAttr: \\"Horizontal\\",
|
||||
indeterminate: false,
|
||||
progress: number,
|
||||
};
|
||||
type IndeterminateProgressBarAndroidStyleAttrProp = {
|
||||
styleAttr:
|
||||
| \\"Horizontal\\"
|
||||
| \\"Normal\\"
|
||||
| \\"Small\\"
|
||||
| \\"Large\\"
|
||||
| \\"Inverse\\"
|
||||
| \\"SmallInverse\\"
|
||||
| \\"LargeInverse\\",
|
||||
indeterminate: true,
|
||||
};
|
||||
type ProgressBarAndroidBaseProps = $ReadOnly<{
|
||||
animating?: ?boolean,
|
||||
color?: ?ColorValue,
|
||||
testID?: ?string,
|
||||
}>;
|
||||
export type ProgressBarAndroidProps =
|
||||
| $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidBaseProps,
|
||||
...DeterminateProgressBarAndroidStyleAttrProp,
|
||||
}>
|
||||
| $ReadOnly<{
|
||||
...ViewProps,
|
||||
...ProgressBarAndroidBaseProps,
|
||||
...IndeterminateProgressBarAndroidStyleAttrProp,
|
||||
}>;
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -4152,7 +4169,7 @@ declare export default class NativeEventEmitter<
|
||||
> = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
||||
> implements IEventEmitter<TEventToArgsMap>
|
||||
{
|
||||
constructor(nativeModule: ?NativeModule): void;
|
||||
constructor(nativeModule?: ?NativeModule): void;
|
||||
addListener<TEvent: $Keys<TEventToArgsMap>>(
|
||||
eventType: TEvent,
|
||||
listener: (...args: TEventToArgsMap[TEvent]) => mixed,
|
||||
@@ -4202,6 +4219,19 @@ exports[`public API should not change unintentionally Libraries/Image/AssetSourc
|
||||
+uri: string,
|
||||
+scale: number,
|
||||
};
|
||||
type AssetDestPathResolver = \\"android\\" | \\"generic\\";
|
||||
type PackagerAsset = $ReadOnly<{
|
||||
fileSystemLocation: string,
|
||||
httpServerLocation: string,
|
||||
width: ?number,
|
||||
height: ?number,
|
||||
scales: Array<number>,
|
||||
hash: string,
|
||||
name: string,
|
||||
type: string,
|
||||
resolver?: AssetDestPathResolver,
|
||||
...
|
||||
}>;
|
||||
declare class AssetSourceResolver {
|
||||
serverUrl: ?string;
|
||||
jsbundleUrl: ?string;
|
||||
@@ -7080,7 +7110,9 @@ declare export const setStyleAttributePreprocessor: (
|
||||
property: string,
|
||||
process: (nextProp: any) => any
|
||||
) => void;
|
||||
declare export const create: <+S: ____Styles_Internal>(obj: S) => $ReadOnly<S>;
|
||||
declare export const create: <+S: ____Styles_Internal>(
|
||||
obj: S & ____Styles_Internal
|
||||
) => $ReadOnly<S>;
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -7485,7 +7517,8 @@ export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
overlayColor?: ColorValue,
|
||||
overflow?: \\"visible\\" | \\"hidden\\",
|
||||
}>;
|
||||
export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
...____ImageStyle_InternalCore,
|
||||
@@ -7496,7 +7529,7 @@ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
overlayColor?: ColorValue,
|
||||
}>;
|
||||
export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
|
||||
...____DangerouslyImpreciseStyle_InternalCore,
|
||||
@@ -7580,29 +7613,52 @@ export type ____ViewStyle_InternalOverrides = $ReadOnly<{}>;
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/StyleSheet/private/_TransformStyle.js 1`] = `
|
||||
"export type ____TransformStyle_Internal = $ReadOnly<{
|
||||
"type KeysOfUnion<T> = T extends any ? $Keys<T> : empty;
|
||||
type ValueOfUnion<T, K> = T extends any
|
||||
? K extends $Keys<T>
|
||||
? T[K]
|
||||
: empty
|
||||
: empty;
|
||||
type MergeUnion<T> = {
|
||||
[K in KeysOfUnion<T>]?: ValueOfUnion<T, K>,
|
||||
};
|
||||
type MaximumOneOf<T: { ... }> = $Values<{
|
||||
[K in keyof T]: $Exact<{
|
||||
[P in keyof T]?: P extends K ? T[P] : empty,
|
||||
}>,
|
||||
}>;
|
||||
export type ____TransformStyle_Internal = $ReadOnly<{
|
||||
transform?:
|
||||
| $ReadOnlyArray<
|
||||
| { +perspective: number | AnimatedNode }
|
||||
| { +rotate: string | AnimatedNode }
|
||||
| { +rotateX: string | AnimatedNode }
|
||||
| { +rotateY: string | AnimatedNode }
|
||||
| { +rotateZ: string | AnimatedNode }
|
||||
| { +scale: number | AnimatedNode }
|
||||
| { +scaleX: number | AnimatedNode }
|
||||
| { +scaleY: number | AnimatedNode }
|
||||
| { +translateX: number | string | AnimatedNode }
|
||||
| { +translateY: number | string | AnimatedNode }
|
||||
| {
|
||||
+translate:
|
||||
| [number | string | AnimatedNode, number | string | AnimatedNode]
|
||||
| AnimatedNode,
|
||||
}
|
||||
| { +skewX: string | AnimatedNode }
|
||||
| { +skewY: string | AnimatedNode }
|
||||
| {
|
||||
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|
||||
},
|
||||
$ReadOnly<
|
||||
MaximumOneOf<
|
||||
MergeUnion<
|
||||
| { +perspective: number | AnimatedNode }
|
||||
| { +rotate: string | AnimatedNode }
|
||||
| { +rotateX: string | AnimatedNode }
|
||||
| { +rotateY: string | AnimatedNode }
|
||||
| { +rotateZ: string | AnimatedNode }
|
||||
| { +scale: number | AnimatedNode }
|
||||
| { +scaleX: number | AnimatedNode }
|
||||
| { +scaleY: number | AnimatedNode }
|
||||
| { +translateX: number | string | AnimatedNode }
|
||||
| { +translateY: number | string | AnimatedNode }
|
||||
| {
|
||||
+translate:
|
||||
| [
|
||||
number | string | AnimatedNode,
|
||||
number | string | AnimatedNode,
|
||||
]
|
||||
| AnimatedNode,
|
||||
}
|
||||
| { +skewX: string | AnimatedNode }
|
||||
| { +skewY: string | AnimatedNode }
|
||||
| {
|
||||
+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
|
||||
},
|
||||
>,
|
||||
>,
|
||||
>,
|
||||
>
|
||||
| string,
|
||||
transformOrigin?:
|
||||
@@ -7818,23 +7874,9 @@ export type TextPropsAndroid = {
|
||||
minimumFontScale?: ?number,
|
||||
};
|
||||
type TextBaseProps = $ReadOnly<{
|
||||
accessible?: ?boolean,
|
||||
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
||||
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
||||
accessibilityHint?: ?Stringish,
|
||||
accessibilityLanguage?: ?Stringish,
|
||||
accessibilityLabel?: ?Stringish,
|
||||
accessibilityRole?: ?AccessibilityRole,
|
||||
accessibilityState?: ?AccessibilityState,
|
||||
\\"aria-label\\"?: ?string,
|
||||
allowFontScaling?: ?boolean,
|
||||
android_hyphenationFrequency?: ?(\\"normal\\" | \\"none\\" | \\"full\\"),
|
||||
\\"aria-busy\\"?: ?boolean,
|
||||
\\"aria-checked\\"?: ?boolean | \\"mixed\\",
|
||||
\\"aria-disabled\\"?: ?boolean,
|
||||
\\"aria-expanded\\"?: ?boolean,
|
||||
\\"aria-selected\\"?: ?boolean,
|
||||
\\"aria-labelledby\\"?: ?string,
|
||||
children?: ?React.Node,
|
||||
ellipsizeMode?: ?(\\"clip\\" | \\"head\\" | \\"middle\\" | \\"tail\\"),
|
||||
id?: string,
|
||||
@@ -7865,6 +7907,7 @@ export type TextProps = $ReadOnly<{
|
||||
...TextPropsIOS,
|
||||
...TextPropsAndroid,
|
||||
...TextBaseProps,
|
||||
...AccessibilityProps,
|
||||
}>;
|
||||
"
|
||||
`;
|
||||
@@ -8892,8 +8935,33 @@ declare export default typeof rejectionTrackingOptions;
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/vendor/core/ErrorUtils.js 1`] = `
|
||||
"export type ErrorUtils = ErrorUtilsT;
|
||||
declare export default ErrorUtilsT;
|
||||
"type ErrorHandler = (error: mixed, isFatal: boolean) => void;
|
||||
type Fn<Args: $ReadOnlyArray<mixed>, Return> = (...Args) => Return;
|
||||
export type ErrorUtils = {
|
||||
applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
context?: mixed,
|
||||
args?: ?TArgs,
|
||||
unused_onError?: null,
|
||||
unused_name?: ?string
|
||||
): ?TOut,
|
||||
applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
context?: mixed,
|
||||
args?: ?TArgs
|
||||
): ?TOut,
|
||||
getGlobalHandler(): ErrorHandler,
|
||||
guard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
name?: ?string,
|
||||
context?: mixed
|
||||
): ?(...TArgs) => ?TOut,
|
||||
inGuard(): boolean,
|
||||
reportError(error: mixed): void,
|
||||
reportFatalError(error: mixed): void,
|
||||
setGlobalHandler(fun: ErrorHandler): void,
|
||||
};
|
||||
declare export default ErrorUtils;
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -9010,6 +9078,7 @@ export type {
|
||||
SectionListProps,
|
||||
SectionListRenderItem,
|
||||
SectionListRenderItemInfo,
|
||||
SectionListData,
|
||||
} from \\"./Libraries/Lists/SectionList\\";
|
||||
export { default as SectionList } from \\"./Libraries/Lists/SectionList\\";
|
||||
export type {
|
||||
|
||||
+28
-4
@@ -8,9 +8,33 @@
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
import type {ErrorUtilsT} from '@react-native/js-polyfills/error-guard';
|
||||
|
||||
export type ErrorUtils = ErrorUtilsT;
|
||||
// From @react-native/js-polyfills
|
||||
type ErrorHandler = (error: mixed, isFatal: boolean) => void;
|
||||
type Fn<Args: $ReadOnlyArray<mixed>, Return> = (...Args) => Return;
|
||||
export type ErrorUtils = {
|
||||
applyWithGuard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
context?: mixed,
|
||||
args?: ?TArgs,
|
||||
unused_onError?: null,
|
||||
unused_name?: ?string,
|
||||
): ?TOut,
|
||||
applyWithGuardIfNeeded<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
context?: mixed,
|
||||
args?: ?TArgs,
|
||||
): ?TOut,
|
||||
getGlobalHandler(): ErrorHandler,
|
||||
guard<TArgs: $ReadOnlyArray<mixed>, TOut>(
|
||||
fun: Fn<TArgs, TOut>,
|
||||
name?: ?string,
|
||||
context?: mixed,
|
||||
): ?(...TArgs) => ?TOut,
|
||||
inGuard(): boolean,
|
||||
reportError(error: mixed): void,
|
||||
reportFatalError(error: mixed): void,
|
||||
setGlobalHandler(fun: ErrorHandler): void,
|
||||
};
|
||||
|
||||
/**
|
||||
* The particular require runtime that we are using looks for a global
|
||||
@@ -24,4 +48,4 @@ export type ErrorUtils = ErrorUtilsT;
|
||||
* that use it aren't just using a global variable, so simply export the global
|
||||
* variable here. ErrorUtils is originally defined in a file named error-guard.js.
|
||||
*/
|
||||
export default (global.ErrorUtils: ErrorUtilsT);
|
||||
export default global.ErrorUtils as ErrorUtils;
|
||||
|
||||
@@ -21,8 +21,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(80),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
|
||||
+18
-4
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
||||
|
||||
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
{
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
if (_adapter && index == _adapter.paperView.reactSubviews.count) {
|
||||
// This is a new child view that is being added to the end of the children array.
|
||||
// After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
|
||||
// Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
|
||||
// called and the `finalizeUpdate` is not invoked.
|
||||
if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
||||
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
|
||||
[_adapter.paperView insertReactSubview:target atIndex:index];
|
||||
} else {
|
||||
[_adapter.paperView insertReactSubview:childComponentView atIndex:index];
|
||||
}
|
||||
[_adapter.paperView didUpdateReactSubviews];
|
||||
} else {
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
|
||||
@@ -2006,7 +2006,7 @@ public final class com/facebook/react/devsupport/DefaultDevLoadingViewImplementa
|
||||
public final fun setDevLoadingEnabled (Z)V
|
||||
}
|
||||
|
||||
public final class com/facebook/react/devsupport/DevServerHelper {
|
||||
public class com/facebook/react/devsupport/DevServerHelper {
|
||||
public fun <init> (Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;Landroid/content/Context;Lcom/facebook/react/packagerconnection/PackagerConnectionSettings;)V
|
||||
public final fun closeInspectorConnection ()V
|
||||
public final fun closePackagerConnection ()V
|
||||
@@ -2015,12 +2015,12 @@ public final class com/facebook/react/devsupport/DevServerHelper {
|
||||
public final fun downloadBundleFromURL (Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;)V
|
||||
public static synthetic fun downloadBundleFromURL$default (Lcom/facebook/react/devsupport/DevServerHelper;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;Ljava/io/File;Ljava/lang/String;Lcom/facebook/react/devsupport/BundleDownloader$BundleInfo;Lokhttp3/Request$Builder;ILjava/lang/Object;)V
|
||||
public final fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
|
||||
public final fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
||||
public final fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
||||
public final fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public final fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public fun getDevServerBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
||||
public fun getDevServerSplitBundleURL (Ljava/lang/String;)Ljava/lang/String;
|
||||
public fun getSourceMapUrl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public fun getSourceUrl (Ljava/lang/String;)Ljava/lang/String;
|
||||
public final fun getWebsocketProxyURL ()Ljava/lang/String;
|
||||
public final fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
|
||||
public fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
|
||||
public final fun openDebugger (Lcom/facebook/react/bridge/ReactContext;Ljava/lang/String;)V
|
||||
public final fun openInspectorConnection ()V
|
||||
public final fun openPackagerConnection (Ljava/lang/String;Lcom/facebook/react/devsupport/DevServerHelper$PackagerCommandListener;)V
|
||||
@@ -4656,7 +4656,7 @@ public abstract class com/facebook/react/uimanager/ViewGroupManager : com/facebo
|
||||
public fun getShadowNodeClass ()Ljava/lang/Class;
|
||||
public static final fun getViewZIndex (Landroid/view/View;)Ljava/lang/Integer;
|
||||
public fun needsCustomLayoutForChildren ()Z
|
||||
public final fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
|
||||
public fun removeView (Landroid/view/ViewGroup;Landroid/view/View;)V
|
||||
public synthetic fun removeViewAt (Landroid/view/View;I)V
|
||||
public fun removeViewAt (Landroid/view/ViewGroup;I)V
|
||||
public static final fun setViewZIndex (Landroid/view/View;I)V
|
||||
@@ -5123,13 +5123,13 @@ public final class com/facebook/react/uimanager/events/TouchEventType$Companion
|
||||
public final fun getJSEventName (Lcom/facebook/react/uimanager/events/TouchEventType;)Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class com/facebook/react/uimanager/layoutanimation/LayoutAnimationController {
|
||||
public class com/facebook/react/uimanager/layoutanimation/LayoutAnimationController {
|
||||
public fun <init> ()V
|
||||
public final fun applyLayoutUpdate (Landroid/view/View;IIII)V
|
||||
public final fun deleteView (Landroid/view/View;Lcom/facebook/react/uimanager/layoutanimation/LayoutAnimationListener;)V
|
||||
public fun applyLayoutUpdate (Landroid/view/View;IIII)V
|
||||
public fun deleteView (Landroid/view/View;Lcom/facebook/react/uimanager/layoutanimation/LayoutAnimationListener;)V
|
||||
public final fun initializeFromConfig (Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Callback;)V
|
||||
public final fun reset ()V
|
||||
public final fun shouldAnimateLayout (Landroid/view/View;)Z
|
||||
public fun reset ()V
|
||||
public fun shouldAnimateLayout (Landroid/view/View;)Z
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener {
|
||||
@@ -6565,7 +6565,6 @@ public class com/facebook/react/views/textinput/ReactEditText : androidx/appcomp
|
||||
public fun addTextChangedListener (Landroid/text/TextWatcher;)V
|
||||
protected final fun applyTextAttributes ()V
|
||||
public final fun canUpdateWithEventCount (I)Z
|
||||
public fun clearFocus ()V
|
||||
protected final fun finalize ()V
|
||||
public final fun getBorderColor (I)I
|
||||
protected final fun getContainsImages ()Z
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0
|
||||
VERSION_NAME=0.80.0
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+20
@@ -11,11 +11,13 @@ import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
||||
import com.facebook.react.modules.core.PermissionAwareActivity;
|
||||
import com.facebook.react.modules.core.PermissionListener;
|
||||
import com.facebook.react.util.AndroidVersion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/** Base Activity for React Native applications. */
|
||||
@@ -24,6 +26,18 @@ public abstract class ReactActivity extends AppCompatActivity
|
||||
|
||||
private final ReactActivityDelegate mDelegate;
|
||||
|
||||
// Due to enforced predictive back on targetSdk 36, 'onBackPressed()' is disabled by default.
|
||||
// Using a workaround to trigger it manually.
|
||||
private final OnBackPressedCallback mBackPressedCallback =
|
||||
new OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
setEnabled(false);
|
||||
onBackPressed();
|
||||
setEnabled(true);
|
||||
}
|
||||
};
|
||||
|
||||
protected ReactActivity() {
|
||||
mDelegate = createReactActivityDelegate();
|
||||
}
|
||||
@@ -45,6 +59,9 @@ public abstract class ReactActivity extends AppCompatActivity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mDelegate.onCreate(savedInstanceState);
|
||||
if (AndroidVersion.isAtLeastTargetSdk36(this)) {
|
||||
getOnBackPressedDispatcher().addCallback(this, mBackPressedCallback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +120,9 @@ public abstract class ReactActivity extends AppCompatActivity
|
||||
|
||||
@Override
|
||||
public void invokeDefaultOnBackPressed() {
|
||||
// Disabling callback so the fallback logic (finish activity) can run
|
||||
// as super.onBackPressed() will call all enabled callbacks in the dispatcher.
|
||||
mBackPressedCallback.setEnabled(false);
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -59,7 +59,7 @@ import okio.Okio
|
||||
*/
|
||||
@SuppressLint(
|
||||
"StaticFieldLeak") // TODO: This entire class should be rewritten to don't use AsyncTask
|
||||
public class DevServerHelper(
|
||||
public open class DevServerHelper(
|
||||
private val settings: DeveloperSettings,
|
||||
private val applicationContext: Context,
|
||||
private val packagerConnectionSettings: PackagerConnectionSettings
|
||||
@@ -287,20 +287,20 @@ public class DevServerHelper(
|
||||
additionalOptionsBuilder.toString())
|
||||
}
|
||||
|
||||
public fun getDevServerBundleURL(jsModulePath: String): String =
|
||||
public open fun getDevServerBundleURL(jsModulePath: String): String =
|
||||
createBundleURL(jsModulePath, BundleType.BUNDLE, packagerConnectionSettings.debugServerHost)
|
||||
|
||||
public fun getDevServerSplitBundleURL(jsModulePath: String): String =
|
||||
public open fun getDevServerSplitBundleURL(jsModulePath: String): String =
|
||||
createSplitBundleURL(jsModulePath, packagerConnectionSettings.debugServerHost)
|
||||
|
||||
public fun isPackagerRunning(callback: PackagerStatusCallback) {
|
||||
public open fun isPackagerRunning(callback: PackagerStatusCallback) {
|
||||
packagerStatusCheck.run(packagerConnectionSettings.debugServerHost, callback)
|
||||
}
|
||||
|
||||
public fun getSourceMapUrl(mainModuleName: String): String =
|
||||
public open fun getSourceMapUrl(mainModuleName: String): String =
|
||||
createBundleURL(mainModuleName, BundleType.MAP)
|
||||
|
||||
public fun getSourceUrl(mainModuleName: String): String =
|
||||
public open fun getSourceUrl(mainModuleName: String): String =
|
||||
createBundleURL(mainModuleName, BundleType.BUNDLE)
|
||||
|
||||
/**
|
||||
|
||||
-2
@@ -18,7 +18,5 @@ public class ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android(
|
||||
|
||||
override fun useTurboModules(): Boolean = bridgelessEnabled || turboModulesEnabled
|
||||
|
||||
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = true
|
||||
|
||||
override fun useShadowNodeStateOnClone(): Boolean = true
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ package com.facebook.react.modules.systeminfo
|
||||
public object ReactNativeVersion {
|
||||
@JvmField
|
||||
public val VERSION: Map<String, Any?> = mapOf(
|
||||
"major" to 1000,
|
||||
"minor" to 0,
|
||||
"major" to 0,
|
||||
"minor" to 80,
|
||||
"patch" to 0,
|
||||
"prerelease" to null
|
||||
)
|
||||
|
||||
+2
-2
@@ -462,9 +462,9 @@ public class NativeViewHierarchyOptimizer {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadableMapKeySetIterator keyIterator = props.backingMap.keySetIterator();
|
||||
ReadableMapKeySetIterator keyIterator = props.internal_backingMap().keySetIterator();
|
||||
while (keyIterator.hasNextKey()) {
|
||||
if (!ViewProps.isLayoutOnly(props.backingMap, keyIterator.nextKey())) {
|
||||
if (!ViewProps.isLayoutOnly(props.internal_backingMap(), keyIterator.nextKey())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -31,7 +31,12 @@ import com.facebook.react.bridge.ReadableMap
|
||||
*/
|
||||
public class ReactStylesDiffMap(props: ReadableMap) {
|
||||
|
||||
@JvmField internal val backingMap: ReadableMap = props
|
||||
/**
|
||||
* This backing map is annotated as JvmName("internal_backingMap") so can be accessed by Java
|
||||
* consumers. This is used in Expo to override setting properties in some subclassed view-manager
|
||||
* as this provides faster access to the underlying values.
|
||||
*/
|
||||
@get:JvmName("internal_backingMap") internal val backingMap: ReadableMap = props
|
||||
|
||||
public fun toMap(): Map<String, Any?> = backingMap.toHashMap()
|
||||
|
||||
|
||||
+6
-1
@@ -49,7 +49,12 @@ constructor(reactContext: ReactApplicationContext? = null) :
|
||||
parent.removeViewAt(index)
|
||||
}
|
||||
|
||||
public fun removeView(parent: T, view: View) {
|
||||
/**
|
||||
* Expo overrides this function GroupViewManagerWrapper.kt`, which is a replacement view manager
|
||||
* adding support for delegates receiving callbacks whenever one of the methods in the view
|
||||
* manager are called.
|
||||
*/
|
||||
public open fun removeView(parent: T, view: View) {
|
||||
UiThreadUtil.assertOnUiThread()
|
||||
|
||||
for (i in 0 until getChildCount(parent)) {
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
|
||||
*/
|
||||
public void updateProperties(@NonNull T viewToUpdate, ReactStylesDiffMap props) {
|
||||
ViewManagerDelegate<T> delegate = getOrCreateViewManagerDelegate();
|
||||
Iterator<Map.Entry<String, Object>> iterator = props.backingMap.getEntryIterator();
|
||||
Iterator<Map.Entry<String, Object>> iterator = props.internal_backingMap().getEntryIterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, Object> entry = iterator.next();
|
||||
delegate.setProperty(viewToUpdate, entry.getKey(), entry.getValue());
|
||||
|
||||
+5
-5
@@ -29,7 +29,7 @@ import javax.annotation.concurrent.NotThreadSafe
|
||||
*/
|
||||
@NotThreadSafe
|
||||
@LegacyArchitecture
|
||||
public class LayoutAnimationController {
|
||||
public open class LayoutAnimationController {
|
||||
private val layoutCreateAnimation: AbstractLayoutAnimation = LayoutCreateAnimation()
|
||||
private val layoutUpdateAnimation: AbstractLayoutAnimation = LayoutUpdateAnimation()
|
||||
private val layoutDeleteAnimation: AbstractLayoutAnimation = LayoutDeleteAnimation()
|
||||
@@ -68,7 +68,7 @@ public class LayoutAnimationController {
|
||||
}
|
||||
}
|
||||
|
||||
public fun reset() {
|
||||
public open fun reset() {
|
||||
layoutCreateAnimation.reset()
|
||||
layoutUpdateAnimation.reset()
|
||||
layoutDeleteAnimation.reset()
|
||||
@@ -83,7 +83,7 @@ public class LayoutAnimationController {
|
||||
}
|
||||
}
|
||||
|
||||
public fun shouldAnimateLayout(viewToAnimate: View?): Boolean {
|
||||
public open fun shouldAnimateLayout(viewToAnimate: View?): Boolean {
|
||||
// if view parent is null, skip animation: view have been clipped, we don't want animation to
|
||||
// resume when view is re-attached to parent, which is the standard android animation behavior.
|
||||
// If there's a layout handling animation going on, it should be animated nonetheless since the
|
||||
@@ -106,7 +106,7 @@ public class LayoutAnimationController {
|
||||
* @param width the new width value for the view
|
||||
* @param height the new height value for the view
|
||||
*/
|
||||
public fun applyLayoutUpdate(view: View, x: Int, y: Int, width: Int, height: Int) {
|
||||
public open fun applyLayoutUpdate(view: View, x: Int, y: Int, width: Int, height: Int) {
|
||||
assertOnUiThread()
|
||||
|
||||
val reactTag = view.id
|
||||
@@ -167,7 +167,7 @@ public class LayoutAnimationController {
|
||||
* @param listener Called once the animation is finished, should be used to completely remove the
|
||||
* view.
|
||||
*/
|
||||
public fun deleteView(view: View, listener: LayoutAnimationListener) {
|
||||
public open fun deleteView(view: View, listener: LayoutAnimationListener) {
|
||||
assertOnUiThread()
|
||||
|
||||
val animation =
|
||||
|
||||
+2
-2
@@ -143,11 +143,11 @@ internal data class BorderRadiusStyle(
|
||||
CornerRadii(it, width, height)
|
||||
} ?: zeroRadii,
|
||||
bottomLeft =
|
||||
(endEnd ?: bottomStart ?: bottomRight ?: uniform)?.let {
|
||||
(endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.let {
|
||||
CornerRadii(it, width, height)
|
||||
} ?: zeroRadii,
|
||||
bottomRight =
|
||||
(startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.let {
|
||||
(startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.let {
|
||||
CornerRadii(it, width, height)
|
||||
} ?: zeroRadii,
|
||||
width = width,
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.util
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
|
||||
/** Helper class for checking Android version-related information. */
|
||||
internal object AndroidVersion {
|
||||
|
||||
/**
|
||||
* This is the version code for Android 16 (SDK Level 36). Delete it once we bump up the default
|
||||
* compile SDK version to 36.
|
||||
*/
|
||||
private const val VERSION_CODE_BAKLAVA: Int = 36
|
||||
|
||||
/**
|
||||
* This method is used to check if the current device is running Android 16 (SDK Level 36) or
|
||||
* higher and the app is targeting Android 16 (SDK Level 36) or higher.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun isAtLeastTargetSdk36(context: Context): Boolean =
|
||||
Build.VERSION.SDK_INT >= VERSION_CODE_BAKLAVA &&
|
||||
context.applicationInfo.targetSdkVersion >= VERSION_CODE_BAKLAVA
|
||||
}
|
||||
+31
-17
@@ -20,11 +20,12 @@ import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewStructure
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import android.view.accessibility.AccessibilityEvent
|
||||
import android.view.accessibility.AccessibilityNodeInfo
|
||||
import android.widget.FrameLayout
|
||||
import androidx.activity.ComponentDialog
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
@@ -49,10 +50,10 @@ import com.facebook.react.uimanager.ThemedReactContext
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.events.EventDispatcher
|
||||
import com.facebook.react.views.common.ContextUtils
|
||||
import com.facebook.react.views.modal.ReactModalHostView.DialogRootViewGroup
|
||||
import com.facebook.react.views.view.ReactViewGroup
|
||||
import com.facebook.react.views.view.setStatusBarTranslucency
|
||||
import com.facebook.react.views.view.setSystemBarsTranslucency
|
||||
import java.util.Objects
|
||||
|
||||
/**
|
||||
* ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.
|
||||
@@ -71,7 +72,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
ViewGroup(context), LifecycleEventListener {
|
||||
|
||||
@get:VisibleForTesting
|
||||
public var dialog: Dialog? = null
|
||||
public var dialog: ComponentDialog? = null
|
||||
private set
|
||||
|
||||
public var transparent: Boolean = false
|
||||
@@ -260,17 +261,34 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
}
|
||||
|
||||
val currentActivity = getCurrentActivity()
|
||||
val newDialog = Dialog(currentActivity ?: context, theme)
|
||||
val newDialog = ComponentDialog(currentActivity ?: context, theme)
|
||||
dialog = newDialog
|
||||
Objects.requireNonNull<Window>(newDialog.window)
|
||||
.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
val window = requireNotNull(newDialog.window)
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
|
||||
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
|
||||
newDialog.setContentView(contentView)
|
||||
updateProperties()
|
||||
|
||||
newDialog.setOnShowListener(onShowListener)
|
||||
|
||||
val handleCloseAction: () -> Unit = {
|
||||
val listener =
|
||||
checkNotNull(onRequestCloseListener) {
|
||||
"onRequestClose callback must be set if back key is expected to close the modal"
|
||||
}
|
||||
listener.onRequestClose(newDialog)
|
||||
}
|
||||
|
||||
val backPressedCallback: OnBackPressedCallback =
|
||||
object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
handleCloseAction()
|
||||
}
|
||||
}
|
||||
|
||||
newDialog.onBackPressedDispatcher.addCallback(newDialog, backPressedCallback)
|
||||
newDialog.setOnKeyListener(
|
||||
object : DialogInterface.OnKeyListener {
|
||||
override fun onKey(dialog: DialogInterface, keyCode: Int, event: KeyEvent): Boolean {
|
||||
@@ -280,11 +298,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
// to whether or not to allow the back/escape key to close the dialog. If it chooses
|
||||
// to, it can just set visible to false on the Modal and the Modal will go away
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) {
|
||||
val listener =
|
||||
checkNotNull(onRequestCloseListener) {
|
||||
"onRequestClose callback must be set if back key is expected to close the modal"
|
||||
}
|
||||
listener.onRequestClose(dialog)
|
||||
handleCloseAction()
|
||||
return true
|
||||
} else {
|
||||
// We redirect the rest of the key events to the current activity, since the
|
||||
@@ -301,19 +315,19 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
}
|
||||
})
|
||||
|
||||
newDialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
|
||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
|
||||
if (hardwareAccelerated) {
|
||||
newDialog.window?.addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
|
||||
}
|
||||
val flagSecureSet = isFlagSecureSet(currentActivity)
|
||||
if (flagSecureSet) {
|
||||
newDialog.window?.setFlags(
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
|
||||
}
|
||||
if (currentActivity?.isFinishing == false) {
|
||||
newDialog.show()
|
||||
updateSystemAppearance()
|
||||
newDialog.window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-6
@@ -35,6 +35,7 @@ import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.accessibility.AccessibilityNodeInfo
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputConnection
|
||||
@@ -359,11 +360,26 @@ public open class ReactEditText public constructor(context: Context) : AppCompat
|
||||
super.onTextContextMenuItem(
|
||||
if (id == android.R.id.paste) android.R.id.pasteAsPlainText else id)
|
||||
|
||||
override fun clearFocus() {
|
||||
super.clearFocus()
|
||||
internal fun clearFocusAndMaybeRefocus() {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P || !isInTouchMode) {
|
||||
super.clearFocus()
|
||||
} else {
|
||||
// Avoid refocusing to a new view on old versions of Android by default
|
||||
// by preventing `requestFocus()` on the rootView from moving focus to any child.
|
||||
// https://cs.android.com/android/_/android/platform/frameworks/base/+/bdc66cb5a0ef513f4306edf9156cc978b08e06e4
|
||||
val rootViewGroup = rootView as ViewGroup
|
||||
val oldDescendantFocusability = rootViewGroup.descendantFocusability
|
||||
rootViewGroup.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
super.clearFocus()
|
||||
rootViewGroup.descendantFocusability = oldDescendantFocusability
|
||||
}
|
||||
hideSoftKeyboard()
|
||||
}
|
||||
|
||||
internal fun clearFocusFromJS() {
|
||||
clearFocusAndMaybeRefocus()
|
||||
}
|
||||
|
||||
// For cases like autoFocus, or ref.focus() where we request focus programmatically and not
|
||||
// through
|
||||
// interacting with the EditText directly (like clicking on it). We cannot use stock
|
||||
@@ -598,10 +614,6 @@ public open class ReactEditText public constructor(context: Context) : AppCompat
|
||||
requestFocusProgrammatically()
|
||||
}
|
||||
|
||||
internal fun clearFocusFromJS() {
|
||||
clearFocus()
|
||||
}
|
||||
|
||||
public fun incrementAndGetEventCounter(): Int = ++nativeEventCount
|
||||
|
||||
public fun maybeSetTextFromJS(reactTextUpdate: ReactTextUpdate) {
|
||||
|
||||
+1
-1
@@ -926,7 +926,7 @@ public open class ReactTextInputManager public constructor() :
|
||||
}
|
||||
|
||||
if (shouldBlur) {
|
||||
editText.clearFocus()
|
||||
editText.clearFocusAndMaybeRefocus()
|
||||
}
|
||||
|
||||
// Prevent default behavior except when we want it to insert a newline.
|
||||
|
||||
+2
-2
@@ -95,13 +95,13 @@ class BorderRadiusStyleTest {
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_END_END_RADIUS),
|
||||
ComputedBorderRadiusProp.COMPUTED_BORDER_BOTTOM_RIGHT_RADIUS to
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_LEFT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_START_END_RADIUS),
|
||||
)
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
#define REACT_NATIVE_VERSION_MAJOR 1000
|
||||
#define REACT_NATIVE_VERSION_MINOR 0
|
||||
#define REACT_NATIVE_VERSION_MAJOR 0
|
||||
#define REACT_NATIVE_VERSION_MINOR 80
|
||||
#define REACT_NATIVE_VERSION_PATCH 0
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 1000;
|
||||
int32_t Minor = 0;
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 80;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
@@ -32,6 +32,6 @@ Pod::Spec.new do |s|
|
||||
s.dependency "React-jsi", version
|
||||
|
||||
s.subspec "Fabric" do |ss|
|
||||
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)" }
|
||||
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)", "DEFINES_MODULE" => "YES" }
|
||||
end
|
||||
end
|
||||
|
||||
-3
@@ -26,9 +26,6 @@ class ReactNativeFeatureFlagsOverridesOSSStable
|
||||
bool useNativeViewConfigsInBridgelessMode() override {
|
||||
return true;
|
||||
}
|
||||
bool updateRuntimeShadowNodeReferencesOnCommit() override {
|
||||
return true;
|
||||
}
|
||||
bool useShadowNodeStateOnClone() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -242,8 +242,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
|
||||
}
|
||||
|
||||
if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
|
||||
// Do not throw any error to match web spec
|
||||
return timerIndex_++;
|
||||
// Do not throw any error to match web spec; instead return 0, an
|
||||
// invalid timer id
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto callback = args[0].getObject(rt).getFunction(rt);
|
||||
@@ -300,8 +301,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
|
||||
}
|
||||
|
||||
if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
|
||||
throw jsi::JSError(
|
||||
rt, "The first argument to setInterval must be a function.");
|
||||
// Do not throw any error to match web spec; instead return 0, an
|
||||
// invalid timer id
|
||||
return 0;
|
||||
}
|
||||
auto callback = args[0].getObject(rt).getFunction(rt);
|
||||
auto delay = count > 1
|
||||
|
||||
@@ -93,7 +93,9 @@ class TimerManager {
|
||||
|
||||
// Each timeout that is registered on this queue gets a sequential id. This
|
||||
// is the global count from which those are assigned.
|
||||
TimerHandle timerIndex_{0};
|
||||
// As per WHATWG HTML 8.6.1 (Timers) ids must be greater than zero, i.e. start
|
||||
// at 1
|
||||
TimerHandle timerIndex_{1};
|
||||
|
||||
// The React Native microtask queue is used to back public APIs including
|
||||
// `queueMicrotask`, `clearImmediate`, and `setImmediate` (which is used by
|
||||
|
||||
@@ -267,7 +267,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithoutDelay) {
|
||||
EXPECT_CALL(
|
||||
*mockRegistry_,
|
||||
createTimer(_, 0)); // If delay is not provided, it should use 0
|
||||
eval("setTimeout(() => {});");
|
||||
auto val = eval("setTimeout(() => {});");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 1); // First timer id should start at 1
|
||||
}
|
||||
|
||||
TEST_F(ReactInstanceTest, testSetTimeoutWithPassThroughArgs) {
|
||||
@@ -299,8 +301,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithInvalidArgs) {
|
||||
getErrorMessage("setTimeout();"),
|
||||
"setTimeout must be called with at least one argument (the function to call).");
|
||||
|
||||
eval("setTimeout('invalid');");
|
||||
auto val = eval("setTimeout('invalid')");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 0);
|
||||
|
||||
eval("setTimeout(() => {}, 'invalid');");
|
||||
expectNoError();
|
||||
@@ -417,9 +420,10 @@ TEST_F(ReactInstanceTest, testSetIntervalWithInvalidArgs) {
|
||||
EXPECT_EQ(
|
||||
getErrorMessage("setInterval();"),
|
||||
"setInterval must be called with at least one argument (the function to call).");
|
||||
EXPECT_EQ(
|
||||
getErrorMessage("setInterval('invalid', 100);"),
|
||||
"The first argument to setInterval must be a function.");
|
||||
|
||||
auto val = eval("setInterval('invalid', 100)");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 0);
|
||||
}
|
||||
|
||||
TEST_F(ReactInstanceTest, testClearInterval) {
|
||||
|
||||
@@ -106,6 +106,7 @@ export type {
|
||||
SectionListProps,
|
||||
SectionListRenderItem,
|
||||
SectionListRenderItemInfo,
|
||||
SectionListData,
|
||||
} from './Libraries/Lists/SectionList';
|
||||
export {default as SectionList} from './Libraries/Lists/SectionList';
|
||||
|
||||
|
||||
Vendored
+1
@@ -14,6 +14,7 @@ module.exports = {
|
||||
defaultPlatform: 'ios',
|
||||
platforms: ['android', 'ios', 'native'],
|
||||
},
|
||||
resolver: require.resolve('./jest/resolver.js'),
|
||||
transform: {
|
||||
'^.+\\.(js|ts|tsx)$': 'babel-jest',
|
||||
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = (path, options) => {
|
||||
const originalPackageFilter = options.packageFilter;
|
||||
|
||||
return options.defaultResolver(path, {
|
||||
...options,
|
||||
packageFilter: pkg => {
|
||||
const filteredPkg = originalPackageFilter
|
||||
? originalPackageFilter(pkg)
|
||||
: pkg;
|
||||
|
||||
// Temporarily allow any react-native subpaths to be resolved and
|
||||
// mocked by Jest (backwards compatibility around RFC0894)
|
||||
if (filteredPkg.name === 'react-native') {
|
||||
delete filteredPkg.exports;
|
||||
}
|
||||
|
||||
return filteredPkg;
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"version": "1000.0.0",
|
||||
"version": "0.80.0",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -50,6 +50,11 @@
|
||||
"default": "./Libraries/*.d.ts"
|
||||
},
|
||||
"./scripts/*": "./scripts/*",
|
||||
"./src/*": {
|
||||
"react-native-strict-api": null,
|
||||
"react-native-strict-api-UNSAFE-ALLOW-SUBPATHS": "./types_generated/src/*.d.ts",
|
||||
"default": "./src/*.js"
|
||||
},
|
||||
"./types/*.d.ts": {
|
||||
"react-native-strict-api": null,
|
||||
"default": "./types/*.d.ts"
|
||||
@@ -61,9 +66,9 @@
|
||||
"./ReactCommon/*": null,
|
||||
"./sdks/*": null,
|
||||
"./src/fb_internal/*": "./src/fb_internal/*",
|
||||
"./src/*": null,
|
||||
"./third-party-podspecs/*": null,
|
||||
"./types/*": null,
|
||||
"./types_generated/*": null,
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"jest-junit": {
|
||||
@@ -154,13 +159,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@react-native/assets-registry": "0.80.0-main",
|
||||
"@react-native/codegen": "0.80.0-main",
|
||||
"@react-native/community-cli-plugin": "0.80.0-main",
|
||||
"@react-native/gradle-plugin": "0.80.0-main",
|
||||
"@react-native/js-polyfills": "0.80.0-main",
|
||||
"@react-native/normalize-colors": "0.80.0-main",
|
||||
"@react-native/virtualized-lists": "0.80.0-main",
|
||||
"@react-native/assets-registry": "0.80.0",
|
||||
"@react-native/codegen": "0.80.0",
|
||||
"@react-native/community-cli-plugin": "0.80.0",
|
||||
"@react-native/gradle-plugin": "0.80.0",
|
||||
"@react-native/js-polyfills": "0.80.0",
|
||||
"@react-native/normalize-colors": "0.80.0",
|
||||
"@react-native/virtualized-lists": "0.80.0",
|
||||
"abort-controller": "^3.0.0",
|
||||
"anser": "^1.4.9",
|
||||
"ansi-regex": "^5.0.0",
|
||||
|
||||
@@ -161,7 +161,7 @@ class NewArchitectureHelper
|
||||
.uniq{ |p| p.path }
|
||||
.map{ |p| p.path }
|
||||
|
||||
excluded_info_plist = ["/Pods", "Tests", "metainternal", ".bundle"]
|
||||
excluded_info_plist = ["/Pods", "Tests", "metainternal", ".bundle", "build/", "DerivedData/"]
|
||||
projectPaths.each do |projectPath|
|
||||
projectFolderPath = File.dirname(projectPath)
|
||||
infoPlistFiles = `find #{projectFolderPath} -name "Info.plist"`
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "test-app-legacy",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
},
|
||||
"codegenConfig": {
|
||||
"name": "TestAppConfig",
|
||||
"type": "all",
|
||||
"android": {
|
||||
"javaPackageName": "com.testApp"
|
||||
},
|
||||
"ios": {
|
||||
"modulesConformingToProtocol": {
|
||||
"RCTImageURLLoader": "RCTTestAppDeprecatedImageURLLoader",
|
||||
"RCTURLRequestHandler": "RCTTestAppDeprecatedURLRequestHandler"
|
||||
},
|
||||
"modulesProvider": {
|
||||
"TestAppDeprecatedImageURLLoader": "RCTTestAppDeprecatedImageURLLoader",
|
||||
"TestAppDeprecatedURLRequestHandler": "RCTTestAppDeprecatedURLRequestHandler",
|
||||
"TestAppDeprecatedImageDataDecoder": "RCTTestAppDeprecatedImageDataDecoder"
|
||||
},
|
||||
"componentProvider": {
|
||||
"TestAppDeprecatedComponent": "RCTTestAppDeprecatedComponentClass"
|
||||
},
|
||||
"unstableModulesRequiringMainQueueSetup": [
|
||||
"RCTTestAppDeprecatedImageURLLoader",
|
||||
"RCTTestAppDeprecatedURLRequestHandler",
|
||||
"RCTTestAppDeprecatedImageDataDecoder"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+489
-16
@@ -1,6 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`execute "RCTAppDependencyProvider.h" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTAppDependencyProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_END
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -73,7 +73,7 @@ exports[`execute "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTModuleProviders.h" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTModuleProviders.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -93,7 +93,7 @@ exports[`execute "RCTModuleProviders.h" should match snapshot 1`] = `
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTModuleProviders.mm" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTModuleProviders.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -159,7 +159,7 @@ exports[`execute "RCTModuleProviders.mm" should match snapshot 1`] = `
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -181,7 +181,7 @@ exports[`execute "RCTModulesConformingToProtocolsProvider.h" should match snapsh
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -248,7 +248,7 @@ exports[`execute "RCTModulesConformingToProtocolsProvider.mm" should match snaps
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -268,7 +268,7 @@ exports[`execute "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] =
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -291,9 +291,7 @@ exports[`execute "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`]
|
||||
|
||||
dispatch_once(&nativeComponentsToken, ^{
|
||||
thirdPartyComponents = @{
|
||||
@\\"TestAppDeprecatedComponent\\": NSClassFromString(@\\"RCTTestAppDeprecatedComponentClass\\"), // test-app
|
||||
@\\"TestAppComponent\\": NSClassFromString(@\\"RCTTestAppComponent\\"), // test-app
|
||||
@\\"TestLibraryDeprecatedComponent\\": NSClassFromString(@\\"RCTTestLibraryDeprecatedComponentClass\\"), // test-library
|
||||
@\\"TestLibraryComponent\\": NSClassFromString(@\\"RCTTestLibraryComponent\\"), // test-library
|
||||
};
|
||||
});
|
||||
@@ -305,7 +303,7 @@ exports[`execute "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`]
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -323,7 +321,7 @@ exports[`execute "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should ma
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
|
||||
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -357,13 +355,13 @@ exports[`execute "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should m
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
|
||||
exports[`execute test-app "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
|
||||
"# 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.
|
||||
|
||||
version = \\"1000.0.0\\"
|
||||
version = \\"0.80.0\\"
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
@@ -395,13 +393,13 @@ end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute "ReactCodegen.podspec" should match snapshot 1`] = `
|
||||
exports[`execute test-app "ReactCodegen.podspec" should match snapshot 1`] = `
|
||||
"# 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.
|
||||
|
||||
version = \\"1000.0.0\\"
|
||||
version = \\"0.80.0\\"
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
@@ -504,3 +502,478 @@ SCRIPT
|
||||
end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTAppDependencyProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
||||
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
||||
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
||||
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
||||
#else
|
||||
#import \\"RCTDependencyProvider.h\\"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import \\"RCTAppDependencyProvider.h\\"
|
||||
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
||||
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
||||
#import <ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h>
|
||||
#import <ReactCodegen/RCTModuleProviders.h>
|
||||
|
||||
@implementation RCTAppDependencyProvider
|
||||
|
||||
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
||||
return RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
||||
}
|
||||
|
||||
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
||||
return RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
||||
}
|
||||
|
||||
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
||||
return RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
||||
}
|
||||
|
||||
- (nonnull NSArray<NSString *> *)unstableModulesRequiringMainQueueSetup {
|
||||
return RCTUnstableModulesRequiringMainQueueSetupProvider.modules;
|
||||
}
|
||||
|
||||
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
||||
return RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
||||
}
|
||||
|
||||
- (nonnull NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders {
|
||||
return RCTModuleProviders.moduleProviders;
|
||||
}
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTModuleProviders.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol RCTModuleProvider;
|
||||
|
||||
@interface RCTModuleProviders: NSObject
|
||||
|
||||
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTModuleProviders.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import \\"RCTModuleProviders.h\\"
|
||||
#import <ReactCommon/RCTTurboModule.h>
|
||||
#import <React/RCTLog.h>
|
||||
|
||||
@implementation RCTModuleProviders
|
||||
|
||||
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
|
||||
{
|
||||
static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSDictionary<NSString *, NSString *> * moduleMapping = @{
|
||||
@\\"TestAppDeprecatedImageURLLoader\\": @\\"RCTTestAppDeprecatedImageURLLoader\\", // test-app-legacy
|
||||
@\\"TestAppDeprecatedURLRequestHandler\\": @\\"RCTTestAppDeprecatedURLRequestHandler\\", // test-app-legacy
|
||||
@\\"TestAppDeprecatedImageDataDecoder\\": @\\"RCTTestAppDeprecatedImageDataDecoder\\", // test-app-legacy
|
||||
};
|
||||
|
||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
|
||||
|
||||
for (NSString *key in moduleMapping) {
|
||||
NSString * moduleProviderName = moduleMapping[key];
|
||||
Class klass = NSClassFromString(moduleProviderName);
|
||||
if (!klass) {
|
||||
RCTLogError(@\\"Module provider %@ cannot be found in the runtime\\", moduleProviderName);
|
||||
continue;
|
||||
}
|
||||
|
||||
id instance = [klass new];
|
||||
if (![instance respondsToSelector:@selector(getTurboModule:)]) {
|
||||
RCTLogError(@\\"Module provider %@ does not conform to RCTModuleProvider\\", moduleProviderName);
|
||||
continue;
|
||||
}
|
||||
|
||||
[dict setObject:instance forKey:key];
|
||||
}
|
||||
|
||||
providers = dict;
|
||||
});
|
||||
|
||||
return providers;
|
||||
}
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
||||
|
||||
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
||||
|
||||
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
||||
|
||||
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import \\"RCTModulesConformingToProtocolsProvider.h\\"
|
||||
|
||||
@implementation RCTModulesConformingToProtocolsProvider
|
||||
|
||||
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
||||
{
|
||||
static NSArray<NSString *> *classNames = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
classNames = @[
|
||||
@\\"RCTTestAppDeprecatedImageURLLoader\\"
|
||||
];
|
||||
});
|
||||
|
||||
return classNames;
|
||||
}
|
||||
|
||||
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
||||
{
|
||||
static NSArray<NSString *> *classNames = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
classNames = @[
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
return classNames;
|
||||
}
|
||||
|
||||
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
||||
{
|
||||
static NSArray<NSString *> *classNames = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
classNames = @[
|
||||
@\\"RCTTestAppDeprecatedURLRequestHandler\\"
|
||||
];
|
||||
});
|
||||
|
||||
return classNames;
|
||||
}
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol RCTComponentViewProtocol;
|
||||
|
||||
@interface RCTThirdPartyComponentsProvider: NSObject
|
||||
|
||||
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import \\"RCTThirdPartyComponentsProvider.h\\"
|
||||
#import <React/RCTComponentViewProtocol.h>
|
||||
|
||||
@implementation RCTThirdPartyComponentsProvider
|
||||
|
||||
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
||||
{
|
||||
static NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *thirdPartyComponents = nil;
|
||||
static dispatch_once_t nativeComponentsToken;
|
||||
|
||||
dispatch_once(&nativeComponentsToken, ^{
|
||||
thirdPartyComponents = @{
|
||||
@\\"TestAppDeprecatedComponent\\": NSClassFromString(@\\"RCTTestAppDeprecatedComponentClass\\"), // test-app-legacy
|
||||
};
|
||||
});
|
||||
|
||||
return thirdPartyComponents;
|
||||
}
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RCTUnstableModulesRequiringMainQueueSetupProvider: NSObject
|
||||
|
||||
+(NSArray<NSString *> *)modules;
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
|
||||
"/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import \\"RCTUnstableModulesRequiringMainQueueSetupProvider.h\\"
|
||||
|
||||
@implementation RCTUnstableModulesRequiringMainQueueSetupProvider
|
||||
|
||||
+(NSArray<NSString *> *)modules
|
||||
{
|
||||
return @[
|
||||
@\\"RCTTestAppDeprecatedImageURLLoader\\",
|
||||
@\\"RCTTestAppDeprecatedURLRequestHandler\\",
|
||||
@\\"RCTTestAppDeprecatedImageDataDecoder\\"
|
||||
];
|
||||
}
|
||||
|
||||
@end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
|
||||
"# 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.
|
||||
|
||||
version = \\"0.80.0\\"
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
|
||||
else
|
||||
source[:tag] = \\"v#{version}\\"
|
||||
end
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = \\"ReactAppDependencyProvider\\"
|
||||
s.version = version
|
||||
s.summary = \\"The third party dependency provider for the app\\"
|
||||
s.homepage = \\"https://reactnative.dev/\\"
|
||||
s.documentation_url = \\"https://reactnative.dev/\\"
|
||||
s.license = \\"MIT\\"
|
||||
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
|
||||
s.platforms = min_supported_versions
|
||||
s.source = source
|
||||
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
|
||||
|
||||
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
|
||||
s.pod_target_xcconfig = {
|
||||
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
|
||||
\\"DEFINES_MODULE\\" => \\"YES\\"
|
||||
}
|
||||
|
||||
s.dependency \\"ReactCodegen\\"
|
||||
end
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`execute test-app-legacy "ReactCodegen.podspec" should match snapshot 1`] = `
|
||||
"# 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.
|
||||
|
||||
version = \\"0.80.0\\"
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
|
||||
else
|
||||
source[:tag] = \\"v#{version}\\"
|
||||
end
|
||||
|
||||
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
|
||||
folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags]
|
||||
boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags]
|
||||
|
||||
header_search_paths = [
|
||||
\\"\\\\\\"$(PODS_ROOT)/ReactNativeDependencies\\\\\\"\\",
|
||||
\\"\\\\\\"\${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\\\\\\"\\",
|
||||
\\"\\\\\\"$(PODS_ROOT)/Headers/Private/React-Fabric\\\\\\"\\",
|
||||
\\"\\\\\\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\\\\\\"\\",
|
||||
\\"\\\\\\"$(PODS_ROOT)/Headers/Private/Yoga\\\\\\"\\",
|
||||
\\"\\\\\\"$(PODS_TARGET_SRCROOT)\\\\\\"\\",
|
||||
]
|
||||
framework_search_paths = []
|
||||
|
||||
if use_frameworks
|
||||
ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-Fabric\\", \\"React_Fabric\\", [\\"react/renderer/components/view/platform/cxx\\"])
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-FabricImage\\", \\"React_FabricImage\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-graphics\\", \\"React_graphics\\", [\\"react/renderer/graphics/platform/ios\\"]))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"ReactCommon\\", \\"ReactCommon\\", [\\"react/nativemodule/core\\"]))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-NativeModulesApple\\", \\"React_NativeModulesApple\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-RCTFabric\\", \\"RCTFabric\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-debug\\", \\"React_debug\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-rendererdebug\\", \\"React_rendererdebug\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-utils\\", \\"React_utils\\", []))
|
||||
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks(\\"PODS_CONFIGURATION_BUILD_DIR\\", \\"React-featureflags\\", \\"React_featureflags\\", []))
|
||||
.each { |search_path|
|
||||
header_search_paths << \\"\\\\\\"#{search_path}\\\\\\"\\"
|
||||
}
|
||||
end
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = \\"ReactCodegen\\"
|
||||
s.version = version
|
||||
s.summary = 'Temp pod for generated files for React Native'
|
||||
s.homepage = 'https://facebook.com/'
|
||||
s.license = 'Unlicense'
|
||||
s.authors = 'Facebook'
|
||||
s.compiler_flags = \\"#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20\\"
|
||||
s.source = { :git => '' }
|
||||
s.header_mappings_dir = './'
|
||||
s.platforms = min_supported_versions
|
||||
s.source_files = \\"**/*.{h,mm,cpp}\\"
|
||||
s.exclude_files = \\"RCTAppDependencyProvider.{h,mm}\\" # these files are generated in the same codegen path but needs to belong to a different pod
|
||||
s.pod_target_xcconfig = {
|
||||
\\"HEADER_SEARCH_PATHS\\" => header_search_paths.join(' '),
|
||||
\\"FRAMEWORK_SEARCH_PATHS\\" => framework_search_paths,
|
||||
\\"OTHER_CPLUSPLUSFLAGS\\" => \\"$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}\\"
|
||||
}
|
||||
|
||||
s.dependency \\"React-jsiexecutor\\"
|
||||
s.dependency \\"RCTRequired\\"
|
||||
s.dependency \\"RCTTypeSafety\\"
|
||||
s.dependency \\"React-Core\\"
|
||||
s.dependency \\"React-jsi\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/bridging\\"
|
||||
s.dependency \\"ReactCommon/turbomodule/core\\"
|
||||
s.dependency \\"React-NativeModulesApple\\"
|
||||
s.dependency 'React-graphics'
|
||||
s.dependency 'React-rendererdebug'
|
||||
s.dependency 'React-Fabric'
|
||||
s.dependency 'React-FabricImage'
|
||||
s.dependency 'React-debug'
|
||||
s.dependency 'React-utils'
|
||||
s.dependency 'React-featureflags'
|
||||
s.dependency 'React-RCTAppDelegate'
|
||||
|
||||
depend_on_js_engine(s)
|
||||
add_rn_third_party_dependencies(s)
|
||||
|
||||
s.script_phases = {
|
||||
'name' => 'Generate Specs',
|
||||
'execution_position' => :before_compile,
|
||||
'input_files' => [],
|
||||
'show_env_vars_in_log' => true,
|
||||
'output_files' => [\\"\${DERIVED_FILE_DIR}/react-codegen.log\\"],
|
||||
'script': <<-SCRIPT
|
||||
pushd \\"$PODS_ROOT/../\\" > /dev/null
|
||||
RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
|
||||
popd >/dev/null
|
||||
|
||||
export RCT_SCRIPT_RN_DIR=\\"$RCT_SCRIPT_POD_INSTALLATION_ROOT/../../../../..\\"
|
||||
export RCT_SCRIPT_APP_PATH=\\"$RCT_SCRIPT_POD_INSTALLATION_ROOT/..\\"
|
||||
export RCT_SCRIPT_OUTPUT_DIR=\\"$RCT_SCRIPT_POD_INSTALLATION_ROOT\\"
|
||||
export RCT_SCRIPT_TYPE=\\"withCodegenDiscovery\\"
|
||||
|
||||
SCRIPT_PHASES_SCRIPT=\\"$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh\\"
|
||||
WITH_ENVIRONMENT=\\"$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh\\"
|
||||
/bin/sh -c \\"$WITH_ENVIRONMENT $SCRIPT_PHASES_SCRIPT\\"
|
||||
SCRIPT
|
||||
}
|
||||
|
||||
end
|
||||
"
|
||||
`;
|
||||
+93
-86
@@ -28,105 +28,112 @@ const packageJson = JSON.stringify({
|
||||
name: 'react-native',
|
||||
});
|
||||
|
||||
describe('execute', () => {
|
||||
const appDir = path.join(__dirname, '../__fixtures__/test-app');
|
||||
const outputDir = path.join(appDir, 'temp');
|
||||
['test-app', 'test-app-legacy'].forEach(appName => {
|
||||
describe(`execute ${appName}`, () => {
|
||||
const appDir = path.join(__dirname, '../__fixtures__', appName);
|
||||
const outputDir = path.join(appDir, 'temp');
|
||||
|
||||
beforeAll(() => {
|
||||
execute(appDir, 'ios', outputDir, 'app', false);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
fs.rmdirSync(outputDir, {recursive: true});
|
||||
});
|
||||
|
||||
[
|
||||
'RCTAppDependencyProvider.h',
|
||||
'RCTAppDependencyProvider.mm',
|
||||
'RCTModuleProviders.h',
|
||||
'RCTModuleProviders.mm',
|
||||
'RCTModulesConformingToProtocolsProvider.h',
|
||||
'RCTModulesConformingToProtocolsProvider.mm',
|
||||
'RCTThirdPartyComponentsProvider.h',
|
||||
'RCTThirdPartyComponentsProvider.mm',
|
||||
'ReactAppDependencyProvider.podspec',
|
||||
'ReactCodegen.podspec',
|
||||
'RCTUnstableModulesRequiringMainQueueSetupProvider.h',
|
||||
'RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
|
||||
].forEach(file => {
|
||||
it(`"${file}" should match snapshot`, () => {
|
||||
const generatedFileDir = path.join(outputDir, 'build/generated/ios');
|
||||
const generatedFile = path.join(generatedFileDir, file);
|
||||
expect(fs.existsSync(generatedFile)).toBe(true);
|
||||
expect(fs.readFileSync(generatedFile, 'utf8')).toMatchSnapshot();
|
||||
beforeAll(() => {
|
||||
execute(appDir, 'ios', outputDir, 'app', false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('extractLibrariesFromJSON', () => {
|
||||
it('extracts a single dependency when config has no libraries', () => {
|
||||
let configFile = fixtures.noLibrariesConfigFile;
|
||||
let libraries = extractLibrariesFromJSON(configFile, '.');
|
||||
expect(libraries.length).toBe(1);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
name: 'AppModules',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: '.',
|
||||
afterAll(() => {
|
||||
fs.rmdirSync(outputDir, {recursive: true});
|
||||
});
|
||||
|
||||
[
|
||||
'RCTAppDependencyProvider.h',
|
||||
'RCTAppDependencyProvider.mm',
|
||||
'RCTModuleProviders.h',
|
||||
'RCTModuleProviders.mm',
|
||||
'RCTModulesConformingToProtocolsProvider.h',
|
||||
'RCTModulesConformingToProtocolsProvider.mm',
|
||||
'RCTThirdPartyComponentsProvider.h',
|
||||
'RCTThirdPartyComponentsProvider.mm',
|
||||
'ReactAppDependencyProvider.podspec',
|
||||
'ReactCodegen.podspec',
|
||||
'RCTUnstableModulesRequiringMainQueueSetupProvider.h',
|
||||
'RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
|
||||
].forEach(file => {
|
||||
it(`"${file}" should match snapshot`, () => {
|
||||
const generatedFileDir = path.join(outputDir, 'build/generated/ios');
|
||||
const generatedFile = path.join(generatedFileDir, file);
|
||||
expect(fs.existsSync(generatedFile)).toBe(true);
|
||||
expect(fs.readFileSync(generatedFile, 'utf8')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("doesn't extract libraries when they are present but empty", () => {
|
||||
const configFile = {codegenConfig: {libraries: []}};
|
||||
let libraries = extractLibrariesFromJSON(configFile, rootPath);
|
||||
expect(libraries.length).toBe(0);
|
||||
});
|
||||
describe('extractLibrariesFromJSON', () => {
|
||||
it('extracts a single dependency when config has no libraries', () => {
|
||||
let configFile = fixtures.noLibrariesConfigFile;
|
||||
let libraries = extractLibrariesFromJSON(configFile, '.');
|
||||
expect(libraries.length).toBe(1);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
name: 'AppModules',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: '.',
|
||||
name: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('extracts libraries when they are present and not empty', () => {
|
||||
const configFile = fixtures.singleLibraryCodegenConfig;
|
||||
let libraries = extractLibrariesFromJSON(configFile, rootPath);
|
||||
expect(libraries.length).toBe(1);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
it("doesn't extract libraries when they are present but empty", () => {
|
||||
const configFile = {codegenConfig: {libraries: []}};
|
||||
let libraries = extractLibrariesFromJSON(configFile, rootPath);
|
||||
expect(libraries.length).toBe(0);
|
||||
});
|
||||
|
||||
it('extracts libraries when they are present and not empty', () => {
|
||||
const configFile = fixtures.singleLibraryCodegenConfig;
|
||||
let libraries = extractLibrariesFromJSON(configFile, rootPath);
|
||||
expect(libraries.length).toBe(1);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
name: 'react-native',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: rootPath,
|
||||
name: 'react-native',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: rootPath,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('extract codegenConfig with multiple dependencies', () => {
|
||||
const configFile = fixtures.multipleLibrariesCodegenConfig;
|
||||
const myDependency = 'my-dependency';
|
||||
const myDependencyPath = path.join(__dirname, myDependency);
|
||||
let libraries = extractLibrariesFromJSON(configFile, myDependencyPath);
|
||||
expect(libraries.length).toBe(3);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
it('extract codegenConfig with multiple dependencies', () => {
|
||||
const configFile = fixtures.multipleLibrariesCodegenConfig;
|
||||
const myDependency = 'my-dependency';
|
||||
const myDependencyPath = path.join(__dirname, myDependency);
|
||||
let libraries = extractLibrariesFromJSON(configFile, myDependencyPath);
|
||||
expect(libraries.length).toBe(3);
|
||||
expect(libraries[0]).toEqual({
|
||||
config: {
|
||||
name: 'react-native',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
name: 'react-native',
|
||||
type: 'all',
|
||||
jsSrcsDir: '.',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
});
|
||||
expect(libraries[1]).toEqual({
|
||||
config: {
|
||||
});
|
||||
expect(libraries[1]).toEqual({
|
||||
config: {
|
||||
name: 'my-component',
|
||||
type: 'components',
|
||||
jsSrcsDir: 'component/js',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
name: 'my-component',
|
||||
type: 'components',
|
||||
jsSrcsDir: 'component/js',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
});
|
||||
expect(libraries[2]).toEqual({
|
||||
config: {
|
||||
});
|
||||
expect(libraries[2]).toEqual({
|
||||
config: {
|
||||
name: 'my-module',
|
||||
type: 'module',
|
||||
jsSrcsDir: 'module/js',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
name: 'my-module',
|
||||
type: 'module',
|
||||
jsSrcsDir: 'module/js',
|
||||
},
|
||||
libraryPath: myDependencyPath,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+11
-3
@@ -30,6 +30,8 @@ function generateCustomURLHandlers(libraries, outputDir) {
|
||||
const imageDataDecoderModules = new Set();
|
||||
const urlRequestHandlersModules = new Set();
|
||||
|
||||
const wrapInArrayIfNecessary = value =>
|
||||
Array.isArray(value) || value == null ? value : [value];
|
||||
// Old API
|
||||
for (const library of libraries) {
|
||||
const modulesConformingToProtocol =
|
||||
@@ -38,13 +40,19 @@ function generateCustomURLHandlers(libraries, outputDir) {
|
||||
continue;
|
||||
}
|
||||
|
||||
modulesConformingToProtocol.RCTImageURLLoader.forEach(moduleName => {
|
||||
wrapInArrayIfNecessary(
|
||||
modulesConformingToProtocol.RCTImageURLLoader,
|
||||
)?.forEach(moduleName => {
|
||||
imageURLLoaderModules.add(moduleName);
|
||||
});
|
||||
modulesConformingToProtocol.RCTImageDataDecoder.forEach(moduleName => {
|
||||
wrapInArrayIfNecessary(
|
||||
modulesConformingToProtocol.RCTImageDataDecoder,
|
||||
)?.forEach(moduleName => {
|
||||
imageDataDecoderModules.add(moduleName);
|
||||
});
|
||||
modulesConformingToProtocol.RCTURLRequestHandler.forEach(moduleName => {
|
||||
wrapInArrayIfNecessary(
|
||||
modulesConformingToProtocol.RCTURLRequestHandler,
|
||||
)?.forEach(moduleName => {
|
||||
urlRequestHandlersModules.add(moduleName);
|
||||
});
|
||||
}
|
||||
|
||||
packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js
Vendored
+18
-6
@@ -52,8 +52,23 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
|
||||
|
||||
const librariesToCrawl = {};
|
||||
|
||||
// Using new API explicitly or not using any config field to define components.
|
||||
const componentLibrariesUsingNewApi = [];
|
||||
const componentLibrariesUsingOldApi = [];
|
||||
|
||||
for (const library of componentLibraries) {
|
||||
if (
|
||||
library.config.ios?.components ||
|
||||
!library.config.ios?.componentProvider
|
||||
) {
|
||||
componentLibrariesUsingNewApi.push(library);
|
||||
} else {
|
||||
componentLibrariesUsingOldApi.push(library);
|
||||
}
|
||||
}
|
||||
|
||||
// Old API
|
||||
componentLibraries.forEach(library => {
|
||||
componentLibrariesUsingOldApi.forEach(library => {
|
||||
const {config, libraryPath} = library;
|
||||
const libraryName = JSON.parse(
|
||||
fs.readFileSync(path.join(libraryPath, 'package.json')),
|
||||
@@ -62,9 +77,6 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
|
||||
librariesToCrawl[libraryName] = library;
|
||||
|
||||
const componentsProvider = config.ios?.componentProvider;
|
||||
if (!componentsProvider) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete librariesToCrawl[libraryName];
|
||||
componentsInLibraries[libraryName] =
|
||||
@@ -79,7 +91,7 @@ function generateRCTThirdPartyComponents(libraries, outputDir) {
|
||||
});
|
||||
|
||||
// New API
|
||||
const iosAnnotations = parseiOSAnnotations(componentLibraries);
|
||||
const iosAnnotations = parseiOSAnnotations(componentLibrariesUsingNewApi);
|
||||
for (const [libraryName, annotationMap] of Object.entries(iosAnnotations)) {
|
||||
const {library, components} = annotationMap;
|
||||
librariesToCrawl[libraryName] = library;
|
||||
@@ -186,7 +198,7 @@ function findRCTComponentViewProtocolClass(filepath) {
|
||||
const lines = fileContent.split('\n');
|
||||
const signatureIndex = lines.findIndex(line => regex.test(line));
|
||||
const returnRegex = /return (.*)\.class/;
|
||||
const classNameMatch = String(lines.slice(signatureIndex)).match(
|
||||
const classNameMatch = String(lines.slice(signatureIndex).join('\n')).match(
|
||||
returnRegex,
|
||||
);
|
||||
if (classNameMatch) {
|
||||
|
||||
+21
-2
@@ -35,8 +35,10 @@ const {
|
||||
cleanupEmptyFilesAndFolders,
|
||||
codegenLog,
|
||||
findCodegenEnabledLibraries,
|
||||
findDisabledLibrariesByPlatform,
|
||||
pkgJsonIncludesGeneratedCode,
|
||||
readPkgJsonInDirectory,
|
||||
readReactNativeConfig,
|
||||
} = require('./utils');
|
||||
const path = require('path');
|
||||
|
||||
@@ -83,9 +85,14 @@ function execute(
|
||||
buildCodegenIfNeeded();
|
||||
}
|
||||
|
||||
const libraries = findCodegenEnabledLibraries(pkgJson, projectRoot);
|
||||
const reactNativeConfig = readReactNativeConfig(projectRoot);
|
||||
const codegenEnabledLibraries = findCodegenEnabledLibraries(
|
||||
pkgJson,
|
||||
projectRoot,
|
||||
reactNativeConfig,
|
||||
);
|
||||
|
||||
if (libraries.length === 0) {
|
||||
if (codegenEnabledLibraries.length === 0) {
|
||||
codegenLog('No codegen-enabled libraries found.', true);
|
||||
return;
|
||||
}
|
||||
@@ -94,6 +101,18 @@ function execute(
|
||||
targetPlatform === 'all' ? supportedPlatforms : [targetPlatform];
|
||||
|
||||
for (const platform of platforms) {
|
||||
const disabledLibraries = findDisabledLibrariesByPlatform(
|
||||
reactNativeConfig,
|
||||
platform,
|
||||
);
|
||||
const libraries = codegenEnabledLibraries.filter(
|
||||
({name}) => !disabledLibraries.includes(name),
|
||||
);
|
||||
|
||||
if (!libraries.length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const outputPath = computeOutputPath(
|
||||
projectRoot,
|
||||
baseOutputPath,
|
||||
|
||||
+32
-14
@@ -94,10 +94,20 @@ function cleanupEmptyFilesAndFolders(filepath) {
|
||||
}
|
||||
}
|
||||
|
||||
function readReactNativeConfig(projectRoot) {
|
||||
const rnConfigFilePath = path.resolve(projectRoot, 'react-native.config.js');
|
||||
|
||||
if (!fs.existsSync(rnConfigFilePath)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return require(rnConfigFilePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finding libraries!
|
||||
*/
|
||||
function findCodegenEnabledLibraries(pkgJson, projectRoot) {
|
||||
function findCodegenEnabledLibraries(pkgJson, projectRoot, reactNativeConfig) {
|
||||
const projectLibraries = findProjectRootLibraries(pkgJson, projectRoot);
|
||||
if (pkgJsonIncludesGeneratedCode(pkgJson)) {
|
||||
return projectLibraries;
|
||||
@@ -105,7 +115,7 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
|
||||
return [
|
||||
...projectLibraries,
|
||||
...findExternalLibraries(pkgJson, projectRoot),
|
||||
...findLibrariesFromReactNativeConfig(projectRoot),
|
||||
...findLibrariesFromReactNativeConfig(projectRoot, reactNativeConfig),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -128,22 +138,13 @@ function findProjectRootLibraries(pkgJson, projectRoot) {
|
||||
return extractLibrariesFromJSON(pkgJson, projectRoot);
|
||||
}
|
||||
|
||||
function findLibrariesFromReactNativeConfig(projectRoot) {
|
||||
const rnConfigFileName = 'react-native.config.js';
|
||||
|
||||
function findLibrariesFromReactNativeConfig(projectRoot, rnConfig) {
|
||||
codegenLog(
|
||||
`Searching for codegen-enabled libraries in ${rnConfigFileName}`,
|
||||
`Searching for codegen-enabled libraries in react-native.config.js`,
|
||||
true,
|
||||
);
|
||||
|
||||
const rnConfigFilePath = path.resolve(projectRoot, rnConfigFileName);
|
||||
|
||||
if (!fs.existsSync(rnConfigFilePath)) {
|
||||
return [];
|
||||
}
|
||||
const rnConfig = require(rnConfigFilePath);
|
||||
|
||||
if (rnConfig.dependencies == null) {
|
||||
if (!rnConfig.dependencies) {
|
||||
return [];
|
||||
}
|
||||
return Object.keys(rnConfig.dependencies).flatMap(name => {
|
||||
@@ -215,6 +216,7 @@ function extractLibrariesFromJSON(configFile, dependencyPath) {
|
||||
const config = configFile.codegenConfig;
|
||||
return [
|
||||
{
|
||||
name: configFile.name,
|
||||
config,
|
||||
libraryPath: dependencyPath,
|
||||
},
|
||||
@@ -266,6 +268,7 @@ function printDeprecationWarningIfNeeded(dependency) {
|
||||
function extractLibrariesFromConfigurationArray(configFile, dependencyPath) {
|
||||
return configFile.codegenConfig.libraries.map(config => {
|
||||
return {
|
||||
name: config.name,
|
||||
config,
|
||||
libraryPath: dependencyPath,
|
||||
};
|
||||
@@ -366,6 +369,19 @@ function getLibraryName(library) {
|
||||
).name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all disabled libraries by platform based the react native config.
|
||||
*
|
||||
* This is needed when selectively disabling libraries in react-native.config.js since codegen should exclude those libraries as well.
|
||||
*/
|
||||
function findDisabledLibrariesByPlatform(reactNativeConfig, platform) {
|
||||
const dependencies = reactNativeConfig.dependencies ?? {};
|
||||
|
||||
return Object.keys(dependencies).filter(
|
||||
dependency => dependencies[dependency].platforms?.[platform] === null,
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
buildCodegenIfNeeded,
|
||||
pkgJsonIncludesGeneratedCode,
|
||||
@@ -377,4 +393,6 @@ module.exports = {
|
||||
findProjectRootLibraries,
|
||||
extractLibrariesFromJSON,
|
||||
parseiOSAnnotations,
|
||||
readReactNativeConfig,
|
||||
findDisabledLibrariesByPlatform,
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
hermes-2025-05-06-RNv0.80.0-4eb6132a5bf0450bf4c6c91987675381d7ac8bca
|
||||
+12
-5
@@ -4,19 +4,26 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {
|
||||
ImageStyle,
|
||||
TextStyle,
|
||||
ViewStyle,
|
||||
} from '../../../Libraries/StyleSheet/StyleSheet';
|
||||
import type {StyleProp} from '../../../Libraries/StyleSheet/StyleSheetTypes';
|
||||
|
||||
/**
|
||||
* Combines two styles such that `style2` will override any styles in `style1`.
|
||||
* If either style is null or undefined, the other one is returned without
|
||||
* allocating an array, saving allocations and enabling memoization.
|
||||
*/
|
||||
export default function composeStyles<T1, T2>(
|
||||
style1: ?T1,
|
||||
style2: ?T2,
|
||||
): ?(T1 | T2 | $ReadOnlyArray<T1 | T2>) {
|
||||
export default function composeStyles<
|
||||
T: ViewStyle | ImageStyle | TextStyle,
|
||||
U: T,
|
||||
V: T,
|
||||
>(style1: ?StyleProp<U>, style2: ?StyleProp<V>): ?StyleProp<T> {
|
||||
if (style1 == null) {
|
||||
return style2;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user