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

Remove support for node.js v12 and earlier. #4614

Merged
merged 4 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ x.x.x Release notes (yyyy-MM-dd)
* 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))
* Removed support for node.js v12 and earlier versions and bumped to Node-API v5.

10.18.0 Release notes (2022-5-29)
=============================================================
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PACKAGE_NAME=realm-js
VERSION=10.18.0
REALM_CORE_VERSION=12.0.0
NAPI_VERSION=4
NAPI_VERSION=5
OPENSSL_VERSION=1.1.1g
MDBREALM_TEST_SERVER_TAG=2022-05-23
23 changes: 8 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,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
]
}
}
16 changes: 3 additions & 13 deletions src/node/node_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Napi::Object>().InstanceOf(env.Global().Get("Date").As<Napi::Function>());
return is_date;
}

template <>
Expand Down