mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14cce6c313 |
+1
-1
@@ -90,4 +90,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.251.1
|
||||
^0.250.0
|
||||
|
||||
@@ -8,7 +8,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
gradle-version: wrapper
|
||||
# We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
name: test-library-on-nightly
|
||||
description: Tests a library on a nightly
|
||||
inputs:
|
||||
library-npm-package:
|
||||
description: The library npm package to add
|
||||
required: true
|
||||
platform:
|
||||
description: whether we want to build for iOS or Android
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Create new app
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp
|
||||
npx @react-native-community/cli init RNApp --skip-install --version nightly
|
||||
- name: Add library
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp/RNApp
|
||||
yarn add ${{ inputs.library-npm-package }}
|
||||
|
||||
- name: Build iOS
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'ios' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/ios
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
cd ..
|
||||
yarn ios
|
||||
- name: Setup Java for Android
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Build Android
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/android
|
||||
./gradlew assembleDebug
|
||||
@@ -48,84 +48,96 @@ module.exports = async (github, context, labelWithContext) => {
|
||||
switch (labelWithContext.label) {
|
||||
case 'Type: Invalid':
|
||||
await addComment(
|
||||
`> [!CAUTION]` +
|
||||
`> **Invalid issue**: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.`,
|
||||
`| :warning: | Issue is Invalid |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Question':
|
||||
await addComment(
|
||||
`> [!NOTE]` +
|
||||
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Resolution: For Stack Overflow':
|
||||
await addComment(
|
||||
`> [!NOTE]` +
|
||||
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
|
||||
`| :warning: | Issue is a Question |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Docs':
|
||||
await addComment(
|
||||
`> [!NOTE]` +
|
||||
`> **Docs issue**: This issue looks like an issue related to our docs. Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
|
||||
`| :warning: | Documentation Issue |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Resolution: For Stack Overflow':
|
||||
await addComment(
|
||||
`| :warning: | Issue is a Question |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Expo':
|
||||
await addComment(
|
||||
`> [!NOTE]` +
|
||||
`> **Expo related**: It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
|
||||
`| :warning: | Issue is Related to Expo |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Needs: Issue Template':
|
||||
await addComment(
|
||||
`> [!WARNING]` +
|
||||
`> **Missing issue template**: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A&projects=&template=bug_report.yml). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.`,
|
||||
`| :warning: | Missing Required Fields |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Environment Info':
|
||||
await addComment(
|
||||
`> [!WARNING]` +
|
||||
`> **Missing info**: It looks like your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console.`,
|
||||
`| :warning: | Missing Environment Information |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Newer Patch Available':
|
||||
await addComment(
|
||||
`> [!TIP]` +
|
||||
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
|
||||
`| :warning: | Newer Version of React Native is Available! |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |`,
|
||||
);
|
||||
return;
|
||||
case 'Needs: Version Info':
|
||||
await addComment(
|
||||
`> [!WARNING]` +
|
||||
`> **Could not parse version**: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.`,
|
||||
`| :warning: | Add or Reformat Version Info |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Repro':
|
||||
await addComment(
|
||||
`> [!WARNING]` +
|
||||
`> **Missing reproducer**: We could not detect a reproducible example in your issue report. Please provide either: <br/><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/upgrade related: a project using our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li><li>Otherwise send us a Pull Request with the [RNTesterPlayground.js](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js) edited to reproduce your bug.</li></ul>`,
|
||||
`| :warning: | Missing Reproducible Example |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Unsupported Version':
|
||||
await addComment(
|
||||
`> [!WARNING]` +
|
||||
`> **Unsupported version**: It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
|
||||
`| :warning: | Unsupported Version of React Native |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Too Old Version':
|
||||
await addComment(
|
||||
`> [!CAUTION]` +
|
||||
`> **Too old version**: It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
|
||||
`| :warning: | Too Old Version of React Native |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
const NEEDS_REPRO_LABEL = 'Needs: Repro';
|
||||
const NEEDS_AUTHOR_FEEDBACK_LABEL = 'Needs: Author Feedback';
|
||||
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
|
||||
const NEEDS_REPRO_MESSAGE =
|
||||
`| :warning: | Missing Reproducible Example |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
|
||||
const SKIP_ISSUES_OLDER_THAN = '2023-07-01T00:00:00Z';
|
||||
|
||||
module.exports = async (github, context) => {
|
||||
@@ -20,6 +25,7 @@ module.exports = async (github, context) => {
|
||||
|
||||
const issue = await github.rest.issues.get(issueData);
|
||||
const comments = await github.rest.issues.listComments(issueData);
|
||||
|
||||
const author = issue.data.user.login;
|
||||
|
||||
const issueDate = issue.data.created_at;
|
||||
@@ -37,6 +43,10 @@ module.exports = async (github, context) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const botComment = comments.data.find(comment =>
|
||||
comment.body.includes(NEEDS_REPRO_HEADER),
|
||||
);
|
||||
|
||||
const entities = [issue.data, ...comments.data];
|
||||
|
||||
// Look for Snack or a GH repo associated with the user that added an issue or comment
|
||||
@@ -64,11 +74,25 @@ module.exports = async (github, context) => {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!botComment) return;
|
||||
|
||||
await github.rest.issues.deleteComment({
|
||||
...issueData,
|
||||
comment_id: botComment.id,
|
||||
});
|
||||
} else {
|
||||
await github.rest.issues.addLabels({
|
||||
...issueData,
|
||||
labels: [NEEDS_REPRO_LABEL, NEEDS_AUTHOR_FEEDBACK_LABEL],
|
||||
});
|
||||
|
||||
if (botComment) return;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
...issueData,
|
||||
body: NEEDS_REPRO_MESSAGE,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,7 +101,7 @@ function containsPattern(body, pattern) {
|
||||
return body.search(regexp) !== -1;
|
||||
}
|
||||
|
||||
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
|
||||
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
|
||||
async function hasMaintainerChangedLabel(github, issueData, author) {
|
||||
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
module.exports = async (github, context) => {
|
||||
const issue = context.payload.issue;
|
||||
|
||||
// Ignore issues using upgrade template (they use a special label)
|
||||
if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const issueVersionUnparsed =
|
||||
getReactNativeVersionFromIssueBodyIfExists(issue);
|
||||
const issueVersion = parseVersionFromString(issueVersionUnparsed);
|
||||
|
||||
@@ -24,5 +24,3 @@ jobs:
|
||||
else
|
||||
echo 'Nightly Worked, All Good!'
|
||||
fi
|
||||
- name: Test Libraries
|
||||
uses: ./.github/workflows/test-libraries-on-nightlies.yml
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v3
|
||||
@@ -1,75 +0,0 @@
|
||||
name: Test Libraries on Nightlies
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
test-library-on-nightly-android:
|
||||
name: "[Android] ${{ matrix.library }}"
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
library: [
|
||||
"react-native-async-storage",
|
||||
"react-native-blob-util",
|
||||
"@react-native-clipboard/clipboard",
|
||||
"@react-native-community/datetimepicker",
|
||||
"react-native-gesture-handler",
|
||||
"react-native-image-picker",
|
||||
"react-native-linear-gradient",
|
||||
"@react-native-masked-view/masked-view",
|
||||
"react-native-maps",
|
||||
"@react-native-community/netinfo",
|
||||
"react-native-reanimated",
|
||||
"react-native-svg",
|
||||
"react-native-video",
|
||||
"react-native-webview",
|
||||
"react-native-mmkv",
|
||||
"react-native-screens",
|
||||
"react-native-pager-view",
|
||||
"@react-native-community/slider"
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Test ${{ inputs.library-name }}
|
||||
uses: ./.github/actions/test-library-on-nightly
|
||||
with:
|
||||
library-npm-package: ${{ matrix.library }}
|
||||
platform: android
|
||||
|
||||
test-library-on-nightly-ios:
|
||||
name: "[iOS] ${{ matrix.library }}"
|
||||
runs-on: macos-13-large
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
library: [
|
||||
"react-native-async-storage",
|
||||
"react-native-blob-util",
|
||||
"@react-native-clipboard/clipboard",
|
||||
"@react-native-community/datetimepicker",
|
||||
"react-native-gesture-handler",
|
||||
"react-native-image-picker",
|
||||
"react-native-linear-gradient",
|
||||
"@react-native-masked-view/masked-view",
|
||||
"react-native-maps",
|
||||
"@react-native-community/netinfo",
|
||||
"react-native-reanimated",
|
||||
"react-native-svg",
|
||||
"react-native-video",
|
||||
"react-native-webview",
|
||||
"react-native-mmkv",
|
||||
"react-native-screens",
|
||||
"react-native-pager-view",
|
||||
"@react-native-community/slider"
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Test ${{ inputs.library-name }}
|
||||
uses: ./.github/actions/test-library-on-nightly
|
||||
with:
|
||||
library-npm-package: ${{ matrix.library }}
|
||||
platform: ios
|
||||
@@ -1,22 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## v0.76.1
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **runtime** Made AppRegistry callable from Native code in Bridgeless (fixes headless tasks) ([f3fee67c54](https://github.com/facebook/react-native/commit/f3fee67c547ace5e08bc9e119bcb80e0f3454d30) by [@robik](https://github.com/robik))
|
||||
- **runtime** Add jsBundleFile to DefaultReactNativeHost.kt ([e56bd89ef](https://github.com/facebook/react-native/commit/e56bd89eff72f1d38d2940b9dbd8f7b97037dc22))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **codegen** Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app. ([dc7e9e2d83](https://github.com/facebook/react-native/commit/dc7e9e2d83f5af3d2a970521af4fcc7f86d2168d) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **infra** Generated NODE_BINARY in .xcode.env.local now supports paths with a space ([eeaa3ff458](https://github.com/facebook/react-native/commit/eeaa3ff458a3e5c902075bb45161d6ccde31fe53) by [@blakef](https://github.com/blakef))
|
||||
- **infra** Pin Xcodeproj to < 1.26.0 ([e8776240b41](https://github.com/facebook/react-native/commit/e8776240b41a3147e95713299b69c813be60b8e8))
|
||||
- **runtime** Fixed bug where background colors would sometimes animate when changing on Views ([1d6ac09530](https://github.com/facebook/react-native/commit/1d6ac09530145e6d2bf1e4dd9d40f51542d9e7f6) by [@joevilches](https://github.com/joevilches))
|
||||
- **runtime** Fixes regression of RCTWindowFrameDidChangeNotification not fired ([e271b23fad](https://github.com/facebook/react-native/commit/e271b23fad89e1e7da2e91a8f1e5cbb295406c74) by [@zhongwuzw](https://github.com/zhongwuzw))
|
||||
|
||||
## v0.76.0
|
||||
|
||||
### Breaking
|
||||
|
||||
+3
-2
@@ -14,7 +14,8 @@
|
||||
"flow": "flow",
|
||||
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"format": "npm run prettier && npm run clang-format",
|
||||
"featureflags": "cd packages/react-native && yarn featureflags",
|
||||
"featureflags-check": "cd packages/react-native && yarn featureflags-check",
|
||||
"featureflags-update": "cd packages/react-native && yarn featureflags-update",
|
||||
"lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck",
|
||||
"lint-java": "node ./scripts/lint-java.js",
|
||||
"lint": "eslint .",
|
||||
@@ -77,7 +78,7 @@
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"flow-api-translator": "0.24.0",
|
||||
"flow-bin": "^0.251.1",
|
||||
"flow-bin": "^0.250.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.24.0",
|
||||
"hermes-transform": "0.24.0",
|
||||
|
||||
@@ -22,7 +22,7 @@ import attachKeyHandlers from './attachKeyHandlers';
|
||||
import {
|
||||
createDevServerMiddleware,
|
||||
indexPageMiddleware,
|
||||
} from './middleware';
|
||||
} from '@react-native-community/cli-server-api';
|
||||
import {createDevMiddleware} from '@react-native/dev-middleware';
|
||||
import chalk from 'chalk';
|
||||
import Metro from 'metro';
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"nullthrows": "^1.1.1",
|
||||
"open": "^7.0.3",
|
||||
"selfsigned": "^2.4.1",
|
||||
"serve-static": "^1.16.2",
|
||||
"serve-static": "^1.13.1",
|
||||
"ws": "^6.2.3"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports = {
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.js'],
|
||||
parser: '@babel/eslint-parser',
|
||||
parser: 'hermes-eslint',
|
||||
plugins: ['ft-flow'],
|
||||
rules: {
|
||||
// Flow Plugin
|
||||
@@ -51,7 +51,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
files: ['*.jsx'],
|
||||
parser: '@babel/eslint-parser',
|
||||
parser: 'hermes-eslint',
|
||||
},
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.77.0-main",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -31,7 +30,8 @@
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-native": "^4.0.0"
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"hermes-eslint": "0.24.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=8",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
agp = "8.7.2"
|
||||
agp = "8.7.1"
|
||||
gson = "2.8.9"
|
||||
guava = "31.0.1-jre"
|
||||
javapoet = "1.13.0"
|
||||
|
||||
+4
-7
@@ -59,15 +59,15 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
|
||||
val cxxModuleCMakeListsPath = dep.cxxModuleCMakeListsPath
|
||||
if (libraryName != null && cmakeListsPath != null) {
|
||||
// If user provided a custom cmakeListsPath, let's honor it.
|
||||
val nativeFolderPath = sanitizeCmakeListsPath(cmakeListsPath)
|
||||
val nativeFolderPath = cmakeListsPath.replace("CMakeLists.txt", "")
|
||||
addDirectoryString +=
|
||||
"add_subdirectory(\"$nativeFolderPath\" ${libraryName}_autolinked_build)"
|
||||
"add_subdirectory($nativeFolderPath ${libraryName}_autolinked_build)"
|
||||
}
|
||||
if (cxxModuleCMakeListsPath != null) {
|
||||
// If user provided a custom cxxModuleCMakeListsPath, let's honor it.
|
||||
val nativeFolderPath = sanitizeCmakeListsPath(cxxModuleCMakeListsPath)
|
||||
val nativeFolderPath = cxxModuleCMakeListsPath.replace("CMakeLists.txt", "")
|
||||
addDirectoryString +=
|
||||
"\nadd_subdirectory(\"$nativeFolderPath\" ${libraryName}_cxxmodule_autolinked_build)"
|
||||
"\nadd_subdirectory($nativeFolderPath ${libraryName}_cxxmodule_autolinked_build)"
|
||||
}
|
||||
addDirectoryString
|
||||
}
|
||||
@@ -159,9 +159,6 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
|
||||
const val COMPONENT_DESCRIPTOR_FILENAME = "ComponentDescriptors.h"
|
||||
const val COMPONENT_INCLUDE_PATH = "react/renderer/components"
|
||||
|
||||
internal fun sanitizeCmakeListsPath(cmakeListsPath: String): String =
|
||||
cmakeListsPath.replace("CMakeLists.txt", "").replace(" ", "\\ ")
|
||||
|
||||
// language=cmake
|
||||
val CMAKE_TEMPLATE =
|
||||
"""
|
||||
|
||||
+5
-2
@@ -53,8 +53,11 @@ internal object NdkConfiguratorUtils {
|
||||
if (cmakeArgs.none { it.startsWith("-DANDROID_STL") }) {
|
||||
cmakeArgs.add("-DANDROID_STL=c++_shared")
|
||||
}
|
||||
if (cmakeArgs.none { it.startsWith("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES") }) {
|
||||
cmakeArgs.add("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON")
|
||||
// Due to the new NDK toolchain file, the C++ flags gets overridden between compilation
|
||||
// units. This is causing some libraries to don't be compiled with -DANDROID and other
|
||||
// crucial flags. This can be revisited once we bump to NDK 25/26
|
||||
if (cmakeArgs.none { it.startsWith("-DANDROID_USE_LEGACY_TOOLCHAIN_FILE") }) {
|
||||
cmakeArgs.add("-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON")
|
||||
}
|
||||
|
||||
val architectures = project.getReactNativeArchitectures()
|
||||
|
||||
+4
-23
@@ -11,7 +11,6 @@ import com.facebook.react.model.ModelAutolinkingConfigJson
|
||||
import com.facebook.react.model.ModelAutolinkingDependenciesJson
|
||||
import com.facebook.react.model.ModelAutolinkingDependenciesPlatformAndroidJson
|
||||
import com.facebook.react.model.ModelAutolinkingDependenciesPlatformJson
|
||||
import com.facebook.react.tasks.GenerateAutolinkingNewArchitecturesFileTask.Companion.sanitizeCmakeListsPath
|
||||
import com.facebook.react.tests.createTestTask
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.Rule
|
||||
@@ -146,9 +145,9 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
# or link against a old prefab target (this is needed for React Native 0.76 on).
|
||||
set(REACTNATIVE_MERGED_SO true)
|
||||
|
||||
add_subdirectory("./a/directory/" aPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/with\ spaces/" anotherPackage_autolinked_build)
|
||||
add_subdirectory("./another/directory/cxx/" anotherPackage_cxxmodule_autolinked_build)
|
||||
add_subdirectory(./a/directory/ aPackage_autolinked_build)
|
||||
add_subdirectory(./another/directory/ anotherPackage_autolinked_build)
|
||||
add_subdirectory(./another/directory/cxx/ anotherPackage_cxxmodule_autolinked_build)
|
||||
|
||||
set(AUTOLINKED_LIBRARIES
|
||||
react_codegen_aPackage
|
||||
@@ -259,24 +258,6 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
.trimIndent())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sanitizeCmakeListsPath_withPathEndingWithFileName_removesFilename() {
|
||||
val input = "./a/directory/CMakeLists.txt"
|
||||
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/directory/")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sanitizeCmakeListsPath_withSpaces_removesSpaces() {
|
||||
val input = "./a/dir ectory/with spaces/"
|
||||
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/dir\\ ectory/with\\ spaces/")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sanitizeCmakeListsPath_withPathEndingWithFileNameAndSpaces_sanitizesIt() {
|
||||
val input = "./a/dir ectory/CMakeLists.txt"
|
||||
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/dir\\ ectory/")
|
||||
}
|
||||
|
||||
private val testDependencies =
|
||||
listOf(
|
||||
ModelAutolinkingDependenciesPlatformAndroidJson(
|
||||
@@ -295,7 +276,7 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
buildTypes = emptyList(),
|
||||
libraryName = "anotherPackage",
|
||||
componentDescriptors = listOf("AnotherPackageComponentDescriptor"),
|
||||
cmakeListsPath = "./another/directory/with spaces/CMakeLists.txt",
|
||||
cmakeListsPath = "./another/directory/CMakeLists.txt",
|
||||
cxxModuleCMakeListsPath = "./another/directory/cxx/CMakeLists.txt",
|
||||
cxxModuleHeaderName = "AnotherCxxModule",
|
||||
cxxModuleCMakeListsModuleName = "another_cxxModule",
|
||||
|
||||
@@ -387,6 +387,15 @@ const LOG_LEVELS = {
|
||||
warn: 2,
|
||||
error: 3,
|
||||
};
|
||||
const INSPECTOR_LEVELS = [];
|
||||
INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';
|
||||
INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';
|
||||
INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';
|
||||
INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';
|
||||
|
||||
// Strip the inner function in getNativeLogFunction(), if in dev also
|
||||
// strip method printing to originalConsole.
|
||||
const INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;
|
||||
|
||||
function getNativeLogFunction(level) {
|
||||
return function () {
|
||||
@@ -420,6 +429,14 @@ function getNativeLogFunction(level) {
|
||||
// (Note: Logic duplicated in ExceptionsManager.js.)
|
||||
logLevel = LOG_LEVELS.warn;
|
||||
}
|
||||
if (global.__inspectorLog) {
|
||||
global.__inspectorLog(
|
||||
INSPECTOR_LEVELS[logLevel],
|
||||
str,
|
||||
[].slice.call(arguments),
|
||||
INSPECTOR_FRAMES_TO_SKIP,
|
||||
);
|
||||
}
|
||||
if (groupStack.length) {
|
||||
str = groupFormat('', str);
|
||||
}
|
||||
|
||||
+3
-10
@@ -286,11 +286,6 @@ export interface UnsafeAnyTypeAnnotation {
|
||||
readonly type: 'AnyTypeAnnotation',
|
||||
}
|
||||
|
||||
export interface NativeModuleNumberLiteralTypeAnnotation {
|
||||
readonly type: 'NumberLiteralTypeAnnotation';
|
||||
readonly value: number;
|
||||
}
|
||||
|
||||
export interface NativeModuleStringTypeAnnotation {
|
||||
readonly type: 'StringTypeAnnotation';
|
||||
}
|
||||
@@ -325,10 +320,10 @@ export interface NativeModuleBooleanTypeAnnotation {
|
||||
readonly type: 'BooleanTypeAnnotation';
|
||||
}
|
||||
|
||||
export type NativeModuleEnumMember = {
|
||||
export type NativeModuleEnumMembers = readonly {
|
||||
readonly name: string;
|
||||
readonly value: string | number;
|
||||
};
|
||||
}[];
|
||||
|
||||
export type NativeModuleEnumMemberType =
|
||||
| 'NumberTypeAnnotation'
|
||||
@@ -344,7 +339,7 @@ export interface NativeModuleEnumDeclarationWithMembers {
|
||||
name: string;
|
||||
type: 'EnumDeclarationWithMembers';
|
||||
memberType: NativeModuleEnumMemberType;
|
||||
members: readonly NativeModuleEnumMember[];
|
||||
members: NativeModuleEnumMembers;
|
||||
}
|
||||
|
||||
export interface NativeModuleGenericObjectTypeAnnotation {
|
||||
@@ -385,7 +380,6 @@ export type NativeModuleEventEmitterBaseTypeAnnotation =
|
||||
| NativeModuleFloatTypeAnnotation
|
||||
| NativeModuleInt32TypeAnnotation
|
||||
| NativeModuleNumberTypeAnnotation
|
||||
| NativeModuleNumberLiteralTypeAnnotation
|
||||
| NativeModuleStringTypeAnnotation
|
||||
| NativeModuleStringLiteralTypeAnnotation
|
||||
| NativeModuleStringLiteralUnionTypeAnnotation
|
||||
@@ -405,7 +399,6 @@ export type NativeModuleBaseTypeAnnotation =
|
||||
| NativeModuleStringLiteralTypeAnnotation
|
||||
| NativeModuleStringLiteralUnionTypeAnnotation
|
||||
| NativeModuleNumberTypeAnnotation
|
||||
| NativeModuleNumberLiteralTypeAnnotation
|
||||
| NativeModuleInt32TypeAnnotation
|
||||
| NativeModuleDoubleTypeAnnotation
|
||||
| NativeModuleFloatTypeAnnotation
|
||||
|
||||
+7
-12
@@ -37,11 +37,6 @@ export type Int32TypeAnnotation = $ReadOnly<{
|
||||
type: 'Int32TypeAnnotation',
|
||||
}>;
|
||||
|
||||
export type NumberLiteralTypeAnnotation = $ReadOnly<{
|
||||
type: 'NumberLiteralTypeAnnotation',
|
||||
value: number,
|
||||
}>;
|
||||
|
||||
export type StringTypeAnnotation = $ReadOnly<{
|
||||
type: 'StringTypeAnnotation',
|
||||
}>;
|
||||
@@ -309,10 +304,12 @@ export type NativeModuleNumberTypeAnnotation = $ReadOnly<{
|
||||
type: 'NumberTypeAnnotation',
|
||||
}>;
|
||||
|
||||
export type NativeModuleEnumMember = {
|
||||
name: string,
|
||||
value: string | number,
|
||||
};
|
||||
export type NativeModuleEnumMembers = $ReadOnlyArray<
|
||||
$ReadOnly<{
|
||||
name: string,
|
||||
value: string | number,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type NativeModuleEnumMemberType =
|
||||
| 'NumberTypeAnnotation'
|
||||
@@ -328,7 +325,7 @@ export type NativeModuleEnumDeclarationWithMembers = {
|
||||
name: string,
|
||||
type: 'EnumDeclarationWithMembers',
|
||||
memberType: NativeModuleEnumMemberType,
|
||||
members: $ReadOnlyArray<NativeModuleEnumMember>,
|
||||
members: NativeModuleEnumMembers,
|
||||
};
|
||||
|
||||
export type NativeModuleGenericObjectTypeAnnotation = $ReadOnly<{
|
||||
@@ -369,7 +366,6 @@ type NativeModuleEventEmitterBaseTypeAnnotation =
|
||||
| FloatTypeAnnotation
|
||||
| Int32TypeAnnotation
|
||||
| NativeModuleNumberTypeAnnotation
|
||||
| NumberLiteralTypeAnnotation
|
||||
| StringTypeAnnotation
|
||||
| StringLiteralTypeAnnotation
|
||||
| StringLiteralUnionTypeAnnotation
|
||||
@@ -389,7 +385,6 @@ export type NativeModuleBaseTypeAnnotation =
|
||||
| StringLiteralTypeAnnotation
|
||||
| StringLiteralUnionTypeAnnotation
|
||||
| NativeModuleNumberTypeAnnotation
|
||||
| NumberLiteralTypeAnnotation
|
||||
| Int32TypeAnnotation
|
||||
| DoubleTypeAnnotation
|
||||
| FloatTypeAnnotation
|
||||
|
||||
@@ -186,8 +186,6 @@ function serializeArg(
|
||||
return wrap(val => `${val}.asNumber()`);
|
||||
case 'Int32TypeAnnotation':
|
||||
return wrap(val => `${val}.asNumber()`);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrap(val => `${val}.asNumber()`);
|
||||
case 'ArrayTypeAnnotation':
|
||||
return wrap(val => `${val}.asObject(rt).asArray(rt)`);
|
||||
case 'FunctionTypeAnnotation':
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {
|
||||
import type {
|
||||
NativeModuleAliasMap,
|
||||
NativeModuleEnumMap,
|
||||
NativeModuleEnumMember,
|
||||
NativeModuleEnumMembers,
|
||||
NativeModuleEnumMemberType,
|
||||
NativeModuleEventEmitterShape,
|
||||
NativeModuleFunctionTypeAnnotation,
|
||||
@@ -179,8 +179,6 @@ function translatePrimitiveJSTypeToCpp(
|
||||
return wrapOptional('jsi::String', isRequired);
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'DoubleTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
@@ -409,7 +407,7 @@ struct Bridging<${enumName}> {
|
||||
function generateEnum(
|
||||
hasteModuleName: string,
|
||||
origEnumName: string,
|
||||
members: $ReadOnlyArray<NativeModuleEnumMember>,
|
||||
members: NativeModuleEnumMembers,
|
||||
memberType: NativeModuleEnumMemberType,
|
||||
): string {
|
||||
const enumName = getEnumName(hasteModuleName, origEnumName);
|
||||
|
||||
-7
@@ -136,7 +136,6 @@ function translateEventEmitterTypeToJavaType(
|
||||
case 'StringLiteralUnionTypeAnnotation':
|
||||
return 'String';
|
||||
case 'NumberTypeAnnotation':
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
case 'FloatTypeAnnotation':
|
||||
case 'DoubleTypeAnnotation':
|
||||
case 'Int32TypeAnnotation':
|
||||
@@ -204,8 +203,6 @@ function translateFunctionParamToJavaType(
|
||||
return wrapOptional('String', isRequired);
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'DoubleTypeAnnotation':
|
||||
@@ -300,8 +297,6 @@ function translateFunctionReturnTypeToJavaType(
|
||||
return wrapOptional('String', isRequired);
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapOptional('double', isRequired);
|
||||
case 'DoubleTypeAnnotation':
|
||||
@@ -378,8 +373,6 @@ function getFalsyReturnStatementFromReturnType(
|
||||
return '';
|
||||
case 'NumberTypeAnnotation':
|
||||
return nullable ? 'return null;' : 'return 0;';
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return nullable ? 'return null;' : 'return 0;';
|
||||
case 'FloatTypeAnnotation':
|
||||
return nullable ? 'return null;' : 'return 0.0;';
|
||||
case 'DoubleTypeAnnotation':
|
||||
|
||||
@@ -197,8 +197,6 @@ function translateReturnTypeToKind(
|
||||
}
|
||||
case 'NumberTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'DoubleTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'FloatTypeAnnotation':
|
||||
@@ -282,8 +280,6 @@ function translateParamTypeToJniType(
|
||||
}
|
||||
case 'NumberTypeAnnotation':
|
||||
return !isRequired ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return !isRequired ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'DoubleTypeAnnotation':
|
||||
return !isRequired ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'FloatTypeAnnotation':
|
||||
@@ -364,8 +360,6 @@ function translateReturnTypeToJniType(
|
||||
}
|
||||
case 'NumberTypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'DoubleTypeAnnotation':
|
||||
return nullable ? 'Ljava/lang/Double;' : 'D';
|
||||
case 'FloatTypeAnnotation':
|
||||
|
||||
Vendored
-2
@@ -23,7 +23,6 @@ import type {
|
||||
NativeModuleObjectTypeAnnotation,
|
||||
NativeModuleTypeAliasTypeAnnotation,
|
||||
Nullable,
|
||||
NumberLiteralTypeAnnotation,
|
||||
ReservedTypeAnnotation,
|
||||
StringLiteralTypeAnnotation,
|
||||
StringLiteralUnionTypeAnnotation,
|
||||
@@ -64,7 +63,6 @@ export type StructTypeAnnotation =
|
||||
| StringLiteralTypeAnnotation
|
||||
| StringLiteralUnionTypeAnnotation
|
||||
| NativeModuleNumberTypeAnnotation
|
||||
| NumberLiteralTypeAnnotation
|
||||
| Int32TypeAnnotation
|
||||
| DoubleTypeAnnotation
|
||||
| FloatTypeAnnotation
|
||||
|
||||
-4
@@ -100,8 +100,6 @@ function toObjCType(
|
||||
return 'NSString *';
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'Int32TypeAnnotation':
|
||||
@@ -185,8 +183,6 @@ function toObjCValue(
|
||||
return value;
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapPrimitive('double');
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapPrimitive('double');
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapPrimitive('double');
|
||||
case 'Int32TypeAnnotation':
|
||||
|
||||
-4
@@ -91,8 +91,6 @@ function toObjCType(
|
||||
return 'NSString *';
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapCxxOptional('double', isRequired);
|
||||
case 'Int32TypeAnnotation':
|
||||
@@ -175,8 +173,6 @@ function toObjCValue(
|
||||
return RCTBridgingTo('String');
|
||||
case 'NumberTypeAnnotation':
|
||||
return RCTBridgingTo('Double');
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return RCTBridgingTo('Double');
|
||||
case 'FloatTypeAnnotation':
|
||||
return RCTBridgingTo('Double');
|
||||
case 'Int32TypeAnnotation':
|
||||
|
||||
Vendored
-1
@@ -25,7 +25,6 @@ function getEventEmitterTypeObjCType(
|
||||
case 'StringLiteralUnionTypeAnnotation':
|
||||
return 'NSString *_Nonnull';
|
||||
case 'NumberTypeAnnotation':
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return 'NSNumber *_Nonnull';
|
||||
case 'BooleanTypeAnnotation':
|
||||
return 'BOOL';
|
||||
|
||||
Vendored
-6
@@ -263,8 +263,6 @@ function getParamObjCType(
|
||||
return notStruct(wrapOptional('NSString *', !nullable));
|
||||
case 'NumberTypeAnnotation':
|
||||
return notStruct(isRequired ? 'double' : 'NSNumber *');
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return notStruct(isRequired ? 'double' : 'NSNumber *');
|
||||
case 'FloatTypeAnnotation':
|
||||
return notStruct(isRequired ? 'float' : 'NSNumber *');
|
||||
case 'DoubleTypeAnnotation':
|
||||
@@ -346,8 +344,6 @@ function getReturnObjCType(
|
||||
return wrapOptional('NSString *', isRequired);
|
||||
case 'NumberTypeAnnotation':
|
||||
return wrapOptional('NSNumber *', isRequired);
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return wrapOptional('NSNumber *', isRequired);
|
||||
case 'FloatTypeAnnotation':
|
||||
return wrapOptional('NSNumber *', isRequired);
|
||||
case 'DoubleTypeAnnotation':
|
||||
@@ -418,8 +414,6 @@ function getReturnJSType(
|
||||
return 'StringKind';
|
||||
case 'NumberTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'NumberLiteralTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'FloatTypeAnnotation':
|
||||
return 'NumberKind';
|
||||
case 'DoubleTypeAnnotation':
|
||||
|
||||
-1
@@ -126,7 +126,6 @@ import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
export interface Spec extends TurboModule {
|
||||
+passBool?: (arg: boolean) => void;
|
||||
+passNumber: (arg: number) => void;
|
||||
+passNumberLiteral: (arg: 4) => void;
|
||||
+passString: (arg: string) => void;
|
||||
+passStringish: (arg: Stringish) => void;
|
||||
+passStringLiteral: (arg: 'A String Literal') => void;
|
||||
|
||||
-20
@@ -978,26 +978,6 @@ exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_BASIC_PA
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'passNumberLiteral',
|
||||
'optional': false,
|
||||
'typeAnnotation': {
|
||||
'type': 'FunctionTypeAnnotation',
|
||||
'returnTypeAnnotation': {
|
||||
'type': 'VoidTypeAnnotation'
|
||||
},
|
||||
'params': [
|
||||
{
|
||||
'name': 'arg',
|
||||
'optional': false,
|
||||
'typeAnnotation': {
|
||||
'type': 'NumberLiteralTypeAnnotation',
|
||||
'value': 4
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'passString',
|
||||
'optional': false,
|
||||
|
||||
@@ -38,7 +38,6 @@ const {
|
||||
emitCommonTypes,
|
||||
emitDictionary,
|
||||
emitFunction,
|
||||
emitNumberLiteral,
|
||||
emitPromise,
|
||||
emitRootTag,
|
||||
emitUnion,
|
||||
@@ -244,9 +243,6 @@ function translateTypeAnnotation(
|
||||
case 'UnionTypeAnnotation': {
|
||||
return emitUnion(nullable, hasteModuleName, typeAnnotation, parser);
|
||||
}
|
||||
case 'NumberLiteralTypeAnnotation': {
|
||||
return emitNumberLiteral(nullable, typeAnnotation.value);
|
||||
}
|
||||
case 'StringLiteralTypeAnnotation': {
|
||||
return wrapNullable(nullable, {
|
||||
type: 'StringLiteralTypeAnnotation',
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
NamedShape,
|
||||
NativeModuleAliasMap,
|
||||
NativeModuleEnumMap,
|
||||
NativeModuleEnumMember,
|
||||
NativeModuleEnumMembers,
|
||||
NativeModuleEnumMemberType,
|
||||
NativeModuleParamTypeAnnotation,
|
||||
Nullable,
|
||||
@@ -227,9 +227,7 @@ class FlowParser implements Parser {
|
||||
});
|
||||
}
|
||||
|
||||
parseEnumMembers(
|
||||
typeAnnotation: $FlowFixMe,
|
||||
): $ReadOnlyArray<NativeModuleEnumMember> {
|
||||
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
|
||||
return typeAnnotation.members.map(member => ({
|
||||
name: member.id.name,
|
||||
value: member.init?.value ?? member.id.name,
|
||||
|
||||
+2
-4
@@ -15,7 +15,7 @@ import type {
|
||||
NamedShape,
|
||||
NativeModuleAliasMap,
|
||||
NativeModuleEnumMap,
|
||||
NativeModuleEnumMember,
|
||||
NativeModuleEnumMembers,
|
||||
NativeModuleEnumMemberType,
|
||||
NativeModuleParamTypeAnnotation,
|
||||
Nullable,
|
||||
@@ -240,9 +240,7 @@ export interface Parser {
|
||||
/**
|
||||
* Calculates enum's members
|
||||
*/
|
||||
parseEnumMembers(
|
||||
typeAnnotation: $FlowFixMe,
|
||||
): $ReadOnlyArray<NativeModuleEnumMember>;
|
||||
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers;
|
||||
|
||||
/**
|
||||
* Given a node, it returns true if it is a module interface
|
||||
|
||||
+2
-4
@@ -15,7 +15,7 @@ import type {
|
||||
NamedShape,
|
||||
NativeModuleAliasMap,
|
||||
NativeModuleEnumMap,
|
||||
NativeModuleEnumMember,
|
||||
NativeModuleEnumMembers,
|
||||
NativeModuleEnumMemberType,
|
||||
NativeModuleParamTypeAnnotation,
|
||||
Nullable,
|
||||
@@ -168,9 +168,7 @@ export class MockedParser implements Parser {
|
||||
return;
|
||||
}
|
||||
|
||||
parseEnumMembers(
|
||||
typeAnnotation: $FlowFixMe,
|
||||
): $ReadOnlyArray<NativeModuleEnumMember> {
|
||||
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
|
||||
return typeAnnotation.type === 'StringTypeAnnotation'
|
||||
? [
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ import type {
|
||||
NativeModuleTypeAnnotation,
|
||||
NativeModuleUnionTypeAnnotation,
|
||||
Nullable,
|
||||
NumberLiteralTypeAnnotation,
|
||||
ObjectTypeAnnotation,
|
||||
ReservedTypeAnnotation,
|
||||
StringLiteralTypeAnnotation,
|
||||
@@ -171,16 +170,6 @@ function emitMixed(
|
||||
});
|
||||
}
|
||||
|
||||
function emitNumberLiteral(
|
||||
nullable: boolean,
|
||||
value: number,
|
||||
): Nullable<NumberLiteralTypeAnnotation> {
|
||||
return wrapNullable(nullable, {
|
||||
type: 'NumberLiteralTypeAnnotation',
|
||||
value,
|
||||
});
|
||||
}
|
||||
|
||||
function emitString(nullable: boolean): Nullable<StringTypeAnnotation> {
|
||||
return wrapNullable(nullable, {
|
||||
type: 'StringTypeAnnotation',
|
||||
@@ -773,7 +762,6 @@ module.exports = {
|
||||
emitInt32Prop,
|
||||
emitMixedProp,
|
||||
emitNumber,
|
||||
emitNumberLiteral,
|
||||
emitGenericObject,
|
||||
emitDictionary,
|
||||
emitObject,
|
||||
|
||||
-1
@@ -113,7 +113,6 @@ import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
export interface Spec extends TurboModule {
|
||||
readonly passBool?: (arg: boolean) => void;
|
||||
readonly passNumber: (arg: number) => void;
|
||||
readonly passNumberLiteral: (arg: 4) => void;
|
||||
readonly passString: (arg: string) => void;
|
||||
readonly passStringish: (arg: Stringish) => void;
|
||||
readonly passStringLiteral: (arg: 'A String Literal') => void;
|
||||
|
||||
-20
@@ -1123,26 +1123,6 @@ exports[`RN Codegen TypeScript Parser can generate fixture NATIVE_MODULE_WITH_BA
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'passNumberLiteral',
|
||||
'optional': false,
|
||||
'typeAnnotation': {
|
||||
'type': 'FunctionTypeAnnotation',
|
||||
'returnTypeAnnotation': {
|
||||
'type': 'VoidTypeAnnotation'
|
||||
},
|
||||
'params': [
|
||||
{
|
||||
'name': 'arg',
|
||||
'optional': false,
|
||||
'typeAnnotation': {
|
||||
'type': 'NumberLiteralTypeAnnotation',
|
||||
'value': 4
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'passString',
|
||||
'optional': false,
|
||||
|
||||
@@ -37,7 +37,6 @@ const {
|
||||
emitCommonTypes,
|
||||
emitDictionary,
|
||||
emitFunction,
|
||||
emitNumberLiteral,
|
||||
emitPromise,
|
||||
emitRootTag,
|
||||
emitStringLiteral,
|
||||
@@ -404,9 +403,6 @@ function translateTypeAnnotation(
|
||||
case 'StringLiteral': {
|
||||
return emitStringLiteral(nullable, literal.value);
|
||||
}
|
||||
case 'NumericLiteral': {
|
||||
return emitNumberLiteral(nullable, literal.value);
|
||||
}
|
||||
default: {
|
||||
throw new UnsupportedTypeAnnotationParserError(
|
||||
hasteModuleName,
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
NamedShape,
|
||||
NativeModuleAliasMap,
|
||||
NativeModuleEnumMap,
|
||||
NativeModuleEnumMember,
|
||||
NativeModuleEnumMembers,
|
||||
NativeModuleEnumMemberType,
|
||||
NativeModuleParamTypeAnnotation,
|
||||
Nullable,
|
||||
@@ -223,9 +223,7 @@ class TypeScriptParser implements Parser {
|
||||
});
|
||||
}
|
||||
|
||||
parseEnumMembers(
|
||||
typeAnnotation: $FlowFixMe,
|
||||
): $ReadOnlyArray<NativeModuleEnumMember> {
|
||||
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
|
||||
return typeAnnotation.members.map(member => ({
|
||||
name: member.id.name,
|
||||
value: member.initializer?.value ?? member.id.name,
|
||||
|
||||
@@ -16,5 +16,5 @@ import * as React from 'react';
|
||||
|
||||
export default (createAnimatedComponent(FlatList): AnimatedComponentType<
|
||||
React.ElementConfig<typeof FlatList>,
|
||||
FlatList<mixed>,
|
||||
React.ElementRef<typeof FlatList>,
|
||||
>);
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#import <React/RCTBridgeDelegate.h>
|
||||
#import <React/RCTConvert.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RCTArchConfiguratorProtocol.h"
|
||||
#import "RCTRootViewFactory.h"
|
||||
#import "RCTUIConfiguratorProtocol.h"
|
||||
|
||||
@class RCTBridge;
|
||||
@protocol RCTBridgeDelegate;
|
||||
@@ -57,12 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
(const facebook::react::ObjCTurboModule::InitParams &)params
|
||||
* - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
||||
*/
|
||||
@interface RCTAppDelegate : UIResponder <
|
||||
UIApplicationDelegate,
|
||||
UISceneDelegate,
|
||||
RCTBridgeDelegate,
|
||||
RCTUIConfiguratorProtocol,
|
||||
RCTArchConfiguratorProtocol>
|
||||
@interface RCTAppDelegate : UIResponder <UIApplicationDelegate, UISceneDelegate, RCTBridgeDelegate>
|
||||
|
||||
/// The window object, used to render the UViewControllers
|
||||
@property (nonatomic, strong, nonnull) UIWindow *window;
|
||||
@@ -103,6 +96,48 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
|
||||
moduleName:(NSString *)moduleName
|
||||
initProps:(NSDictionary *)initProps;
|
||||
/**
|
||||
* This method can be used to customize the rootView that is passed to React Native.
|
||||
* A typical example is to override this method in the AppDelegate to change the background color.
|
||||
* To achieve this, add in your `AppDelegate.mm`:
|
||||
* ```
|
||||
* - (void)customizeRootView:(RCTRootView *)rootView
|
||||
* {
|
||||
* rootView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) {
|
||||
* if ([traitCollection userInterfaceStyle] == UIUserInterfaceStyleDark) {
|
||||
* return [UIColor blackColor];
|
||||
* } else {
|
||||
* return [UIColor whiteColor];
|
||||
* }
|
||||
* }];
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @parameter: rootView - The root view to customize.
|
||||
*/
|
||||
- (void)customizeRootView:(RCTRootView *)rootView;
|
||||
|
||||
/**
|
||||
* It creates the RootViewController.
|
||||
* By default, it creates a new instance of a `UIViewController`.
|
||||
* You can override it to provide your own initial ViewController.
|
||||
*
|
||||
* @return: an instance of `UIViewController`.
|
||||
*/
|
||||
- (UIViewController *)createRootViewController;
|
||||
|
||||
/**
|
||||
* It assigns the rootView to the rootViewController
|
||||
* By default, it assigns the rootView to the view property of the rootViewController
|
||||
* If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
|
||||
* For example: UISplitViewController requires `setViewController(_:for:)`
|
||||
*/
|
||||
- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
|
||||
|
||||
/**
|
||||
* The default `RCTColorSpace` for the app. It defaults to `RCTColorSpaceSRGB`.
|
||||
*/
|
||||
@property (nonatomic, readonly) RCTColorSpace defaultColorSpace;
|
||||
|
||||
/// This method returns a map of Component Descriptors and Components classes that needs to be registered in the
|
||||
/// new renderer. The Component Descriptor is a string which represent the name used in JS to refer to the native
|
||||
@@ -112,6 +147,27 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @return a dictionary that associate a component for the new renderer with his descriptor.
|
||||
- (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
||||
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
|
||||
///
|
||||
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
|
||||
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
///
|
||||
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native's new initialization layer is enabled.
|
||||
///
|
||||
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native uses new Architecture.
|
||||
///
|
||||
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
|
||||
- (BOOL)newArchEnabled;
|
||||
|
||||
/// Return the bundle URL for the main bundle.
|
||||
- (NSURL *__nullable)bundleURL;
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#endif
|
||||
#import <react/nativemodule/defaults/DefaultTurboModules.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
@interface RCTAppDelegate () <RCTComponentViewFactoryComponentProvider, RCTHostDelegate>
|
||||
@end
|
||||
|
||||
@@ -181,6 +179,18 @@ using namespace facebook::react;
|
||||
{
|
||||
}
|
||||
|
||||
- (void)host:(RCTHost *)host
|
||||
didReceiveJSErrorStack:(NSArray<NSDictionary<NSString *, id> *> *)stack
|
||||
message:(NSString *)message
|
||||
originalMessage:(NSString *_Nullable)originalMessage
|
||||
name:(NSString *_Nullable)name
|
||||
componentStack:(NSString *_Nullable)componentStack
|
||||
exceptionId:(NSUInteger)exceptionId
|
||||
isFatal:(BOOL)isFatal
|
||||
extraData:(NSDictionary<NSString *, id> *)extraData
|
||||
{
|
||||
}
|
||||
|
||||
#pragma mark - Bridge and Bridge Adapter properties
|
||||
|
||||
- (RCTBridge *)bridge
|
||||
@@ -214,14 +224,15 @@ using namespace facebook::react;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (std::shared_ptr<TurboModule>)getTurboModule:(const std::string &)name
|
||||
jsInvoker:(std::shared_ptr<CallInvoker>)jsInvoker
|
||||
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
||||
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
||||
{
|
||||
return DefaultTurboModules::getTurboModule(name, jsInvoker);
|
||||
return facebook::react::DefaultTurboModules::getTurboModule(name, jsInvoker);
|
||||
}
|
||||
|
||||
- (std::shared_ptr<TurboModule>)getTurboModule:(const std::string &)name
|
||||
initParams:(const ObjCTurboModule::InitParams &)params
|
||||
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
||||
initParams:
|
||||
(const facebook::react::ObjCTurboModule::InitParams &)params
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
@@ -295,7 +306,7 @@ using namespace facebook::react;
|
||||
|
||||
#pragma mark - Feature Flags
|
||||
|
||||
class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefaults {
|
||||
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
|
||||
public:
|
||||
bool enableBridgelessArchitecture() override
|
||||
{
|
||||
@@ -309,16 +320,12 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool useNativeViewConfigsInBridgelessMode() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
- (void)_setUpFeatureFlags
|
||||
{
|
||||
if ([self bridgelessEnabled]) {
|
||||
ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
|
||||
facebook::react::ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,7 @@ RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary
|
||||
id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
|
||||
moduleName:moduleName
|
||||
initialProperties:initialProperties];
|
||||
UIView *rootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
||||
[surface start];
|
||||
return rootView;
|
||||
return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
||||
}
|
||||
return [[RCTRootView alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <React/RCTConvert.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@protocol RCTArchConfiguratorProtocol
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
|
||||
///
|
||||
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
|
||||
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
///
|
||||
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native's new initialization layer is enabled.
|
||||
///
|
||||
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native uses new Architecture.
|
||||
///
|
||||
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
|
||||
- (BOOL)newArchEnabled;
|
||||
@end
|
||||
@@ -26,6 +26,7 @@
|
||||
#import <React/RCTFabricSurface.h>
|
||||
#import <React/RCTSurfaceHostingProxyRootView.h>
|
||||
#import <React/RCTSurfacePresenter.h>
|
||||
#import <ReactCommon/RCTContextContainerHandling.h>
|
||||
#if USE_HERMES
|
||||
#import <ReactCommon/RCTHermesInstance.h>
|
||||
#else
|
||||
@@ -34,6 +35,7 @@
|
||||
#import <ReactCommon/RCTHost+Internal.h>
|
||||
#import <ReactCommon/RCTHost.h>
|
||||
#import <ReactCommon/RCTTurboModuleManager.h>
|
||||
#import <react/config/ReactNativeConfig.h>
|
||||
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
||||
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
|
||||
#import <react/runtime/JSRuntimeFactory.h>
|
||||
@@ -97,8 +99,13 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
|
||||
@interface RCTRootViewFactory () <RCTContextContainerHandling> {
|
||||
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
||||
facebook::react::ContextContainer::Shared _contextContainer;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
|
||||
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
|
||||
}
|
||||
@end
|
||||
@@ -117,6 +124,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
_configuration = configuration;
|
||||
_hostDelegate = hostdelegate;
|
||||
_contextContainer = std::make_shared<const facebook::react::ContextContainer>();
|
||||
_reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
|
||||
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
||||
_turboModuleManagerDelegate = turboModuleManagerDelegate;
|
||||
}
|
||||
return self;
|
||||
@@ -152,9 +161,12 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
initialProperties:(NSDictionary *)initialProperties
|
||||
launchOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
NSDictionary *initProps = updateInitialProps(initialProperties, _configuration.fabricEnabled);
|
||||
NSDictionary *initProps = updateInitialProps(initialProperties, self->_configuration.fabricEnabled);
|
||||
|
||||
if (self->_configuration.bridgelessEnabled) {
|
||||
// Enable native view config interop only if both bridgeless mode and Fabric is enabled.
|
||||
RCTSetUseNativeViewConfigsInBridgelessMode(self->_configuration.fabricEnabled);
|
||||
|
||||
if (_configuration.bridgelessEnabled) {
|
||||
// Enable TurboModule interop by default in Bridgeless mode
|
||||
RCTEnableTurboModuleInterop(YES);
|
||||
RCTEnableTurboModuleInteropBridgeProxy(YES);
|
||||
@@ -163,8 +175,9 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
|
||||
RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName initialProperties:initProps];
|
||||
|
||||
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView =
|
||||
[[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
||||
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
|
||||
initWithSurface:surface
|
||||
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
|
||||
|
||||
surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor];
|
||||
if (self->_configuration.customizeRootView != nil) {
|
||||
@@ -177,8 +190,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
[self createBridgeAdapterIfNeeded];
|
||||
|
||||
UIView *rootView;
|
||||
if (_configuration.createRootViewWithBridge != nil) {
|
||||
rootView = _configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
|
||||
if (self->_configuration.createRootViewWithBridge != nil) {
|
||||
rootView = self->_configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
|
||||
} else {
|
||||
rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
|
||||
}
|
||||
@@ -272,6 +285,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
[reactHost setBundleURLProvider:^NSURL *() {
|
||||
return [weakSelf bundleURL];
|
||||
}];
|
||||
[reactHost setContextContainerHandler:self];
|
||||
[reactHost start];
|
||||
return reactHost;
|
||||
}
|
||||
@@ -279,12 +293,18 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
- (std::shared_ptr<facebook::react::JSRuntimeFactory>)createJSRuntimeFactory
|
||||
{
|
||||
#if USE_HERMES
|
||||
return std::make_shared<facebook::react::RCTHermesInstance>(nullptr, nullptr, /* allocInOldGenBeforeTTI */ false);
|
||||
return std::make_shared<facebook::react::RCTHermesInstance>(
|
||||
_reactNativeConfig, nullptr, /* allocInOldGenBeforeTTI */ false);
|
||||
#else
|
||||
return std::make_shared<facebook::react::RCTJscInstance>();
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)didCreateContextContainer:(std::shared_ptr<facebook::react::ContextContainer>)contextContainer
|
||||
{
|
||||
contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
||||
}
|
||||
|
||||
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
|
||||
{
|
||||
if (_configuration.extraModulesForBridge != nil) {
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <React/RCTConvert.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class RCTRootView;
|
||||
|
||||
@protocol RCTUIConfiguratorProtocol
|
||||
/**
|
||||
* The default `RCTColorSpace` for the app. It defaults to `RCTColorSpaceSRGB`.
|
||||
*/
|
||||
- (RCTColorSpace)defaultColorSpace;
|
||||
|
||||
/**
|
||||
* This method can be used to customize the rootView that is passed to React Native.
|
||||
* A typical example is to override this method in the AppDelegate to change the background color.
|
||||
* To achieve this, add in your `AppDelegate.mm`:
|
||||
* ```
|
||||
* - (void)customizeRootView:(RCTRootView *)rootView
|
||||
* {
|
||||
* rootView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) {
|
||||
* if ([traitCollection userInterfaceStyle] == UIUserInterfaceStyleDark) {
|
||||
* return [UIColor blackColor];
|
||||
* } else {
|
||||
* return [UIColor whiteColor];
|
||||
* }
|
||||
* }];
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @parameter: rootView - The root view to customize.
|
||||
*/
|
||||
- (void)customizeRootView:(RCTRootView *)rootView;
|
||||
|
||||
/**
|
||||
* It creates the RootViewController.
|
||||
* By default, it creates a new instance of a `UIViewController`.
|
||||
* You can override it to provide your own initial ViewController.
|
||||
*
|
||||
* @return: an instance of `UIViewController`.
|
||||
*/
|
||||
- (UIViewController *)createRootViewController;
|
||||
|
||||
/**
|
||||
* It assigns the rootView to the rootViewController
|
||||
* By default, it assigns the rootView to the view property of the rootViewController
|
||||
* If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
|
||||
* For example: UISplitViewController requires `setViewController(_:for:)`
|
||||
*/
|
||||
- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
|
||||
@end
|
||||
+1
-8
@@ -55,7 +55,6 @@ const EventNames: Map<
|
||||
['highTextContrastChanged', 'highTextContrastDidChange'],
|
||||
['screenReaderChanged', 'touchExplorationDidChange'],
|
||||
['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
|
||||
['invertColorsChanged', 'invertColorDidChange'],
|
||||
])
|
||||
: new Map([
|
||||
['announcementFinished', 'announcementFinished'],
|
||||
@@ -139,13 +138,7 @@ const AccessibilityInfo = {
|
||||
*/
|
||||
isInvertColorsEnabled(): Promise<boolean> {
|
||||
if (Platform.OS === 'android') {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
|
||||
NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
|
||||
} else {
|
||||
reject(null);
|
||||
}
|
||||
});
|
||||
return Promise.resolve(false);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (NativeAccessibilityManagerIOS != null) {
|
||||
|
||||
@@ -211,11 +211,4 @@ export interface ViewProps
|
||||
* Used to reference react managed views from native code.
|
||||
*/
|
||||
nativeID?: string | undefined;
|
||||
|
||||
/**
|
||||
* Contols whether this view, and its transitive children, are laid in a way
|
||||
* consistent with web browsers ('strict'), or consistent with existing
|
||||
* React Native code which may rely on incorrect behavior ('classic').
|
||||
*/
|
||||
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
|
||||
}
|
||||
|
||||
+11
-25
@@ -142,11 +142,7 @@ let inExceptionHandler = false;
|
||||
*/
|
||||
function handleException(e: mixed, isFatal: boolean) {
|
||||
// TODO(T196834299): We should really use a c++ turbomodule for this
|
||||
const reportToConsole = true;
|
||||
if (
|
||||
!global.RN$handleException ||
|
||||
!global.RN$handleException(e, isFatal, reportToConsole)
|
||||
) {
|
||||
if (!global.RN$handleException || !global.RN$handleException(e, isFatal)) {
|
||||
let error: Error;
|
||||
if (e instanceof Error) {
|
||||
error = e;
|
||||
@@ -162,7 +158,7 @@ function handleException(e: mixed, isFatal: boolean) {
|
||||
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
||||
* parameters */
|
||||
// $FlowFixMe[incompatible-call]
|
||||
reportException(error, isFatal, reportToConsole);
|
||||
reportException(error, isFatal, /*reportToConsole*/ true);
|
||||
} finally {
|
||||
inExceptionHandler = false;
|
||||
}
|
||||
@@ -177,10 +173,7 @@ function reactConsoleErrorHandler(...args) {
|
||||
if (!console.reportErrorsAsExceptions) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
inExceptionHandler ||
|
||||
(global.RN$inExceptionHandler && global.RN$inExceptionHandler())
|
||||
) {
|
||||
if (inExceptionHandler) {
|
||||
// The fundamental trick here is that are multiple entry point to logging errors:
|
||||
// (see D19743075 for more background)
|
||||
//
|
||||
@@ -234,21 +227,14 @@ function reactConsoleErrorHandler(...args) {
|
||||
error.name = 'console.error';
|
||||
}
|
||||
|
||||
const isFatal = false;
|
||||
const reportToConsole = false;
|
||||
if (
|
||||
!global.RN$handleException ||
|
||||
!global.RN$handleException(error, isFatal, reportToConsole)
|
||||
) {
|
||||
reportException(
|
||||
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
||||
* parameters */
|
||||
// $FlowFixMe[incompatible-call]
|
||||
error,
|
||||
isFatal,
|
||||
reportToConsole,
|
||||
);
|
||||
}
|
||||
reportException(
|
||||
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
||||
* parameters */
|
||||
// $FlowFixMe[incompatible-call]
|
||||
error,
|
||||
false, // isFatal
|
||||
false, // reportToConsole
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+29
-20
@@ -60,28 +60,18 @@ export interface ImagePropsIOS {
|
||||
interface ImagePropsAndroid {
|
||||
/**
|
||||
* The mechanism that should be used to resize the image when the image's dimensions
|
||||
* differ from the image view's dimensions. Defaults to `auto`.
|
||||
* differ from the image view's dimensions. Defaults to auto.
|
||||
*
|
||||
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
||||
* 'auto': Use heuristics to pick between resize and scale.
|
||||
*
|
||||
* - `resize`: A software operation which changes the encoded image in memory before it
|
||||
* gets decoded. This should be used instead of `scale` when the image is much larger
|
||||
* than the view.
|
||||
* 'resize': A software operation which changes the encoded image in memory before it gets decoded.
|
||||
* This should be used instead of scale when the image is much larger than the view.
|
||||
*
|
||||
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
|
||||
* faster (usually hardware accelerated) and produces higher quality images. This
|
||||
* should be used if the image is smaller than the view. It should also be used if the
|
||||
* image is slightly bigger than the view.
|
||||
*
|
||||
* - `none`: No sampling is performed and the image is displayed in its full resolution. This
|
||||
* should only be used in rare circumstances because it is considered unsafe as Android will
|
||||
* throw a runtime exception when trying to render images that consume too much memory.
|
||||
*
|
||||
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
|
||||
*
|
||||
* @platform android
|
||||
* 'scale': The image gets drawn downscaled or upscaled. Compared to resize, scale is faster (usually hardware accelerated)
|
||||
* and produces higher quality images. This should be used if the image is smaller than the view.
|
||||
* It should also be used if the image is slightly bigger than the view.
|
||||
*/
|
||||
resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined;
|
||||
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
|
||||
|
||||
/**
|
||||
* Duration of fade in animation in ms. Defaults to 300
|
||||
@@ -200,11 +190,30 @@ export interface ImagePropsBase
|
||||
* 'center': Scale the image down so that it is completely visible,
|
||||
* if bigger than the area of the view.
|
||||
* The image will not be scaled up.
|
||||
*
|
||||
* 'none': Do not resize the image. The image will be displayed at its intrinsic size.
|
||||
*/
|
||||
resizeMode?: ImageResizeMode | undefined;
|
||||
|
||||
/**
|
||||
* The mechanism that should be used to resize the image when the image's dimensions
|
||||
* differ from the image view's dimensions. Defaults to `auto`.
|
||||
*
|
||||
* - `auto`: Use heuristics to pick between `resize` and `scale`.
|
||||
*
|
||||
* - `resize`: A software operation which changes the encoded image in memory before it
|
||||
* gets decoded. This should be used instead of `scale` when the image is much larger
|
||||
* than the view.
|
||||
*
|
||||
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
|
||||
* faster (usually hardware accelerated) and produces higher quality images. This
|
||||
* should be used if the image is smaller than the view. It should also be used if the
|
||||
* image is slightly bigger than the view.
|
||||
*
|
||||
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
|
||||
|
||||
/**
|
||||
* The image source (either a remote URL or a local file resource).
|
||||
*
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ import type {
|
||||
} from '../StyleSheet/StyleSheet';
|
||||
import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
|
||||
import typeof Image from './Image';
|
||||
import type {ImageResizeMode} from './ImageResizeMode';
|
||||
import type {ImageSource} from './ImageSource';
|
||||
import type {ElementRef, Node, RefSetter} from 'react';
|
||||
|
||||
@@ -235,7 +234,7 @@ export type ImageProps = $ReadOnly<{|
|
||||
*
|
||||
* See https://reactnative.dev/docs/image#resizemode
|
||||
*/
|
||||
resizeMode?: ?ImageResizeMode,
|
||||
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
|
||||
|
||||
/**
|
||||
* A unique identifier for this element to be used in UI Automation
|
||||
|
||||
@@ -12,8 +12,7 @@ export type ImageResizeMode =
|
||||
| 'contain'
|
||||
| 'stretch'
|
||||
| 'repeat'
|
||||
| 'center'
|
||||
| 'none';
|
||||
| 'center';
|
||||
|
||||
/**
|
||||
* @see ImageResizeMode.js
|
||||
@@ -47,10 +46,4 @@ export interface ImageResizeModeStatic {
|
||||
* image will keep it's size and aspect ratio.
|
||||
*/
|
||||
repeat: ImageResizeMode;
|
||||
|
||||
/**
|
||||
* none - The image will be displayed at its intrinsic size, which means the
|
||||
* image will not be scaled up or down.
|
||||
*/
|
||||
none: ImageResizeMode;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,4 @@ export type ImageResizeMode =
|
||||
|
||||
// Resize by stretching it to fill the entire frame of the view without
|
||||
// clipping. This may change the aspect ratio of the image, distorting it.
|
||||
| 'stretch'
|
||||
|
||||
// The image will not be resized at all.
|
||||
| 'none';
|
||||
| 'stretch';
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ export interface ImageURISource {
|
||||
* to a URL load request, no attempt is made to load the data from the originating source,
|
||||
* and the load is considered to have failed.
|
||||
*
|
||||
* @platform ios (for `force-cache`)
|
||||
* @platform ios
|
||||
*/
|
||||
cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined;
|
||||
/**
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ export interface ImageURISource {
|
||||
* to a URL load request, no attempt is made to load the data from the originating source,
|
||||
* and the load is considered to have failed.
|
||||
*
|
||||
* @platform ios (for `force-cache`)
|
||||
* @platform ios
|
||||
*/
|
||||
+cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached');
|
||||
|
||||
|
||||
+3
-6
@@ -8,18 +8,15 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {ImageResizeMode} from './ImageResizeMode';
|
||||
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
|
||||
|
||||
const objectFitMap: {[string]: ImageResizeMode} = {
|
||||
const objectFitMap: {[string]: ResizeMode} = {
|
||||
contain: 'contain',
|
||||
cover: 'cover',
|
||||
fill: 'stretch',
|
||||
'scale-down': 'contain',
|
||||
none: 'none',
|
||||
};
|
||||
|
||||
export function convertObjectFitToResizeMode(
|
||||
objectFit: ?string,
|
||||
): ?ImageResizeMode {
|
||||
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
|
||||
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, CGFloat destScale, RCTR
|
||||
switch (resizeMode) {
|
||||
case RCTResizeModeStretch:
|
||||
case RCTResizeModeRepeat:
|
||||
case RCTResizeModeNone:
|
||||
|
||||
return (CGRect){CGPointZero, RCTCeilSize(destSize, destScale)};
|
||||
|
||||
@@ -250,7 +249,6 @@ BOOL RCTUpscalingRequired(
|
||||
|
||||
case RCTResizeModeRepeat:
|
||||
case RCTResizeModeCenter:
|
||||
case RCTResizeModeNone:
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ typedef NS_ENUM(NSInteger, RCTResizeMode) {
|
||||
RCTResizeModeStretch = UIViewContentModeScaleToFill,
|
||||
RCTResizeModeCenter = UIViewContentModeCenter,
|
||||
RCTResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values.
|
||||
RCTResizeModeNone = UIViewContentModeTopLeft,
|
||||
};
|
||||
|
||||
static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode mode)
|
||||
@@ -31,14 +30,12 @@ static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode
|
||||
case UIViewContentModeCenter:
|
||||
return RCTResizeModeCenter;
|
||||
break;
|
||||
case UIViewContentModeTopLeft:
|
||||
return RCTResizeModeNone;
|
||||
break;
|
||||
case UIViewContentModeRedraw:
|
||||
case UIViewContentModeTop:
|
||||
case UIViewContentModeBottom:
|
||||
case UIViewContentModeLeft:
|
||||
case UIViewContentModeRight:
|
||||
case UIViewContentModeTopLeft:
|
||||
case UIViewContentModeTopRight:
|
||||
case UIViewContentModeBottomLeft:
|
||||
case UIViewContentModeBottomRight:
|
||||
|
||||
@@ -17,7 +17,6 @@ RCT_ENUM_CONVERTER(
|
||||
@"stretch" : @(RCTResizeModeStretch),
|
||||
@"center" : @(RCTResizeModeCenter),
|
||||
@"repeat" : @(RCTResizeModeRepeat),
|
||||
@"none" : @(RCTResizeModeNone),
|
||||
}),
|
||||
RCTResizeModeStretch,
|
||||
integerValue)
|
||||
|
||||
+2
-2
@@ -480,10 +480,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
this._checkProps(this.props);
|
||||
}
|
||||
|
||||
_listRef: ?VirtualizedList;
|
||||
_listRef: ?React.ElementRef<typeof VirtualizedList>;
|
||||
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
|
||||
|
||||
_captureRef = (ref: ?VirtualizedList) => {
|
||||
_captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {
|
||||
this._listRef = ref;
|
||||
};
|
||||
|
||||
|
||||
+17
-26
@@ -37,8 +37,6 @@ const COLORS = {
|
||||
'ansi-bright-white': 'rgb(247, 247, 247)',
|
||||
};
|
||||
|
||||
const LRM = '\u200E'; // Left-to-Right Mark
|
||||
|
||||
export default function Ansi({
|
||||
text,
|
||||
style,
|
||||
@@ -82,28 +80,25 @@ export default function Ansi({
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View>
|
||||
{parsedLines.map((items, i) => (
|
||||
<View style={styles.line} key={i}>
|
||||
<Text>
|
||||
{LRM}
|
||||
{items.map((bundle, key) => {
|
||||
const textStyle =
|
||||
bundle.fg && COLORS[bundle.fg]
|
||||
? {
|
||||
backgroundColor: bundle.bg && COLORS[bundle.bg],
|
||||
color: bundle.fg && COLORS[bundle.fg],
|
||||
}
|
||||
: {
|
||||
backgroundColor: bundle.bg && COLORS[bundle.bg],
|
||||
};
|
||||
return (
|
||||
<Text style={[style, textStyle]} key={key}>
|
||||
{getText(bundle.content, key)}
|
||||
</Text>
|
||||
);
|
||||
})}
|
||||
</Text>
|
||||
{items.map((bundle, key) => {
|
||||
const textStyle =
|
||||
bundle.fg && COLORS[bundle.fg]
|
||||
? {
|
||||
backgroundColor: bundle.bg && COLORS[bundle.bg],
|
||||
color: bundle.fg && COLORS[bundle.fg],
|
||||
}
|
||||
: {
|
||||
backgroundColor: bundle.bg && COLORS[bundle.bg],
|
||||
};
|
||||
return (
|
||||
<Text style={[style, textStyle]} key={key}>
|
||||
{getText(bundle.content, key)}
|
||||
</Text>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
@@ -111,10 +106,6 @@ export default function Ansi({
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
minWidth: '100%',
|
||||
direction: 'ltr',
|
||||
},
|
||||
line: {
|
||||
flexDirection: 'row',
|
||||
},
|
||||
|
||||
@@ -59,9 +59,7 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
|
||||
<LogBoxInspectorSection heading="Source" action={<AppInfo />}>
|
||||
<View style={styles.box}>
|
||||
<View style={styles.frame}>
|
||||
<ScrollView
|
||||
horizontal
|
||||
contentContainerStyle={styles.contentContainer}>
|
||||
<ScrollView horizontal>
|
||||
<AnsiHighlight style={styles.content} text={codeFrame.content} />
|
||||
</ScrollView>
|
||||
</View>
|
||||
@@ -140,9 +138,6 @@ const styles = StyleSheet.create({
|
||||
paddingTop: 10,
|
||||
paddingBottom: 10,
|
||||
},
|
||||
contentContainer: {
|
||||
minWidth: '100%',
|
||||
},
|
||||
content: {
|
||||
color: LogBoxStyle.getTextColor(1),
|
||||
fontSize: 12,
|
||||
|
||||
-10
@@ -26,11 +26,6 @@ exports[`LogBoxInspectorCodeFrame should render a code frame 1`] = `
|
||||
}
|
||||
>
|
||||
<ScrollView
|
||||
contentContainerStyle={
|
||||
Object {
|
||||
"minWidth": "100%",
|
||||
}
|
||||
}
|
||||
horizontal={true}
|
||||
>
|
||||
<Ansi
|
||||
@@ -113,11 +108,6 @@ exports[`LogBoxInspectorCodeFrame should render a code frame without a location
|
||||
}
|
||||
>
|
||||
<ScrollView
|
||||
contentContainerStyle={
|
||||
Object {
|
||||
"minWidth": "100%",
|
||||
}
|
||||
}
|
||||
horizontal={true}
|
||||
>
|
||||
<Ansi
|
||||
|
||||
@@ -434,12 +434,6 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
||||
cursor?: CursorValue | undefined;
|
||||
boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
|
||||
filter?: ReadonlyArray<FilterFunction> | string | undefined;
|
||||
|
||||
mixBlendMode?: BlendMode | undefined;
|
||||
experimental_backgroundImage?:
|
||||
| ReadonlyArray<GradientValue>
|
||||
| string
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export type FontVariant =
|
||||
@@ -568,6 +562,6 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
||||
overlayColor?: ColorValue | undefined;
|
||||
tintColor?: ColorValue | undefined;
|
||||
opacity?: AnimatableNumericValue | undefined;
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined;
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
|
||||
cursor?: CursorValue | undefined;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
'use strict';
|
||||
|
||||
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
||||
import type {ImageResizeMode} from './../Image/ImageResizeMode';
|
||||
import type {
|
||||
____DangerouslyImpreciseStyle_InternalOverrides,
|
||||
____ImageStyle_InternalOverrides,
|
||||
@@ -942,8 +941,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
|
||||
|
||||
export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
@@ -955,8 +954,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
|
||||
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____TextStyle_Internal>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
|
||||
@@ -36,7 +36,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
{
|
||||
if (![self isDescendantOfView:scrollView]) {
|
||||
// View is outside scroll view
|
||||
scrollView.firstResponderViewOutsideScrollView = self.backedTextInputView;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -683,7 +683,7 @@ 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>,
|
||||
React.ElementRef<typeof FlatList>,
|
||||
>;
|
||||
"
|
||||
`;
|
||||
@@ -4869,7 +4869,7 @@ export type ImageProps = $ReadOnly<{|
|
||||
| \\"strict-origin-when-cross-origin\\"
|
||||
| \\"unsafe-url\\"
|
||||
),
|
||||
resizeMode?: ?ImageResizeMode,
|
||||
resizeMode?: ?(\\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\"),
|
||||
testID?: ?string,
|
||||
tintColor?: ColorValue,
|
||||
src?: ?string,
|
||||
@@ -4892,8 +4892,7 @@ exports[`public API should not change unintentionally Libraries/Image/ImageResiz
|
||||
| \\"contain\\"
|
||||
| \\"cover\\"
|
||||
| \\"repeat\\"
|
||||
| \\"stretch\\"
|
||||
| \\"none\\";
|
||||
| \\"stretch\\";
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -4990,9 +4989,10 @@ export type { ImageProps } from \\"./ImageProps\\";
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Image/ImageUtils.js 1`] = `
|
||||
"declare export function convertObjectFitToResizeMode(
|
||||
"type ResizeMode = \\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\";
|
||||
declare export function convertObjectFitToResizeMode(
|
||||
objectFit: ?string
|
||||
): ?ImageResizeMode;
|
||||
): ?ResizeMode;
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -5725,7 +5725,7 @@ declare class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
setNativeProps(props: { [string]: mixed, ... }): void;
|
||||
constructor(props: Props<ItemT>): void;
|
||||
componentDidUpdate(prevProps: Props<ItemT>): void;
|
||||
_listRef: ?VirtualizedList;
|
||||
_listRef: ?React.ElementRef<typeof VirtualizedList>;
|
||||
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair>;
|
||||
_captureRef: $FlowFixMe;
|
||||
_checkProps(props: Props<ItemT>): void;
|
||||
@@ -8261,8 +8261,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
|
||||
}>;
|
||||
export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
@@ -8272,8 +8272,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
}>;
|
||||
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____TextStyle_Internal>,
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
|
||||
@@ -207,7 +207,7 @@ class RCTBridgeHostTargetDelegate : public facebook::react::jsinspector_modern::
|
||||
void onReload(const PageReloadRequest &request) override
|
||||
{
|
||||
RCTAssertMainQueue();
|
||||
RCTTriggerReloadCommandListeners(@"Reloading due to PageReloadRequest from DevTools.");
|
||||
[bridge_ reload];
|
||||
}
|
||||
|
||||
void onSetPausedInDebuggerMessage(const OverlaySetPausedInDebuggerMessageRequest &request) override
|
||||
|
||||
@@ -18,9 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTBridgeProxy : NSProxy
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
||||
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
|
||||
@@ -41,8 +41,6 @@ using namespace facebook;
|
||||
void *_runtime;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
|
||||
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
||||
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
@@ -63,10 +61,8 @@ using namespace facebook;
|
||||
_runtime = runtime;
|
||||
_launchOptions = [launchOptions copy];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue
|
||||
{
|
||||
@@ -418,10 +414,6 @@ using namespace facebook;
|
||||
RCTViewRegistry *_viewRegistry;
|
||||
NSMutableDictionary<NSNumber *, UIView *> *_legacyViewRegistry;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
|
||||
|
||||
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
||||
{
|
||||
self = [super self];
|
||||
@@ -432,8 +424,6 @@ using namespace facebook;
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
/**
|
||||
* RCTViewRegistry
|
||||
*/
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
std::shared_ptr<facebook::react::CallInvoker> _callInvoker;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initWithCallInvoker:nullptr];
|
||||
}
|
||||
|
||||
- (instancetype)initWithCallInvoker:(std::shared_ptr<facebook::react::CallInvoker>)callInvoker
|
||||
{
|
||||
if (self = [super init]) {
|
||||
|
||||
@@ -50,3 +50,15 @@ RCT_EXTERN NSString *const RCTDidInitializeModuleNotification;
|
||||
*/
|
||||
RCT_EXTERN BOOL RCTGetDispatchW3CPointerEvents(void);
|
||||
RCT_EXTERN void RCTSetDispatchW3CPointerEvents(BOOL value);
|
||||
|
||||
/*
|
||||
* Memory Pressure Unloading Level
|
||||
*/
|
||||
RCT_EXTERN int RCTGetMemoryPressureUnloadLevel(void);
|
||||
RCT_EXTERN void RCTSetMemoryPressureUnloadLevel(int value);
|
||||
|
||||
/*
|
||||
* Use native view configs in bridgeless mode
|
||||
*/
|
||||
RCT_EXTERN BOOL RCTGetUseNativeViewConfigsInBridgelessMode(void);
|
||||
RCT_EXTERN void RCTSetUseNativeViewConfigsInBridgelessMode(BOOL value);
|
||||
|
||||
@@ -38,3 +38,34 @@ void RCTSetDispatchW3CPointerEvents(BOOL value)
|
||||
{
|
||||
RCTDispatchW3CPointerEvents = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Memory Pressure Unloading Level for experimentation only.
|
||||
* Default is 15, which is TRIM_MEMORY_RUNNING_CRITICAL.
|
||||
*/
|
||||
static int RCTMemoryPressureUnloadLevel = 15;
|
||||
|
||||
int RCTGetMemoryPressureUnloadLevel(void)
|
||||
{
|
||||
return RCTMemoryPressureUnloadLevel;
|
||||
}
|
||||
|
||||
void RCTSetMemoryPressureUnloadLevel(int value)
|
||||
{
|
||||
RCTMemoryPressureUnloadLevel = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use native view configs in bridgeless mode
|
||||
*/
|
||||
static BOOL RCTUseNativeViewConfigsInBridgelessMode = NO;
|
||||
|
||||
BOOL RCTGetUseNativeViewConfigsInBridgelessMode(void)
|
||||
{
|
||||
return RCTUseNativeViewConfigsInBridgelessMode;
|
||||
}
|
||||
|
||||
void RCTSetUseNativeViewConfigsInBridgelessMode(BOOL value)
|
||||
{
|
||||
RCTUseNativeViewConfigsInBridgelessMode = value;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef id<RCTBridgeModule> (^RCTBridgeModuleProvider)(void);
|
||||
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
||||
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER;
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules;
|
||||
|
||||
- (instancetype)initWithModuleInstance:(id<RCTBridgeModule>)instance
|
||||
bridge:(RCTBridge *)bridge
|
||||
|
||||
@@ -53,21 +53,8 @@ int32_t getUniqueId()
|
||||
@synthesize instance = _instance;
|
||||
@synthesize methodQueue = _methodQueue;
|
||||
|
||||
- (void)_setUpWithBridge:(RCTBridge *)bridge
|
||||
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
||||
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules
|
||||
- (void)setUp
|
||||
{
|
||||
// start with the ivars
|
||||
{
|
||||
_bridge = bridge;
|
||||
_moduleRegistry = moduleRegistry;
|
||||
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
|
||||
_bundleManager = bundleManager;
|
||||
_callableJSModules = callableJSModules;
|
||||
}
|
||||
|
||||
_implementsBatchDidComplete = [_moduleClass instancesRespondToSelector:@selector(batchDidComplete)];
|
||||
|
||||
// If a module overrides `constantsToExport` and doesn't implement `requiresMainQueueSetup`, then we must assume
|
||||
@@ -99,17 +86,35 @@ int32_t getUniqueId()
|
||||
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules
|
||||
{
|
||||
return [self _initWithModuleClass:moduleClass
|
||||
moduleProvider:^id<RCTBridgeModule> {
|
||||
return [moduleClass new];
|
||||
}
|
||||
bridge:bridge
|
||||
moduleRegistry:moduleRegistry
|
||||
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
|
||||
bundleManager:bundleManager
|
||||
callableJSModules:callableJSModules];
|
||||
}
|
||||
|
||||
- (instancetype)_initWithModuleClass:(Class)moduleClass
|
||||
moduleProvider:(RCTBridgeModuleProvider)moduleProvider
|
||||
bridge:(RCTBridge *)bridge
|
||||
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
||||
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
|
||||
bundleManager:(RCTBundleManager *)bundleManager
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_bridge = bridge;
|
||||
_moduleClass = moduleClass;
|
||||
_moduleProvider = [^id<RCTBridgeModule> {
|
||||
return [moduleClass new];
|
||||
} copy];
|
||||
[self _setUpWithBridge:bridge
|
||||
moduleRegistry:moduleRegistry
|
||||
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
|
||||
bundleManager:bundleManager
|
||||
callableJSModules:callableJSModules];
|
||||
_moduleProvider = [moduleProvider copy];
|
||||
_moduleRegistry = moduleRegistry;
|
||||
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
|
||||
_bundleManager = bundleManager;
|
||||
_callableJSModules = callableJSModules;
|
||||
[self setUp];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -122,13 +127,14 @@ int32_t getUniqueId()
|
||||
callableJSModules:(RCTCallableJSModules *)callableJSModules
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_bridge = bridge;
|
||||
_instance = instance;
|
||||
_moduleClass = [instance class];
|
||||
[self _setUpWithBridge:bridge
|
||||
moduleRegistry:moduleRegistry
|
||||
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
|
||||
bundleManager:bundleManager
|
||||
callableJSModules:callableJSModules];
|
||||
_moduleRegistry = moduleRegistry;
|
||||
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
|
||||
_bundleManager = bundleManager;
|
||||
_callableJSModules = callableJSModules;
|
||||
[self setUp];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -239,10 +239,7 @@ NSString *RCTMD5Hash(NSString *string)
|
||||
{
|
||||
const char *str = string.UTF8String;
|
||||
unsigned char result[CC_MD5_DIGEST_LENGTH];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
CC_MD5(str, (CC_LONG)strlen(str), result);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
return [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
result[0],
|
||||
|
||||
-7
@@ -39,13 +39,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration;
|
||||
@property (nonatomic, assign) CGSize minimumSize;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
|
||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
|
||||
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
||||
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
- (void)cancelTouches;
|
||||
|
||||
+5
-2
@@ -53,8 +53,11 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
||||
|
||||
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
||||
{
|
||||
return [super initWithSurface:surface
|
||||
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
|
||||
if (self = [super initWithSurface:surface
|
||||
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]) {
|
||||
[surface start];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
|
||||
@@ -19,9 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
stack:(nullable NSArray *)stack
|
||||
exceptionId:(NSNumber *)exceptionId
|
||||
extraDataAsJSON:(nullable NSString *)extraDataAsJSON;
|
||||
|
||||
@optional
|
||||
- (NSDictionary<NSString *, id> *)decorateJSExceptionData:(NSDictionary<NSString *, id> *)exceptionData;
|
||||
@end
|
||||
|
||||
@interface RCTExceptionsManager : NSObject <RCTBridgeModule>
|
||||
@@ -37,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)reportJsException:(nullable NSString *)message
|
||||
stack:(nullable NSArray<NSDictionary *> *)stack
|
||||
exceptionId:(double)exceptionId
|
||||
isFatal:(bool)isFatal __attribute__((deprecated));
|
||||
isFatal:(bool)isFatal;
|
||||
|
||||
@property (nonatomic, weak) id<RCTExceptionsManagerDelegate> delegate;
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ RCT_EXPORT_MODULE()
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
|
||||
RCT_EXPORT_METHOD(reportSoftException
|
||||
: (NSString *)message stack
|
||||
: (NSArray<NSDictionary *> *)stack exceptionId
|
||||
@@ -92,7 +91,6 @@ RCT_EXPORT_METHOD(reportSoftException
|
||||
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
|
||||
}
|
||||
|
||||
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
|
||||
RCT_EXPORT_METHOD(reportFatalException
|
||||
: (NSString *)message stack
|
||||
: (NSArray<NSDictionary *> *)stack exceptionId
|
||||
@@ -105,24 +103,15 @@ RCT_EXPORT_METHOD(dismissRedbox) {}
|
||||
|
||||
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
|
||||
{
|
||||
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
|
||||
mutableErrorData[@"message"] = data.message();
|
||||
if (data.originalMessage()) {
|
||||
mutableErrorData[@"originalMessage"] = data.originalMessage();
|
||||
}
|
||||
if (data.name()) {
|
||||
mutableErrorData[@"name"] = data.name();
|
||||
}
|
||||
if (data.componentStack()) {
|
||||
mutableErrorData[@"componentStack"] = data.componentStack();
|
||||
}
|
||||
NSString *message = data.message();
|
||||
double exceptionId = data.id_();
|
||||
|
||||
// Reserialize data.stack() into an array of untyped dictionaries.
|
||||
// TODO: (moti) T53588496 Replace `(NSArray<NSDictionary *> *)stack` in
|
||||
// reportFatalException etc with a typed interface.
|
||||
NSMutableArray<NSDictionary<NSString *, id> *> *stackArray = [NSMutableArray<NSDictionary<NSString *, id> *> new];
|
||||
NSMutableArray<NSDictionary *> *stackArray = [NSMutableArray<NSDictionary *> new];
|
||||
for (auto frame : data.stack()) {
|
||||
NSMutableDictionary<NSString *, id> *frameDict = [NSMutableDictionary new];
|
||||
NSMutableDictionary *frameDict = [NSMutableDictionary new];
|
||||
if (frame.column().has_value()) {
|
||||
frameDict[@"column"] = @(frame.column().value());
|
||||
}
|
||||
@@ -137,28 +126,13 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
|
||||
[stackArray addObject:frameDict];
|
||||
}
|
||||
|
||||
mutableErrorData[@"stack"] = stackArray;
|
||||
mutableErrorData[@"id"] = @(data.id_());
|
||||
mutableErrorData[@"isFatal"] = @(data.isFatal());
|
||||
NSDictionary *extraData = (NSDictionary *)data.extraData();
|
||||
NSString *extraDataAsJSON = RCTJSONStringify(extraData, NULL);
|
||||
|
||||
if (data.extraData()) {
|
||||
mutableErrorData[@"extraData"] = data.extraData();
|
||||
}
|
||||
|
||||
NSDictionary<NSString *, id> *errorData = mutableErrorData;
|
||||
if ([_delegate respondsToSelector:@selector(decorateJSExceptionData:)]) {
|
||||
errorData = [_delegate decorateJSExceptionData:errorData];
|
||||
}
|
||||
|
||||
NSString *extraDataAsJSON = RCTJSONStringify(errorData[@"extraData"], NULL);
|
||||
NSString *message = errorData[@"message"];
|
||||
NSArray<NSDictionary<NSString *, id> *> *stack = errorData[@"stack"];
|
||||
double exceptionId = [errorData[@"id"] doubleValue];
|
||||
|
||||
if (errorData[@"isFatal"]) {
|
||||
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
if (data.isFatal()) {
|
||||
[self reportFatal:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
} else {
|
||||
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
[self reportSoft:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -371,8 +371,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||
// in case if some other tread resets it.
|
||||
auto reactInstance = _reactInstance;
|
||||
if (reactInstance) {
|
||||
// Memory Pressure Unloading Level 15 represents TRIM_MEMORY_RUNNING_CRITICAL.
|
||||
int unloadLevel = 15;
|
||||
int unloadLevel = RCTGetMemoryPressureUnloadLevel();
|
||||
reactInstance->handleMemoryPressure(unloadLevel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,11 +56,7 @@
|
||||
UIButton *resumeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[resumeButton setImage:[UIImage systemImageNamed:@"forward.frame.fill"] forState:UIControlStateNormal];
|
||||
resumeButton.tintColor = [UIColor colorWithRed:0.37 green:0.37 blue:0.37 alpha:1];
|
||||
|
||||
resumeButton.configurationUpdateHandler = ^(UIButton *button) {
|
||||
button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
|
||||
};
|
||||
|
||||
resumeButton.adjustsImageWhenDisabled = NO;
|
||||
resumeButton.enabled = NO;
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[resumeButton.widthAnchor constraintEqualToConstant:48],
|
||||
|
||||
+7
@@ -100,6 +100,13 @@ using namespace facebook::react;
|
||||
const auto &imageRequest = _state->getData().getImageRequest();
|
||||
auto &observerCoordinator = imageRequest.getObserverCoordinator();
|
||||
observerCoordinator.removeObserver(_imageResponseObserverProxy);
|
||||
// Cancelling image request because we are no longer observing it.
|
||||
// This is not 100% correct place to do this because we may want to
|
||||
// re-create RCTImageComponentView with the same image and if it
|
||||
// was cancelled before downloaded, download is not resumed.
|
||||
// This will only become issue if we decouple life cycle of a
|
||||
// ShadowNode from ComponentView, which is not something we do now.
|
||||
imageRequest.cancel();
|
||||
}
|
||||
|
||||
_state = state;
|
||||
|
||||
-3
@@ -38,9 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
|
||||
@property (nonatomic, assign) CGRect firstResponderFocus;
|
||||
|
||||
/** newly-activated text input outside of the scroll view */
|
||||
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
|
||||
|
||||
/*
|
||||
* Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
|
||||
* separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
|
||||
|
||||
+13
-17
@@ -182,7 +182,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
||||
UIViewAnimationCurve curve =
|
||||
(UIViewAnimationCurve)[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue];
|
||||
CGRect keyboardEndFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||
CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
|
||||
|
||||
CGPoint absoluteViewOrigin = [self convertPoint:self.bounds.origin toView:nil];
|
||||
CGFloat scrollViewLowerY = isInverted ? absoluteViewOrigin.y : absoluteViewOrigin.y + self.bounds.size.height;
|
||||
@@ -204,24 +203,21 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
||||
from:self
|
||||
forEvent:nil]) {
|
||||
if (CGRectEqualToRect(_firstResponderFocus, CGRectNull)) {
|
||||
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
|
||||
if (inputAccessoryView) {
|
||||
// Text input view is within the inputAccessoryView.
|
||||
contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
|
||||
}
|
||||
} else {
|
||||
CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
|
||||
// Text input view is outside of the scroll view.
|
||||
return;
|
||||
}
|
||||
|
||||
if (CGRectIsNull(viewIntersection)) {
|
||||
return;
|
||||
}
|
||||
CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
|
||||
|
||||
// Inner text field focused
|
||||
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
|
||||
if (focusEnd > keyboardEndFrame.origin.y) {
|
||||
// Text field active region is below visible area with keyboard - update diff to bring into view
|
||||
contentDiff = keyboardEndFrame.origin.y - focusEnd;
|
||||
}
|
||||
if (CGRectIsNull(viewIntersection)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Inner text field focused
|
||||
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
|
||||
if (focusEnd > keyboardEndFrame.origin.y) {
|
||||
// Text field active region is below visible area with keyboard - update diff to bring into view
|
||||
contentDiff = keyboardEndFrame.origin.y - focusEnd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -126,7 +126,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
{
|
||||
if (![self isDescendantOfView:scrollView.scrollView] || !_backedTextInputView.isFirstResponder) {
|
||||
// View is outside scroll view or it's not a first responder.
|
||||
scrollView.firstResponderViewOutsideScrollView = _backedTextInputView;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,9 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||
- (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
|
||||
{
|
||||
if (self = [super init]) {
|
||||
auto reactNativeConfig =
|
||||
toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
|
||||
|
||||
_delegateProxy = std::make_unique<SchedulerDelegateProxy>((__bridge void *)self);
|
||||
|
||||
if (ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS()) {
|
||||
|
||||
@@ -620,22 +620,22 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
|
||||
if (eventEmitter != nil) {
|
||||
switch (eventType) {
|
||||
case RCTPointerEventTypeStart: {
|
||||
eventEmitter->onPointerDown(std::move(pointerEvent));
|
||||
eventEmitter->onPointerDown(pointerEvent);
|
||||
break;
|
||||
}
|
||||
case RCTPointerEventTypeMove: {
|
||||
eventEmitter->onPointerMove(std::move(pointerEvent));
|
||||
eventEmitter->onPointerMove(pointerEvent);
|
||||
break;
|
||||
}
|
||||
case RCTPointerEventTypeEnd: {
|
||||
eventEmitter->onPointerUp(pointerEvent);
|
||||
if (pointerEvent.isPrimary && pointerEvent.button == 0 && IsPointerWithinInitialTree(activePointer)) {
|
||||
eventEmitter->onClick(std::move(pointerEvent));
|
||||
eventEmitter->onClick(pointerEvent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RCTPointerEventTypeCancel: {
|
||||
eventEmitter->onPointerCancel(std::move(pointerEvent));
|
||||
eventEmitter->onPointerCancel(pointerEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -761,10 +761,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
|
||||
if (eventEmitter != nil) {
|
||||
switch (recognizer.state) {
|
||||
case UIGestureRecognizerStateEnded:
|
||||
eventEmitter->onPointerLeave(std::move(event));
|
||||
eventEmitter->onPointerLeave(event);
|
||||
break;
|
||||
default:
|
||||
eventEmitter->onPointerMove(std::move(event));
|
||||
eventEmitter->onPointerMove(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#import <React/RCTSurfaceView.h>
|
||||
#import <React/RCTUtils.h>
|
||||
|
||||
#import <react/config/ReactNativeConfig.h>
|
||||
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
#import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
|
||||
#import <react/renderer/components/text/BaseTextProps.h>
|
||||
@@ -225,6 +226,8 @@ using namespace facebook::react;
|
||||
|
||||
- (RCTScheduler *)_createScheduler
|
||||
{
|
||||
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
|
||||
|
||||
auto componentRegistryFactory =
|
||||
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
|
||||
const EventDispatcher::Weak &eventDispatcher, const ContextContainer::Shared &contextContainer) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @lint-ignore-every LICENSELINT
|
||||
/*
|
||||
* Copyright (c) 2015 Daniel Kirchner
|
||||
*
|
||||
@@ -28,6 +27,10 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/// magic constants :-)
|
||||
static const uint64_t PRIME1 = 11400714785074694791ULL;
|
||||
static const uint64_t PRIME2 = 14029467366897019727ULL;
|
||||
@@ -103,18 +106,13 @@ NS_INLINE uint64_t h32bytes(const char *p, uint64_t len, const uint64_t seed)
|
||||
return h32bytes_compute(p, len, seed + PRIME1 + PRIME2, seed + PRIME2, seed, seed - PRIME1);
|
||||
}
|
||||
|
||||
/*
|
||||
Primary APIs
|
||||
*/
|
||||
|
||||
NS_INLINE uint64_t meta_xxhash64(const char *p, uint64_t len, uint64_t seed)
|
||||
{
|
||||
return finalize((len >= 32 ? h32bytes(p, len, seed) : seed + PRIME5) + len, p + (len & ~0x1FULL), len & 0x1FULL);
|
||||
}
|
||||
|
||||
NS_INLINE uint64_t FBxxHash64(const char *p, uint64_t len, uint64_t seed)
|
||||
{
|
||||
return meta_xxhash64(p, len, seed);
|
||||
return finalize((len >= 32 ? h32bytes(p, len, seed) : seed + PRIME5) + len, p + (len & ~0x1F), len & 0x1F);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
+3
-4
@@ -9,7 +9,6 @@
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import <React/RCTSurfacePresenterStub.h>
|
||||
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
|
||||
#import "RCTAssert.h"
|
||||
#import "RCTBridge+Private.h"
|
||||
@@ -1155,10 +1154,10 @@ RCT_EXPORT_METHOD(dispatchViewManagerCommand
|
||||
return;
|
||||
}
|
||||
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
void (^mountingBlock)(void) = ^{
|
||||
__typeof(self) strongSelf = weakSelf;
|
||||
typeof(self) strongSelf = weakSelf;
|
||||
|
||||
@try {
|
||||
for (RCTViewManagerUIBlock block in previousPendingUIBlocks) {
|
||||
@@ -1439,7 +1438,7 @@ NSMutableDictionary<NSString *, id> *RCTModuleConstantsForDestructuredComponent(
|
||||
// lazifyViewManagerConfig function in JS. This fuction uses NativeModules global object that is not available in the
|
||||
// New Architecture. To make native view configs work in the New Architecture we will populate these properties in
|
||||
// native.
|
||||
if (facebook::react::ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode()) {
|
||||
if (RCTGetUseNativeViewConfigsInBridgelessMode()) {
|
||||
moduleConstants[@"Commands"] = viewConfig[@"Commands"];
|
||||
moduleConstants[@"Constants"] = viewConfig[@"Constants"];
|
||||
}
|
||||
@@ -121,8 +121,8 @@ using namespace facebook::react;
|
||||
auto &props = *sharedProps;
|
||||
props.layoutConstraints = LayoutConstraints{{0, 0}, {500, 500}};
|
||||
auto &yogaStyle = props.yogaStyle;
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
@@ -136,8 +136,8 @@ using namespace facebook::react;
|
||||
yogaStyle.setPositionType(yoga::PositionType::Absolute);
|
||||
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
|
||||
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(0));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
@@ -216,8 +216,8 @@ using namespace facebook::react;
|
||||
yogaStyle.setPositionType(yoga::PositionType::Absolute);
|
||||
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
|
||||
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(30));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(50));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(50));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
@@ -260,8 +260,8 @@ using namespace facebook::react;
|
||||
yogaStyle.setPositionType(yoga::PositionType::Absolute);
|
||||
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
|
||||
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(90));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(50));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(50));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
@@ -418,8 +418,8 @@ static ParagraphShadowNode::ConcreteState::Shared stateWithShadowNode(
|
||||
auto &props = *sharedProps;
|
||||
props.layoutConstraints = LayoutConstraints{{0, 0}, {500, 500}};
|
||||
auto &yogaStyle = props.yogaStyle;
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
@@ -434,8 +434,8 @@ static ParagraphShadowNode::ConcreteState::Shared stateWithShadowNode(
|
||||
yogaStyle.setPositionType(yoga::PositionType::Absolute);
|
||||
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
|
||||
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(90));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(20));
|
||||
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
|
||||
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(20));
|
||||
return sharedProps;
|
||||
})
|
||||
.children({
|
||||
|
||||
@@ -19,7 +19,7 @@ BOOL RCTBorderInsetsAreEqual(UIEdgeInsets borderInsets)
|
||||
|
||||
BOOL RCTCornerRadiiAreEqualAndSymmetrical(RCTCornerRadii cornerRadii)
|
||||
{
|
||||
return cornerRadii.topLeftHorizontal == cornerRadii.topLeftVertical &&
|
||||
return cornerRadii.topLeftHorizontal == cornerRadii.topLeftHorizontal &&
|
||||
cornerRadii.topRightHorizontal == cornerRadii.topRightVertical &&
|
||||
cornerRadii.bottomLeftHorizontal == cornerRadii.bottomLeftVertical &&
|
||||
cornerRadii.bottomRightHorizontal == cornerRadii.bottomRightVertical &&
|
||||
|
||||
+4
-5
@@ -8,7 +8,6 @@
|
||||
#import "RCTComponentData.h"
|
||||
|
||||
#import <objc/message.h>
|
||||
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTBridgeModule.h"
|
||||
@@ -289,9 +288,9 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
|
||||
case _value: { \
|
||||
__block BOOL setDefaultValue = NO; \
|
||||
__block _type defaultValue; \
|
||||
_type (*convert)(id, SEL, id) = (__typeof(convert))objc_msgSend; \
|
||||
_type (*get)(id, SEL) = (__typeof(get))objc_msgSend; \
|
||||
void (*set)(id, SEL, _type) = (__typeof(set))objc_msgSend; \
|
||||
_type (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend; \
|
||||
_type (*get)(id, SEL) = (typeof(get))objc_msgSend; \
|
||||
void (*set)(id, SEL, _type) = (typeof(set))objc_msgSend; \
|
||||
setterBlock = ^(id target, id json) { \
|
||||
if (json) { \
|
||||
if (!setDefaultValue && target) { \
|
||||
@@ -523,7 +522,7 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
|
||||
@"baseModuleName" : superClass == [NSObject class] ? (id)kCFNull : RCTViewManagerModuleNameForClass(superClass),
|
||||
}];
|
||||
|
||||
if (facebook::react::ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode()) {
|
||||
if (RCTGetUseNativeViewConfigsInBridgelessMode()) {
|
||||
result[@"Commands"] = [self commandsForViewMangerClass:managerClass methods:methods methodCount:count];
|
||||
result[@"Constants"] = [self constantsForViewMangerClass:managerClass];
|
||||
}
|
||||
@@ -87,9 +87,6 @@ CGFloat RCTCoreGraphicsFloatFromYogaValue(YGValue value, CGFloat baseFloatValue)
|
||||
return RCTCoreGraphicsFloatFromYogaFloat(value.value) * baseFloatValue;
|
||||
case YGUnitAuto:
|
||||
case YGUnitUndefined:
|
||||
case YGUnitMaxContent:
|
||||
case YGUnitFitContent:
|
||||
case YGUnitStretch:
|
||||
return baseFloatValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
|
||||
#define RCT_SET_YGVALUE(ygvalue, setter, ...) \
|
||||
switch (ygvalue.unit) { \
|
||||
case YGUnitAuto: \
|
||||
case YGUnitMaxContent: \
|
||||
case YGUnitFitContent: \
|
||||
case YGUnitStretch: \
|
||||
case YGUnitUndefined: \
|
||||
setter(__VA_ARGS__, YGUndefined); \
|
||||
break; \
|
||||
@@ -91,35 +88,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
|
||||
case YGUnitPercent: \
|
||||
setter##Percent(__VA_ARGS__, ygvalue.value); \
|
||||
break; \
|
||||
case YGUnitMaxContent: \
|
||||
case YGUnitFitContent: \
|
||||
case YGUnitStretch: \
|
||||
break; \
|
||||
}
|
||||
|
||||
#define RCT_SET_YGVALUE_AUTO_INTRINSIC(ygvalue, setter, ...) \
|
||||
switch (ygvalue.unit) { \
|
||||
case YGUnitAuto: \
|
||||
setter##Auto(__VA_ARGS__); \
|
||||
break; \
|
||||
case YGUnitMaxContent: \
|
||||
setter##MaxContent(__VA_ARGS__); \
|
||||
break; \
|
||||
case YGUnitFitContent: \
|
||||
setter##FitContent(__VA_ARGS__); \
|
||||
break; \
|
||||
case YGUnitStretch: \
|
||||
setter##Stretch(__VA_ARGS__); \
|
||||
break; \
|
||||
case YGUnitUndefined: \
|
||||
setter(__VA_ARGS__, YGUndefined); \
|
||||
break; \
|
||||
case YGUnitPoint: \
|
||||
setter(__VA_ARGS__, ygvalue.value); \
|
||||
break; \
|
||||
case YGUnitPercent: \
|
||||
setter##Percent(__VA_ARGS__, ygvalue.value); \
|
||||
break; \
|
||||
}
|
||||
|
||||
static void RCTProcessMetaPropsPadding(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node)
|
||||
@@ -515,14 +483,14 @@ RCT_BORDER_PROPERTY(Start, START)
|
||||
RCT_BORDER_PROPERTY(End, END)
|
||||
|
||||
// Dimensions
|
||||
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
|
||||
-(void)set##setProp : (YGValue)value \
|
||||
{ \
|
||||
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSet##cssProp, _yogaNode); \
|
||||
} \
|
||||
-(YGValue)getProp \
|
||||
{ \
|
||||
return YGNodeStyleGet##cssProp(_yogaNode); \
|
||||
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
|
||||
-(void)set##setProp : (YGValue)value \
|
||||
{ \
|
||||
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSet##cssProp, _yogaNode); \
|
||||
} \
|
||||
-(YGValue)getProp \
|
||||
{ \
|
||||
return YGNodeStyleGet##cssProp(_yogaNode); \
|
||||
}
|
||||
|
||||
#define RCT_MIN_MAX_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
|
||||
@@ -666,7 +634,7 @@ RCTShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode,
|
||||
|
||||
- (void)setFlexBasis:(YGValue)value
|
||||
{
|
||||
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSetFlexBasis, _yogaNode);
|
||||
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);
|
||||
}
|
||||
|
||||
- (YGValue)flexBasis
|
||||
|
||||
@@ -50,8 +50,6 @@
|
||||
@property (nonatomic, assign) BOOL inverted;
|
||||
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
|
||||
@property (nonatomic, assign) CGRect firstResponderFocus;
|
||||
/** newly-activated text input outside of the scroll view */
|
||||
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
|
||||
|
||||
// NOTE: currently these event props are only declared so we can export the
|
||||
// event names to JS - we don't call the blocks directly because scroll events
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user