Skip to content

Commit

Permalink
🐳 chore: Upgrade Node.js to v22.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Dec 6, 2024
1 parent 0672a1c commit a07765f
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_node_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_VERSION: 4.1.1
ROOT: /home/runner/work/Javet

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1
ROOT: /home/runner/work/Javet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_arm64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1
ROOT: /Users/runner/work/Javet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1
ROOT: /Users/runner/work/Javet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.11.0
JAVET_NODE_VERSION: 22.12.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.1
ROOT: D:\a\Javet
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ arm ✔️ ❌ ❌ ❌
arm64 ✔️ ✔️ ✔️ ❌
=========== ======= ======= ======= =======

* Node.js ``v22.11.0`` + V8 ``v13.1.201.8``
* Node.js ``v22.12.0`` + V8 ``v13.1.201.8``
* i18n and non-i18n
* Dynamic switch between Node.js and V8 mode
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-x86_64/base_all_in_one.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
FROM ubuntu:20.04
WORKDIR /

ARG JAVET_NODE_VERSION=22.11.0
ARG JAVET_NODE_VERSION=22.12.0
ARG JAVET_V8_VERSION=13.1.201.8

# Update Ubuntu
Expand Down
6 changes: 3 additions & 3 deletions docker/linux-x86_64/base_node.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
# limitations under the License.

# Usage: docker build \
# -t sjtucaocao/javet:x86_64-base-node_22.11.0 \
# -t sjtucaocao/javet:x86_64-base-node_22.12.0 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
# --build-arg JAVET_NODE_VERSION=22.11.0 \
# --build-arg JAVET_NODE_VERSION=22.12.0 \
# -f docker/linux-x86_64/base_node.Dockerfile .

ARG JAVET_REPO=sjtucaocao/javet
ARG JAVET_NODE_VERSION=22.11.0
ARG JAVET_NODE_VERSION=22.12.0

FROM ${JAVET_REPO}:x86_64-base-jvm

Expand Down
2 changes: 1 addition & 1 deletion docker/linux-x86_64/build.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JAVET_REPO=sjtucaocao/javet
JAVET_VERSION=4.1.1
JAVET_V8_VERSION=13.1.201.8
JAVET_NODE_VERSION=22.11.0
JAVET_NODE_VERSION=22.12.0
2 changes: 1 addition & 1 deletion docker/windows-x86_64/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# Usage: docker build -t sjtucaocao/javet-windows:4.1.1 -m 4G -f docker/windows-x86_64/base.Dockerfile .

ARG JAVET_NODE_VERSION=22.11.0
ARG JAVET_NODE_VERSION=22.12.0
ARG JAVET_V8_VERSION=13.1.201.8

# https://hub.docker.com/_/microsoft-windows
Expand Down
6 changes: 5 additions & 1 deletion docs/release_notes/release_notes_4_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ Release Notes 4.0.x - 4.1.x
4.1.1
-----

* Upgraded Visual Studio 2022 to `v17.12.0 <https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.12>`_
* Upgraded Node.js to ``v22.12.0`` `(2024-12-03) <https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.12.0>`_
* Upgraded Visual Studio 2022 to `v17.12.3 <https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.12>`_
* Added ``getAbsoluteResourceName()`` to ``IV8ModuleResolver``
* Fixed memory leaks in function callback in edge cases
* `require(esm)` is enabled by default
* Removed `isExperimentalRequireModule()`, `setExperimentalRequireModule` from `NodeFlags`
* Added `isNoExperimentalRequireModule()`, `setNoExperimentalRequireModule` to `NodeFlags`

4.1.0
-----
Expand Down
2 changes: 1 addition & 1 deletion scripts/python/change_node_v8_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def update(self) -> None:
re.compile(r'"(?P<version>\d+\.\d+\.\d+\.\d+)",'))

def main():
change_node_version = ChangeNodeVersion('22.11.0')
change_node_version = ChangeNodeVersion('22.12.0')
change_node_version.update()
change_v8_version = ChangeV8Version('13.1.201.8')
change_v8_version.update()
Expand Down
62 changes: 31 additions & 31 deletions src/main/java/com/caoccao/javet/interop/options/NodeFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public final class NodeFlags {
*/
public static final String EXPERIMENTAL_PERMISSION = "--experimental-permission";
/**
* The constant EXPERIMENTAL_REQUIRE_MODULE.
* The constant NO_EXPERIMENTAL_REQUIRE_MODULE.
*
* @since 4.0.0
* @since 4.1.1
*/
public static final String EXPERIMENTAL_REQUIRE_MODULE = "--experimental-require-module";
public static final String NO_EXPERIMENTAL_REQUIRE_MODULE = "--no-experimental-require-module";
/**
* The constant EXPERIMENTAL_SQLITE.
*
Expand Down Expand Up @@ -85,10 +85,10 @@ public final class NodeFlags {
private String[] allowFsWrite;
private String[] customFlags;
private boolean experimentalPermission;
private boolean experimentalRequireModule;
private boolean experimentalSqlite;
private String icuDataDir;
private boolean jsFloat16Array;
private boolean noExperimentalRequireModule;
private boolean noWarnings;
private boolean sealed;

Expand All @@ -102,7 +102,7 @@ public final class NodeFlags {
allowFsWrite = null;
customFlags = null;
experimentalPermission = false;
experimentalRequireModule = false;
noExperimentalRequireModule = false;
experimentalSqlite = false;
jsFloat16Array = false;
noWarnings = false;
Expand Down Expand Up @@ -176,16 +176,6 @@ public boolean isExperimentalPermission() {
return experimentalPermission;
}

/**
* Supports loading a synchronous ES module graph in require().
*
* @return true : yes, false: no
* @since 4.0.0
*/
public boolean isExperimentalRequireModule() {
return experimentalRequireModule;
}

/**
* Is the experimental node:sqlite module enabled.
*
Expand All @@ -206,6 +196,16 @@ public boolean isJsFloat16Array() {
return jsFloat16Array;
}

/**
* Does not support loading a synchronous ES module graph in require().
*
* @return true : yes, false: no
* @since 4.1.1
*/
public boolean isNoExperimentalRequireModule() {
return noExperimentalRequireModule;
}

/**
* Silence all process warnings (including deprecations).
*
Expand Down Expand Up @@ -315,20 +315,6 @@ public NodeFlags setExperimentalPermission(boolean experimentalPermission) {
return this;
}

/**
* Sets experimental require module.
*
* @param experimentalRequireModule the experimental require module
* @return the self
* @since 4.0.0
*/
public NodeFlags setExperimentalRequireModule(boolean experimentalRequireModule) {
if (!sealed) {
this.experimentalRequireModule = experimentalRequireModule;
}
return this;
}

/**
* Sets experimental sqlite.
*
Expand Down Expand Up @@ -371,6 +357,20 @@ public NodeFlags setJsFloat16Array(boolean jsFloat16Array) {
return this;
}

/**
* Sets no experimental require module.
*
* @param noExperimentalRequireModule the no experimental require module
* @return the self
* @since 4.1.1
*/
public NodeFlags setNoExperimentalRequireModule(boolean noExperimentalRequireModule) {
if (!sealed) {
this.noExperimentalRequireModule = noExperimentalRequireModule;
}
return this;
}

/**
* Sets no warnings.
*
Expand Down Expand Up @@ -407,8 +407,8 @@ public String[] toArray() {
if (experimentalPermission) {
tokens.add(EXPERIMENTAL_PERMISSION);
}
if (experimentalRequireModule) {
tokens.add(EXPERIMENTAL_REQUIRE_MODULE);
if (noExperimentalRequireModule) {
tokens.add(NO_EXPERIMENTAL_REQUIRE_MODULE);
}
if (experimentalSqlite) {
tokens.add(EXPERIMENTAL_SQLITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void testModuleProcess() throws JavetException {
Path path4 = nodeModuleProcess.getWorkingDirectory().toPath();
assertNotEquals(path1.toAbsolutePath().toString(), path3.toAbsolutePath().toString());
assertEquals(path1.toAbsolutePath().toString(), path4.toAbsolutePath().toString());
assertEquals("v22.11.0", nodeModuleProcess.getVersion());
assertEquals("v22.12.0", nodeModuleProcess.getVersion());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

public class TestNodeFlags {
protected static final List<GetterAndSetter> SWITCHES = SimpleList.of(
new GetterAndSetter(NodeFlags::isExperimentalRequireModule, NodeFlags::setExperimentalRequireModule),
new GetterAndSetter(NodeFlags::isExperimentalSqlite, NodeFlags::setExperimentalSqlite),
new GetterAndSetter(NodeFlags::isJsFloat16Array, NodeFlags::setJsFloat16Array),
new GetterAndSetter(NodeFlags::isNoExperimentalRequireModule, NodeFlags::setNoExperimentalRequireModule),
new GetterAndSetter(NodeFlags::isNoWarnings, NodeFlags::setNoWarnings)
);

Expand Down Expand Up @@ -81,9 +81,9 @@ public void testToString() {
assertEquals("--no-warnings", nodeFlags.setNoWarnings(true).toString());
nodeFlags.setNoWarnings(false);
assertEquals(
"--experimental-require-module",
nodeFlags.setExperimentalRequireModule(true).toString());
nodeFlags.setExperimentalRequireModule(false);
"--no-experimental-require-module",
nodeFlags.setNoExperimentalRequireModule(true).toString());
nodeFlags.setNoExperimentalRequireModule(false);
assertEquals("--icu-data-dir=abc", nodeFlags.setIcuDataDir("abc").toString());
nodeFlags.setIcuDataDir(null);
assertEquals(
Expand Down

0 comments on commit a07765f

Please sign in to comment.