diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a5dbeb983..ac7ca52476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ x.x.x Release notes (yyyy-MM-dd) * * * +* Removed support for node.js v12 and earlier versions and bumped to Node-API v5. * Fix FLX error scenario tests. * Fixed a bug preventing opening a synced Realm as a local Realm. (since v10.18.0) @@ -54,10 +55,6 @@ const Person = { * Upgraded Realm Core from v12.0.0 to v12.1.0. * Fix for updated FLX sync error message. ([#4611](https://github.com/realm/realm-js/pull/4611)) * Updated build script to use Xcode 13.1 to match latest Apple App Store compatibility. ([#4605](https://github.com/realm/realm-js/issues/4605)) -* Updated the CMake config to read Node arch from `NODE_ARCH` injected by cmake-js instead of injecting our own environment variable. -* -* -* 10.18.0 Release notes (2022-5-29) ============================================================= diff --git a/dependencies.list b/dependencies.list index 155c27a04b..c5e8da9584 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,6 +1,6 @@ PACKAGE_NAME=realm-js VERSION=10.19.0 REALM_CORE_VERSION=12.1.0 -NAPI_VERSION=4 +NAPI_VERSION=5 OPENSSL_VERSION=1.1.1g MDBREALM_TEST_SERVER_TAG=2022-05-23 diff --git a/package-lock.json b/package-lock.json index 868d7874b7..2f4ff30a28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,7 @@ "typescript": "^4.5.2" }, "engines": { - "node": ">=10", + "node": ">=14", "npm": ">=7" }, "peerDependencies": { @@ -16105,8 +16105,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "requires": {} + "dev": true }, "@octokit/plugin-rest-endpoint-methods": { "version": "5.4.1", @@ -16660,8 +16659,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "8.2.0", @@ -18461,8 +18459,7 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-eslint-comments": { "version": "3.2.0", @@ -18496,8 +18493,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-jasmine": { "version": "4.1.2", @@ -18509,8 +18505,7 @@ "version": "22.4.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz", "integrity": "sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-jsdoc": { "version": "35.4.1", @@ -18609,8 +18604,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz", "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-react-native": { "version": "3.11.0", @@ -21135,8 +21129,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", - "dev": true, - "requires": {} + "dev": true }, "marked": { "version": "0.7.0", diff --git a/package.json b/package.json index 31a2e7a512..7548600d5b 100644 --- a/package.json +++ b/package.json @@ -145,20 +145,20 @@ "typescript": "^4.5.2" }, "engines": { - "node": ">=10", + "node": ">=13", "npm": ">=7" }, "config": { "runtime": "napi", - "target": 4 + "target": 5 }, "binary": { "module_name": "realm", "host": "https://static.realm.io", - "package_name": "realm-v{version}-napi-v4-{platform}-{arch}.tar.gz", + "package_name": "realm-v{version}-napi-v5-{platform}-{arch}.tar.gz", "remote_path": "realm-js-prebuilds/{version}", "napi_versions": [ - 4 + 5 ] } } \ No newline at end of file diff --git a/src/node/node_value.hpp b/src/node/node_value.hpp index ee0521ef4d..248b885c8d 100644 --- a/src/node/node_value.hpp +++ b/src/node/node_value.hpp @@ -74,20 +74,10 @@ inline bool node::Value::is_date(Napi::Env env, const Napi::Value& value) return false; } -// if rebuilding the binary on Node.js with NAPI 4. On CI we should always be building with Node.js NAPI 5 -#if NAPI_VERSION >= 5 - uint32_t version; - napi_status status = napi_get_version(env, &version); + bool is_date; + napi_status status = napi_is_date(env, value, &is_date); NAPI_THROW_IF_FAILED(env, status, false); - if (version >= 5) { - bool isDate; - status = napi_is_date(env, value, &isDate); - NAPI_THROW_IF_FAILED(env, status, false); - return isDate; - } -#endif - - return value.IsObject() && value.As().InstanceOf(env.Global().Get("Date").As()); + return is_date; } template <>