Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the Hermes JS engine through JSI #4536

Merged
merged 13 commits into from
Apr 28, 2022
Merged
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
50 changes: 20 additions & 30 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
push:
branches:
- master
- hermes

jobs:
node:
Expand Down Expand Up @@ -147,7 +148,7 @@ jobs:
MOCHA_REMOTE_CONTEXT: missingServer
MOCHA_REMOTE_REPORTER: mocha-github-actions-reporter
react-native-ios:
name: React Native on ${{matrix.platform.name}} (${{ matrix.type }})
name: React Native on ${{matrix.platform.name}} (${{ matrix.type }} using ${{ matrix.platform.engine }})
runs-on: macos-latest
timeout-minutes: 60
strategy:
Expand All @@ -158,12 +159,18 @@ jobs:
type: [Release]
platform:
- name: ios
engine: hermes
build-configuration: simulator
- name: ios
engine: jsc
build-configuration: simulator
- name: catalyst
engine: jsc
build-configuration: catalyst
env:
# Pin the Xcode version
DEVELOPER_DIR: /Applications/Xcode_12.5.1.app
HERMES_ENABLED: ${{ matrix.platform.engine == 'hermes' && 'true' || 'false' }}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -191,7 +198,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.platform.name }}-${{ matrix.type }}
key: ${{ github.job }}-${{ matrix.platform.engine }}-${{ matrix.platform.name }}-${{ matrix.type }}
- name: Prepend ccache executables to the PATH
run: echo PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV

Expand All @@ -215,25 +222,21 @@ jobs:
MOCHA_REMOTE_EXIT_ON_ERROR: true
RETRIES: 5
RETRY_DELAY: 300000 # 5 min
- name: Run tests (${{matrix.platform.name}} / Chrome Debugging)
if: ${{ false }}
run: npm run test:${{matrix.platform.name}}:chrome --prefix integration-tests/environments/react-native
env:
MOCHA_REMOTE_CONTEXT: missingServer
MOCHA_REMOTE_REPORTER: mocha-github-actions-reporter
MOCHA_REMOTE_EXIT_ON_ERROR: true
HEADLESS_DEBUGGER: true
RETRIES: 5
RETRY_DELAY: 300000 # 5 min
react-native-android:
name: React Native on Android (${{ matrix.type }})
name: React Native on Android (${{ matrix.type }} using ${{ matrix.engine }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
#TODO: Reactivate debug when builds are optimized
#type: [Release, Debug]
type: [Release]
type:
- Release
# TODO: Reactivate debug when builds are optimized
# - Debug
engine:
- hermes
- jsc
env:
HERMES_ENABLED: ${{ matrix.engine == 'hermes' && 'true' || 'false' }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -268,7 +271,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ github.job }}-${{ matrix.type }}
key: ${{ github.job }}-${{ matrix.engine }}-${{ matrix.type }}
- name: Prepend ccache executables to the PATH
run: echo PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV

Expand Down Expand Up @@ -296,16 +299,3 @@ jobs:
MOCHA_REMOTE_REPORTER: mocha-github-actions-reporter
MOCHA_REMOTE_EXIT_ON_ERROR: true
SPAWN_LOGCAT: true
- name: Run tests (Android / Chrome Debugging)
if: ${{ false }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
target: google_apis
script: npm run test:android:chrome --prefix integration-tests/environments/react-native
env:
MOCHA_REMOTE_CONTEXT: missingServer
MOCHA_REMOTE_REPORTER: mocha-github-actions-reporter
MOCHA_REMOTE_EXIT_ON_ERROR: true
HEADLESS_DEBUGGER: true
SPAWN_LOGCAT: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ yarn.lock
# Android/IJ
/android
/react-native/android/src/main/jni/core
/react-native/android/.cxx/
/build-android/
.idea
.gradle
local.properties
Expand Down Expand Up @@ -87,7 +89,6 @@ integration-tests/**/.lock
/react-native/android/src/main/jni/src/
/build-tmp*/
/cmakebuild/
/build-realm-android/
/react-native/android/src/main/java/io/realm/react/Version.java
/react-native/android/src/main/jniLibs/
/realm*.tgz
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "vendor/GCDWebServer"]
path = vendor/GCDWebServer
url = https://github.com/swisspol/GCDWebServer.git
[submodule "docs/jsdoc-template"]
path = docs/jsdoc-template
url = https://github.com/realm/realm-jsdoc.git
Expand Down
3 changes: 1 addition & 2 deletions .watchmanconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"react-native/node_modules",
"packages/realm-app-importer",
"packages/realm-web",
"packages/realm-web-integration-tests",
"tests"
"packages/realm-web-integration-tests"
]
}
121 changes: 116 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
x.x.x Release notes (yyyy-MM-dd)
=============================================================
### Breaking change
* Removed all code related to the legacy Chrome Debugger. Please use [Flipper](https://fbflipper.com/) as debugger.

### Enhancements
* Adding support for Hermes on iOS & Android.

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None.

### Compatibility
* MongoDB Realm Cloud.
* Realm Studio v11.0.0.
* APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
* File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

### Internal
* Remove the previous implementation to the JavaScriptCore engine (in `src/jsc`).
* <Either mention core version or upgrade>
* <Using Realm Core vX.Y.Z>
* <Upgraded Realm Core from vX.Y.Z to vA.B.C>

10.20.0-beta.5 Release notes (2022-4-13)
=============================================================
### Notes
Based on Realm JS v10.16.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.15.0).

10.16.0 Release notes (2022-4-12)
=============================================================

### Breaking change
* Model classes passed as schema to the `Realm` constructor must now extend `Realm.Object` and will no longer have their constructors called when pulling an object of that type from the database. Existing classes already extending `Realm.Object` now need to call the `super` constructor passing two arguments:
Expand Down Expand Up @@ -28,11 +57,6 @@ realm.write(() => {
});
```

10.16.0 Release notes (2022-4-12)
=============================================================
### Enhancements
* None.

### Fixed
* Fixed various corruption bugs in Realm Core when encryption is used. ([#5360](https://github.com/realm/realm-core/issues/5360), since v11.8.0)

Expand All @@ -45,6 +69,15 @@ realm.write(() => {
### Internal
* Upgraded Realm Core from v11.13.0 to v11.14.0.

10.20.0-beta.4 Release notes (2022-4-11)
=============================================================
### Notes
Based on Realm JS v10.15.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.14.0).

### Fixed
* Changed "react-native" main field to point to a `lib/index.native.js` file to help bundlers pick the right file when loading our library on React Native. ([#4459](https://github.com/realm/realm-js/issues/4459))
* Fixed resolving the "react-native" package when building from source, enabling developers to run the `./scripts/build-ios.sh` script themselves to build our iOS artifacts with the same version of Xcode / LLVM as they're building their app.

10.15.0 Release notes (2022-4-11)
=============================================================
### Enhancements
Expand All @@ -65,6 +98,11 @@ realm.write(() => {
* Update token in integration test.
* Upgraded Realm Core from v11.12.0 to v11.13.0.

10.20.0-beta.3 Release notes (2022-3-24)
=============================================================
### Notes
Based on Realm JS v10.14.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.13.0).

10.14.0 Release notes (2022-3-24)
=============================================================
### Enhancements
Expand Down Expand Up @@ -97,6 +135,11 @@ realm.write(() => {
* Fixed React Native Android integration test harness to read only one pid when starting logcat.
* Added a script to generate JS template apps from TS, and updated JS templates. ([4374](https://github.com/realm/realm-js/pull/4374))

10.20.0-beta.2 Release notes (2022-2-14)
=============================================================
### Notes
Based on Realm JS v10.13.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.12.0).

10.13.0 Release notes (2022-2-11)
=============================================================
### Enhancements
Expand All @@ -122,6 +165,23 @@ realm.write(() => {
* Fixed an issue where some references were not updated from `Subscriptions` to `SubscriptionSet`. ([#4298](https://github.com/realm/realm-js/pull/4298))
* Submitting [analytics](https://github.com/realm/realm-js/blob/master/README.md#analytics) as a postinstall script.

10.20.0-beta.1 Release notes (2022-1-27)
=============================================================
### Notes
Based on Realm JS v10.12.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.11.0).

### Breaking change
* Removed all code related to the legacy Chrome Debugger. Please use [Flipper](https://fbflipper.com/) as debugger.

### Enhancements
* None.

### Fixed
* Fixed "JSCRuntime destroyed with a dangling API object" assertion when reloading an app in debug mode while running with Hermes engine disabled. ([#4115](https://github.com/realm/realm-js/issues/4115), since 10.20.0-alpha.0)

### Internal
* Remove the previous implementation to the JavaScriptCore engine (in `src/jsc`).

10.12.0 Release notes (2022-1-24)
=============================================================
### Notes
Expand Down Expand Up @@ -161,6 +221,18 @@ Please note the following API changes from the `10.12.0-beta.1` release of Flexi
* Enabled `strictNullChecks` for integration tests
* Updated release instructions

10.20.0-beta.0 Release notes (2021-12-21)
=============================================================
### Notes
Based on Realm JS v10.11.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.10.1).

### Enhancements
* Catching missing libjsi.so when loading the librealm.so and rethrowing a more meaningful error, instructing users to upgrade their version of React Native.

### Fixed
* Fixed support of user defined classes that don't extend `Realm.Object`.
* Fixed throwing "Illegal constructor" when `new` constructing anything other than `Realm` and `Realm.Object`.

10.11.0 Release notes (2021-12-21)
=============================================================
### Enhancements
Expand Down Expand Up @@ -212,6 +284,23 @@ const config = {
* Added a performance test suite to the integration test.
* Upgraded Realm Core from v11.6.1 to v11.7.0.

10.20.0-alpha.2 Release notes (2021-11-25)
=============================================================
### Notes
NOTE: DO NOT USE THIS RELEASE IN PRODUCTION!
NOTE: This is an early (alpha) release with Hermes/JSI support: We expect crashes and bugs.

Based on Realm JS v10.10.1: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.8.0).

### Enhancements
* None.

### Fixed
* Hot reloading on Android no longer crash the app.

### Internal
* Restructured C++ namespaces and files to reflect that we support JSI, not just Hermes.

10.10.1 Release notes (2021-11-18)
=============================================================
### Enhancements
Expand Down Expand Up @@ -324,6 +413,17 @@ const config = {
* Using Realm Core v11.4.1.
* Small fix to Jenkins to publish Docker image for Raspberry Pi.

10.20.0-alpha.1 Release notes (2021-9-1)
=============================================================
### Notes
NOTE: DO NOT USE THIS RELEASE IN PRODUCTION!
NOTE: This is an early (alpha) release with Hermes/JSI support. Only iOS is supported and we expect crashes and bugs.

Based on Realm JS v10.8.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.7.0).

### Enhancements
* Adding support for Hermes on Android.

10.8.0 Release notes (2021-9-14)
=============================================================
### Enhancements
Expand All @@ -349,6 +449,17 @@ const config = {
* Extend Jest test runner to cover opening and closing of a Realm.
* Disable analytics if the `CI` environment variable is set to some value.

10.20.0-alpha.0 Release notes (2021-9-1)
=============================================================
### Notes
NOTE: DO NOT USE THIS RELEASE IN PRODUCTION!
NOTE: This is an early (alpha) release with Hermes/JSI support. Only iOS is supported and we expect crashes and bugs.

Based on Realm JS v10.7.0: See changelog below for details on enhancements and fixes introduced by that version.

### Enhancements
- Adding support for Hermes (iOS only).

10.7.0 Release notes (2021-8-30)
=============================================================
### Enhancements
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(PACKAGE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED CMAKE_JS_VERSION)
include(NodeJSTargets)
endif()
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ ENV LD_LIBRARY_PATH /opt/rh/httpd24/root/usr/lib64:/opt/rh/python27/root/usr/lib

# Ensure a new enough version of CMake is available.
RUN cd /opt \
&& curl -O -J https://cmake.org/files/v3.15/cmake-3.15.2-Linux-x86_64.tar.gz \
&& tar zxf cmake-3.15.2-Linux-x86_64.tar.gz
ENV PATH "/opt/cmake-3.15.2-Linux-x86_64/bin:$PATH"
&& curl -O -J https://cmake.org/files/v3.21/cmake-3.21.3-linux-x86_64.tar.gz \
&& tar zxf cmake-3.21.3-linux-x86_64.tar.gz
ENV PATH "/opt/cmake-3.21.3-linux-x86_64/bin/:$PATH"
12 changes: 6 additions & 6 deletions Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN echo 'Installing Android SDK' && \
"platform-tools" \
"build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
"platforms;android-26" \
"cmake;3.10.2.4988404"\
"cmake;3.18.1"\
"system-images;android-29;default;x86" && \
\
echo 'Installing Android NDK' && \
Expand All @@ -75,8 +75,8 @@ RUN mkdir -p $NVM_DIR \
&& chmod a+rwX -R $NVM_DIR

# Ensure a new enough version of CMake is available.
RUN mkdir -p /home/jenkins/cmake && \
cd /home/jenkins/cmake && \
curl -O -J https://cmake.org/files/v3.17/cmake-3.17.5-Linux-x86_64.tar.gz &&\
tar zxf cmake-3.17.5-Linux-x86_64.tar.gz
ENV PATH "/home/jenkins/cmake/cmake-3.17.5-Linux-x86_64/bin:$PATH"
RUN mkdir -p /home/jenkins/cmake \
&& cd /home/jenkins/cmake \
&& curl -O -J https://cmake.org/files/v3.21/cmake-3.21.3-linux-x86_64.tar.gz \
&& tar zxf cmake-3.21.3-linux-x86_64.tar.gz
ENV PATH "/home/jenkins/cmake/cmake-3.21.3-linux-x86_64/bin/:$PATH"
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def buildWindows(nodeVersion, arch) {

def buildiOS() {
return buildMacOS {
sh 'npm ci'
sh './scripts/build-iOS.sh -c Release'
dir('react-native/ios') {
// Uncomment this when testing build changes if you want to be able to download pre-built artifacts from Jenkins.
Expand Down
Loading