Skip to content

Commit

Permalink
Upgrade to React Native 0.73.2 (#6363)
Browse files Browse the repository at this point in the history
* Upgrading integration-test app

* Applied fixes from eslint

* Committing updates to ios files after pod install + build

* Using stock metro config with root dir as watch folder

* Upgraded rn-connection-and-error app

* Committing updates to ios files after pod install + build

* Upgraded rn-multiple-realms app

* Upgraded rn-todo-list app

* Committing updates to ios files after pod install + build

* Upgraded RealmTemplate app

* Fixed babel plugin errors

* Upgraded @realm/react deps to match root project

* Nuked package-lock.json

* Bumping the engines to latest LTS

* Removed unneeded dependency on "tsm"

* Upgrading tsx

* Attempting to mark the linux-x64 non-optional

* Upgrading NDK in build script and workflow

* No need to install npm cli @8

* Adding paths for codegen and cli too

* Bringing integration test app closer to a fresh template

* Nuking package-lock.json

* Deleted the metro-config which is no longer needed

* Migrating off @react-native-community/art
  • Loading branch information
kraenhansen authored Jan 13, 2024
1 parent 07150e0 commit d11d39a
Show file tree
Hide file tree
Showing 138 changed files with 25,128 additions and 48,232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-realm-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: ${{ matrix.variant.runner }}
env:
REALM_DISABLE_ANALYTICS: 1
NDK_VERSION: 23.1.7779620
NDK_VERSION: 25.1.8937393
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr-realm-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install npm v7
run: npm install -g npm@8
# Install the root package (--ignore-scripts to avoid downloading or building the native module)
- run: npm ci --ignore-scripts
# Bootstrap lerna sub-packages
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/prepare-templates-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Setup NPM version
run: npm install -g npm@8

- name: Update templates from example application
run: templates/scripts/sync_rn_ts_to_all_templates.sh

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install npm v8
run: npm install -g npm@8
# Install the root package (--ignore-scripts to avoid downloading or building the native module)
- name: Install root package dependencies
run: npm ci --ignore-scripts
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Setup NPM version
run: npm install -g npm@8

- name: Get NPM cache directory
id: npm-cache-dir
shell: bash
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/publish-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache-dependency-path: '**/package-lock.json'

- name: Setup NPM version
run: npm install -g npm@8

- name: Publish templates
run: templates/scripts/publish_templates.sh
env:
Expand Down
21 changes: 7 additions & 14 deletions contrib/debug-rn-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,16 @@ lines 2 and 4 should be updated
+includeBuild('../../../../node_modules/@react-native/gradle-plugin')
```

### 3. Apply our custom `metro` config
We have a custom `metro` configuration which will help find any linked dependencies in the mono-repo. First add it to the `devDependencies` in the example's `package.json`:
### 3. Add workspace root as `watchFolders` in Metro configuration

```json
devDependencies: {
...
"@realm/metro-config": "*",
...
}
```

Then replace the `metro.config.js` with the following:
Then add the path of the workspace root the `watchFolders` in the `metro.config.js`:

```js
module.exports = require("@realm/metro-config")({
projectRoot: __dirname,
});
const path = require("node:path");
const workspaceRootPath = path.resolve(__dirname, "../../..");
const config = {
watchFolders: [workspaceRootPath]
};
```


Expand Down
99 changes: 99 additions & 0 deletions examples/rn-connection-and-error/frontend/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.14.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
minitest (5.20.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.23.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods (~> 1.13)

RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.1.4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'react-native';
import React from 'react';
import App from '../app/App';

// Note: import explicitly to use the types shiped with jest.
// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';

// Note: test renderer must be required after react-native.
Expand Down
15 changes: 4 additions & 11 deletions examples/rn-connection-and-error/frontend/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

// CUSTOM CODE: This adds support for the `.env` environment variables with react-native-config
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
Expand Down Expand Up @@ -73,8 +71,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace "com.examplernconnectionanderror"
defaultConfig {
Expand Down Expand Up @@ -109,13 +107,8 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.examplernconnectionanderror

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "ExampleRnConnectionAndError"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
Loading

0 comments on commit d11d39a

Please sign in to comment.