Skip to content

Commit

Permalink
[10.20.0-alpha.1] Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Nov 25, 2021
1 parent 7a064af commit ed6cb64
Show file tree
Hide file tree
Showing 36 changed files with 31,372 additions and 18,730 deletions.
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 @@ -86,7 +88,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
27 changes: 23 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
10.20.0-alpha.0 Release notes (2021-9-1)
10.20.0-alpha.1 Release notes (2021-9-22)
=============================================================
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.

NOTE: This is an early (alpha) release with Hermes/JSI support: We expect crashes and bugs.

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

### Fixed
* 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
* Lint react-native templates and ensure they are checked by the CI.
* Small fix to Jenkins to publish Docker image for Raspberry Pi.

10.20.0-alpha.0 Release notes (2021-9-2)
=============================================================
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.

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

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

### Compatibility
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
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=realm-js
VERSION=10.20.0-alpha.0
VERSION=10.20.0-alpha.1
REALM_CORE_VERSION=11.6.1
NAPI_VERSION=4
OPENSSL_VERSION=1.1.1g
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
enableHermes: false, // clean and rebuild if changing
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/environments/react-native/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ErrorUtils.setGlobalHandler((err, isFatal) => {
});

const mode = typeof DedicatedWorkerGlobalScope === "undefined" ? "native" : "chrome-debugging";
const engine = global.HermesInternal ? "hermes" : "jsc";

export class App extends Component {
state = { status: "disconnected" };
Expand Down Expand Up @@ -153,7 +154,7 @@ export class App extends Component {

prepareTests() {
this.client = new Client({
title: `React-Native on ${Platform.OS} (${mode})`,
title: `React-Native on ${Platform.OS} (${mode} using ${engine})`,
tests: (context) => {
/* eslint-env mocha */
if (typeof context.mode === "string" && context.mode !== mode) {
Expand Down
6 changes: 6 additions & 0 deletions lib/collection-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Object.defineProperty(iteratorPrototype, Symbol.iterator, {
var method = arrayPrototype[methodName];
if (method) {
exports[methodName] = {
// XXX this is a temporary solution/hack to work around the fact that Hermes' implementation of Array does not
// like it when you call one of its methods bound to a non-array. We were calling them on our Collection types.
// This code is just copying the collection to a real array, then calling the method on that. Instead, we should
// find a way to operate on the collection directly, possibly by using our own implementation of the array methods,
// possibly copied from a polyfill lib. This is particularly bad for things like find() that may not need to look
// at the whole collection but we are copying the whole thing anyway.
value(...args) {
return [...this][methodName](...args);
},
Expand Down
51 changes: 51 additions & 0 deletions lib/react-native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2021 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

// eslint sourceType: module

import { Platform, NativeModules } from "react-native";

//switch how babel transpiled code creates children objects.
//Inheriting from Realm.Object with class syntax does not support using Reflect.construct the way babel transpiles it.
//Defining Reflect.construct.sham makes the transpiled code use different standard mechanism for inheriting. (Function.apply with setPrototypeOf)
if (typeof Reflect !== "undefined" && Reflect.construct) {
Reflect.construct.sham = 1;
}

if (Platform.OS === "android") {
// Getting the native module on Android will inject the Realm global (on Android)
const RealmNativeModule = NativeModules.Realm;
console.log({ RealmNativeModule, Realm: global.Realm });
}

// Otherwise, we must be in a "normal" react native situation.
// In that case, the Realm type should have been injected by the native code.
// If it hasn't, the user likely forgot to install the RealmJS CocoaPod
if (typeof global.Realm === "undefined") {
throw new Error(
'Missing Realm constructor. Did you run "pod install"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting',
);
}

require("./extensions")(global.Realm);

const utils = require("./utils");
const versions = utils.getVersions();
global.Realm.App._setVersions(versions);

module.exports = global.Realm;
Loading

0 comments on commit ed6cb64

Please sign in to comment.