Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ body:

Providing as much information as possible greatly helps us with reproducting the issues.

- type: dropdown
id: architecture
attributes:
label: Architecture
description: What React Native architecture your application is running on?
options:
- Paper (Old Architecture)
- Fabric (New Architecture)

- type: dropdown
id: build-type
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/build-android.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ subst W: "%GITHUB_WORKSPACE%\example" || exit /b 1
robocopy W:\node_modules\react-native-test-app W:\r /MIR /NFL /NDL /NJH /NJS /NP
if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL%
cd /D W:\android || exit /b 1
call gradlew.bat assembleDebug -PnewArchEnabled=%1
call gradlew.bat assembleDebug
6 changes: 2 additions & 4 deletions .github/scripts/build-android.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail

new_arch="${1:-false}"

if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cmd //c "$(cygpath -w "$script_dir/build-android.cmd")" "$new_arch"
cmd //c "$(cygpath -w "$script_dir/build-android.cmd")"
else
cd example/android
./gradlew assembleDebug -PnewArchEnabled="${new_arch}"
./gradlew assembleDebug
fi
4 changes: 2 additions & 2 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
run: yarn install
working-directory: example

- name: Build android example app with new arch disabled
run: ./gradlew assembleRelease -PnewArchEnabled=true
- name: Build Android example app
run: ./gradlew assembleRelease
working-directory: example/android

- name: Upload APK to Release
Expand Down
54 changes: 18 additions & 36 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,32 @@ on:
branches:
- main
paths:
- '.github/scripts/build-android.*'
- '.github/workflows/android.yml'
- 'android/**'
- 'common/**'
- 'example/android/**'
- 'example/package.json'
- 'example/react-native.config.js'
- 'example/yarn.lock'
- 'package.json'
- 'react-native.config.js'
- 'src/specs/**'
- 'yarn.lock'
pull_request:
paths:
- '.github/scripts/build-android.*'
- '.github/workflows/android.yml'
- 'android/**'
- 'common/**'
- 'example/android/**'
- 'example/package.json'
- 'example/react-native.config.js'
- 'example/yarn.lock'
- 'package.json'
- 'react-native.config.js'
- 'src/specs/**'
- 'yarn.lock'

jobs:
android-build:
Expand Down Expand Up @@ -49,39 +65,5 @@ jobs:
- name: Install example app dependencies
run: yarn install
working-directory: example
- name: Build android example app with new arch disabled
run: ./.github/scripts/build-android.sh false
android-build-fabric:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.13.0
uses: actions/setup-node@v1
with:
node-version: 22.13.0
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Restore yarn workspaces
id: yarn-cache
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
- name: Install example app dependencies
run: yarn install
working-directory: example
- name: Build android example app with new arch enabled
run: ./.github/scripts/build-android.sh true
- name: Build Android example app
run: ./.github/scripts/build-android.sh
102 changes: 102 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Compatibility build

on:
push:
branches:
- main
paths:
- '.github/workflows/compatibility.yml'
- 'android/**'
- 'babel.config.js'
- 'common/**'
- 'compatibility.json'
- 'ios/**'
- 'package.json'
- 'react-native-safe-area-context.podspec'
- 'react-native.config.js'
- 'scripts/test-project'
- 'src/**'
- 'tsconfig.json'
- 'yarn.lock'
pull_request:
paths:
- '.github/workflows/compatibility.yml'
- 'android/**'
- 'babel.config.js'
- 'common/**'
- 'compatibility.json'
- 'ios/**'
- 'package.json'
- 'react-native-safe-area-context.podspec'
- 'react-native.config.js'
- 'scripts/test-project'
- 'src/**'
- 'tsconfig.json'
- 'yarn.lock'
workflow_dispatch:

permissions:
contents: read

jobs:
read-compatibility:
runs-on: ubuntu-latest
outputs:
react-native-versions: ${{ steps.matrix.outputs.versions }}
steps:
- uses: actions/checkout@v4
- name: Read supported React Native versions
id: matrix
run: |
versions=$(node -e "
const compatibility = require('./compatibility.json');
process.stdout.write(
JSON.stringify(compatibility['6.x']['react-native'])
);
")
echo "versions=$versions" >> "$GITHUB_OUTPUT"

android:
name: Android (RN ${{ matrix.react-native }})
needs: read-compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
react-native: ${{ fromJSON(needs.read-compatibility.outputs.react-native-versions) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.13.0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- run: yarn install
- name: Build fresh Android app
run: ./scripts/test-project --version ${{ matrix.react-native }} --platforms android

ios:
name: iOS (RN ${{ matrix.react-native }})
needs: read-compatibility
runs-on: macos-15
strategy:
fail-fast: false
matrix:
react-native: ${{ fromJSON(needs.read-compatibility.outputs.react-native-versions) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.13.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Select Xcode 16.4
run: |
sudo xcode-select --switch /Applications/Xcode_16.4.app
xcodebuild -version
- run: yarn install
- name: Build fresh iOS app
run: ./scripts/test-project --version ${{ matrix.react-native }} --platforms ios
49 changes: 22 additions & 27 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,31 @@ on:
- main
paths:
- '.github/workflows/ios.yml'
- 'ios/**'
- 'common/**'
- 'example/ios/**'
- 'example/package.json'
- 'example/react-native.config.js'
- 'example/yarn.lock'
- 'ios/**'
- 'package.json'
- 'react-native-safe-area-context.podspec'
- 'react-native.config.js'
- 'src/specs/**'
- 'yarn.lock'
pull_request:
paths:
- '.github/workflows/ios.yml'
- 'ios/**'
- 'common/**'
- 'example/ios/**'
- 'example/package.json'
- 'example/react-native.config.js'
- 'example/yarn.lock'
- 'ios/**'
- 'package.json'
- 'react-native-safe-area-context.podspec'
- 'react-native.config.js'
- 'src/specs/**'
- 'yarn.lock'
jobs:
ios-build:
runs-on: macos-latest
Expand All @@ -34,32 +50,11 @@ jobs:
- name: Install example app dependencies
run: yarn install
working-directory: example
- name: Install pods
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
working-directory: example/ios
- name: Build ios example app
run: xcodebuild -scheme ReactTestApp -workspace RNSACExample.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
working-directory: example/ios
ios-build-fabric:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.13.0
uses: actions/setup-node@v1
with:
node-version: 22.13.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
working-directory: example
bundler-cache: true
- name: Install dependencies
run: yarn install
- name: Install example app dependencies
run: yarn install
- name: Validate podspec
run: bundle exec pod lib lint ../react-native-safe-area-context.podspec --quick --allow-warnings --no-ansi
working-directory: example
- name: Install pods for new arch
run: RCT_NEW_ARCH_ENABLED=1 npx pod-install
- name: Install pods
run: npx pod-install
working-directory: example/ios
- name: Build ios example app
run: xcodebuild -scheme ReactTestApp -workspace RNSACExample.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
- name: Install example app dependencies
run: yarn install
working-directory: example
- name: Run tests
run: yarn test
- name: Typecheck example app
run: yarn typecheck
working-directory: example
2 changes: 2 additions & 0 deletions .prettierrc → .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
Expand Down
Loading
Loading