Wed Sep 6 19:28:21 2023 UTC ()
nodejs: updated to 20.6.0

Version 20.6.0 (Current)

Notable changes

built-in .env file support

Starting from Node.js v20.6.0, Node.js supports .env files for configuring environment variables.

Your configuration file should follow the INI file format, with each line containing a key-value pair for an environment variable. To initialize your Node.js application with predefined configurations, use the following CLI command: node --env-file=config.env index.js.

For example, you can access the following environment variable using process.env.PASSWORD when your application is initialized:

PASSWORD=nodejs
In addition to environment variables, this change allows you to define your NODE_OPTIONS directly in the .env file, eliminating the need to include it in your package.json.

import.meta.resolve unflagged

In ES modules, import.meta.resolve(specifier) can be used to get an absolute URL string to which specifier resolves, similar to require.resolve in CommonJS. This aligns Node.js with browsers and other server-side runtimes.

New node:module API register for module customization hooks; new initialize hook

There is a new API register available on node:module to specify a file that exports module customization hooks, and pass data to the hooks, and establish communication channels with them. The ���define the file with the hooks��� part was previously handled by a flag --experimental-loader, but when the hooks moved into a dedicated thread in 20.0.0 there was a need to provide a way to communicate between the main (application) thread and the hooks thread. This can now be done by calling register from the main thread and passing data, including MessageChannel instances.

We encourage users to migrate to an approach that uses --import with register, such as:

node --import ./file-that-calls-register.js ./app.js
Using --import ensures that the customization hooks are registered before any application code runs, even the entry point.

Module customization load hook can now support CommonJS


(adam)
diff -r1.270 -r1.271 pkgsrc/lang/nodejs/Makefile
diff -r1.75 -r1.76 pkgsrc/lang/nodejs/PLIST
diff -r1.242 -r1.243 pkgsrc/lang/nodejs/distinfo

cvs diff -r1.270 -r1.271 pkgsrc/lang/nodejs/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/nodejs/Makefile 2023/08/14 05:24:45 1.270
+++ pkgsrc/lang/nodejs/Makefile 2023/09/06 19:28:20 1.271
@@ -1,25 +1,24 @@ @@ -1,25 +1,24 @@
1# $NetBSD: Makefile,v 1.270 2023/08/14 05:24:45 wiz Exp $ 1# $NetBSD: Makefile,v 1.271 2023/09/06 19:28:20 adam Exp $
2 2
3DISTNAME= node-v20.5.1 3DISTNAME= node-v20.6.0
4EXTRACT_SUFX= .tar.xz 4EXTRACT_SUFX= .tar.xz
5 5
6USE_LANGUAGES= c gnu++17 6USE_LANGUAGES= c gnu++17
7 7
8USE_CXX_FEATURES+= c++17 charconv 8USE_CXX_FEATURES+= c++17 charconv
9 9
10TOOL_DEPENDS+= ${PYPKGPREFIX}-expat>=0:../../textproc/py-expat 10TOOL_DEPENDS+= ${PYPKGPREFIX}-expat>=0:../../textproc/py-expat
11 11
12PKGREVISION= 1 
13.include "../../mk/bsd.prefs.mk" 12.include "../../mk/bsd.prefs.mk"
14 13
15# XXX: figure out a way to add rpaths to torque 14# XXX: figure out a way to add rpaths to torque
16MAKE_ENV+= LD_LIBRARY_PATH=${PREFIX}/lib 15MAKE_ENV+= LD_LIBRARY_PATH=${PREFIX}/lib
17 16
18CONFIGURE_ARGS+= --shared-nghttp3 17CONFIGURE_ARGS+= --shared-nghttp3
19CONFIGURE_ARGS+= --shared-ngtcp2 18CONFIGURE_ARGS+= --shared-ngtcp2
20 19
21PYTHON_VERSIONS_INCOMPATIBLE= 27 20PYTHON_VERSIONS_INCOMPATIBLE= 27
22 21
23CHECK_INTERPRETER_SKIP+= lib/node_modules/corepack/shims/*.ps1 22CHECK_INTERPRETER_SKIP+= lib/node_modules/corepack/shims/*.ps1
24CHECK_PORTABILITY_SKIP+= deps/uv/autogen.sh 23CHECK_PORTABILITY_SKIP+= deps/uv/autogen.sh
25CHECK_PORTABILITY_SKIP+= deps/v8/tools/cppgc/export_to_github.sh 24CHECK_PORTABILITY_SKIP+= deps/v8/tools/cppgc/export_to_github.sh

cvs diff -r1.75 -r1.76 pkgsrc/lang/nodejs/PLIST (expand / switch to unified diff)

--- pkgsrc/lang/nodejs/PLIST 2023/07/25 06:42:43 1.75
+++ pkgsrc/lang/nodejs/PLIST 2023/09/06 19:28:20 1.76
@@ -1,36 +1,78 @@ @@ -1,36 +1,78 @@
1@comment $NetBSD: PLIST,v 1.75 2023/07/25 06:42:43 adam Exp $ 1@comment $NetBSD: PLIST,v 1.76 2023/09/06 19:28:20 adam Exp $
2bin/corepack 2bin/corepack
3bin/node 3bin/node
4bin/npm 4bin/npm
5bin/npx 5bin/npx
6include/node/common.gypi 6include/node/common.gypi
7include/node/config.gypi 7include/node/config.gypi
 8include/node/cppgc/allocation.h
8include/node/cppgc/common.h 9include/node/cppgc/common.h
 10include/node/cppgc/cross-thread-persistent.h
 11include/node/cppgc/custom-space.h
 12include/node/cppgc/default-platform.h
 13include/node/cppgc/ephemeron-pair.h
 14include/node/cppgc/explicit-management.h
 15include/node/cppgc/garbage-collected.h
 16include/node/cppgc/heap-consistency.h
 17include/node/cppgc/heap-handle.h
 18include/node/cppgc/heap-state.h
 19include/node/cppgc/heap-statistics.h
 20include/node/cppgc/heap.h
 21include/node/cppgc/internal/api-constants.h
 22include/node/cppgc/internal/atomic-entry-flag.h
 23include/node/cppgc/internal/base-page-handle.h
 24include/node/cppgc/internal/caged-heap-local-data.h
 25include/node/cppgc/internal/caged-heap.h
 26include/node/cppgc/internal/compiler-specific.h
 27include/node/cppgc/internal/finalizer-trait.h
 28include/node/cppgc/internal/gc-info.h
 29include/node/cppgc/internal/logging.h
 30include/node/cppgc/internal/member-storage.h
 31include/node/cppgc/internal/name-trait.h
 32include/node/cppgc/internal/persistent-node.h
 33include/node/cppgc/internal/pointer-policies.h
 34include/node/cppgc/internal/write-barrier.h
 35include/node/cppgc/liveness-broker.h
 36include/node/cppgc/macros.h
 37include/node/cppgc/member.h
 38include/node/cppgc/name-provider.h
 39include/node/cppgc/object-size-trait.h
 40include/node/cppgc/persistent.h
 41include/node/cppgc/platform.h
 42include/node/cppgc/prefinalizer.h
 43include/node/cppgc/process-heap-statistics.h
 44include/node/cppgc/sentinel-pointer.h
 45include/node/cppgc/source-location.h
 46include/node/cppgc/testing.h
 47include/node/cppgc/trace-trait.h
 48include/node/cppgc/type-traits.h
 49include/node/cppgc/visitor.h
9include/node/js_native_api.h 50include/node/js_native_api.h
10include/node/js_native_api_types.h 51include/node/js_native_api_types.h
11include/node/libplatform/libplatform-export.h 52include/node/libplatform/libplatform-export.h
12include/node/libplatform/libplatform.h 53include/node/libplatform/libplatform.h
13include/node/libplatform/v8-tracing.h 54include/node/libplatform/v8-tracing.h
14include/node/node.h 55include/node/node.h
15include/node/node_api.h 56include/node/node_api.h
16include/node/node_api_types.h 57include/node/node_api_types.h
17include/node/node_buffer.h 58include/node/node_buffer.h
18include/node/node_object_wrap.h 59include/node/node_object_wrap.h
19include/node/node_version.h 60include/node/node_version.h
20include/node/v8-array-buffer.h 61include/node/v8-array-buffer.h
21include/node/v8-callbacks.h 62include/node/v8-callbacks.h
22include/node/v8-container.h 63include/node/v8-container.h
23include/node/v8-context.h 64include/node/v8-context.h
 65include/node/v8-cppgc.h
24include/node/v8-data.h 66include/node/v8-data.h
25include/node/v8-date.h 67include/node/v8-date.h
26include/node/v8-debug.h 68include/node/v8-debug.h
27include/node/v8-embedder-heap.h 69include/node/v8-embedder-heap.h
28include/node/v8-embedder-state-scope.h 70include/node/v8-embedder-state-scope.h
29include/node/v8-exception.h 71include/node/v8-exception.h
30include/node/v8-extension.h 72include/node/v8-extension.h
31include/node/v8-external.h 73include/node/v8-external.h
32include/node/v8-forward.h 74include/node/v8-forward.h
33include/node/v8-function-callback.h 75include/node/v8-function-callback.h
34include/node/v8-function.h 76include/node/v8-function.h
35include/node/v8-initialization.h 77include/node/v8-initialization.h
36include/node/v8-internal.h 78include/node/v8-internal.h

cvs diff -r1.242 -r1.243 pkgsrc/lang/nodejs/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/nodejs/distinfo 2023/08/11 05:25:17 1.242
+++ pkgsrc/lang/nodejs/distinfo 2023/09/06 19:28:21 1.243
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: distinfo,v 1.242 2023/08/11 05:25:17 adam Exp $ 1$NetBSD: distinfo,v 1.243 2023/09/06 19:28:21 adam Exp $
2 2
3BLAKE2s (node-v20.5.1.tar.xz) = d4b65e72751e657084aa8d70648eecfe4a3cfaea320c83a58443b1119de87463 3BLAKE2s (node-v20.6.0.tar.xz) = a36a1d3dd65c0b322945536e5b75b56da6392fc0d57655ee435d9f248f1b2625
4SHA512 (node-v20.5.1.tar.xz) = 2828930bf2df0769ec7116fc6b89c7069294426b937ce38543426e0108a8c953301c523eb03419e35a993773895d74b28838bec96ffc01ab0e138a4b2a52737d 4SHA512 (node-v20.6.0.tar.xz) = 2d50407e55008fba82a8568287c77c690b43953bc9068a22714e8c19809e5130b15b01770c6aabfa6269ab1b58c2f1fde3c58822cabe2cae4b5067e27e38f204
5Size (node-v20.5.1.tar.xz) = 41532256 bytes 5Size (node-v20.6.0.tar.xz) = 41787960 bytes
6SHA1 (patch-common.gypi) = f50615affd26c2c7902d2112c8e9f2704c057b9c 6SHA1 (patch-common.gypi) = f50615affd26c2c7902d2112c8e9f2704c057b9c
7SHA1 (patch-deps_cares_cares.gyp) = 22b44f2ac59963f694dfe4f4585e08960b3dec32 7SHA1 (patch-deps_cares_cares.gyp) = 22b44f2ac59963f694dfe4f4585e08960b3dec32
8SHA1 (patch-deps_uv_common.gypi) = 29f0c382b68f77749a71ce39fa2ca37338ca18ec 8SHA1 (patch-deps_uv_common.gypi) = 29f0c382b68f77749a71ce39fa2ca37338ca18ec
9SHA1 (patch-deps_uvwasi_include_wasi__serdes.h) = 32b85ef5824b96b35aba9280bbe7aa7899d9e5cf 9SHA1 (patch-deps_uvwasi_include_wasi__serdes.h) = 32b85ef5824b96b35aba9280bbe7aa7899d9e5cf
10SHA1 (patch-deps_v8_src_base_platform_memory.h) = 0921b5eeecfe03b774f85a15628c559901e7fea8 10SHA1 (patch-deps_v8_src_base_platform_memory.h) = 0921b5eeecfe03b774f85a15628c559901e7fea8
11SHA1 (patch-deps_v8_src_base_platform_platform-freebsd.cc) = b47025f33d2991275bbcd15dbabb28900afab0e1 11SHA1 (patch-deps_v8_src_base_platform_platform-freebsd.cc) = b47025f33d2991275bbcd15dbabb28900afab0e1
12SHA1 (patch-deps_v8_src_base_platform_platform-openbsd.cc) = 5e593879dbab095f99e82593272a0de91043f9a8 12SHA1 (patch-deps_v8_src_base_platform_platform-openbsd.cc) = 5e593879dbab095f99e82593272a0de91043f9a8
13SHA1 (patch-deps_v8_src_base_platform_platform-posix.cc) = e797043e7fa1379f086ffe3a919e140260b0632e 13SHA1 (patch-deps_v8_src_base_platform_platform-posix.cc) = e797043e7fa1379f086ffe3a919e140260b0632e
14SHA1 (patch-deps_v8_src_base_platform_semaphore.cc) = 802a95f1b1d131e0d85c1f99c659cc68b31ba2f6 14SHA1 (patch-deps_v8_src_base_platform_semaphore.cc) = 802a95f1b1d131e0d85c1f99c659cc68b31ba2f6
15SHA1 (patch-deps_v8_src_base_strings.h) = 4d2b37491f2f74f1a573f8c1942790204e23a8bb 15SHA1 (patch-deps_v8_src_base_strings.h) = 4d2b37491f2f74f1a573f8c1942790204e23a8bb
16SHA1 (patch-deps_v8_src_codegen_arm_cpu-arm.cc) = 84c75d61bc99c2ff9adeac3152f5b11ebb0e582b 16SHA1 (patch-deps_v8_src_codegen_arm_cpu-arm.cc) = 84c75d61bc99c2ff9adeac3152f5b11ebb0e582b
17SHA1 (patch-deps_v8_src_common_globals.h) = 86637724864389f2b24251904de41669a2f00fbc 17SHA1 (patch-deps_v8_src_common_globals.h) = 86637724864389f2b24251904de41669a2f00fbc
18SHA1 (patch-deps_v8_src_compiler_types.h) = 2a212282ab9d71e98ae56827fdb1d9778a6047a5 18SHA1 (patch-deps_v8_src_compiler_types.h) = 2a212282ab9d71e98ae56827fdb1d9778a6047a5