Commit Graph

23 Commits

Author SHA1 Message Date
Richard Lau
6d2d3f17ba
2024-03-26, Version 20.12.0 'Iron' (LTS)
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) https://github.com/nodejs/node/pull/51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) https://github.com/nodejs/node/pull/51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51794
doc:
  * add lemire to collaborators (Daniel Lemire) https://github.com/nodejs/node/pull/51572
  * add zcbenz to collaborators (Cheng Zhao) https://github.com/nodejs/node/pull/51812
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) https://github.com/nodejs/node/pull/51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) https://github.com/nodejs/node/pull/50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) https://github.com/nodejs/node/pull/50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) https://github.com/nodejs/node/pull/50960
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) https://github.com/nodejs/node/pull/51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) https://github.com/nodejs/node/pull/51244

PR-URL: https://github.com/nodejs/node/pull/52212
2024-03-26 17:42:38 +00:00
marco-ippolito
2246cd9735 2024-03-06, Version 21.7.0 (Current)
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) https://github.com/nodejs/node/pull/51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) https://github.com/nodejs/node/pull/51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) https://github.com/nodejs/node/pull/51812
  * add lemire to collaborators (Daniel Lemire) https://github.com/nodejs/node/pull/51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) https://github.com/nodejs/node/pull/51412
  * (SEMVER-MINOR) add server handshake utility (snek) https://github.com/nodejs/node/pull/51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) https://github.com/nodejs/node/pull/51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) https://github.com/nodejs/node/pull/51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) https://github.com/nodejs/node/pull/50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) https://github.com/nodejs/node/pull/50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) https://github.com/nodejs/node/pull/50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) https://github.com/nodejs/node/pull/51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) https://github.com/nodejs/node/pull/51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) https://github.com/nodejs/node/pull/51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) https://github.com/nodejs/node/pull/50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) https://github.com/nodejs/node/pull/51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) https://github.com/nodejs/node/pull/51244

PR-URL: https://github.com/nodejs/node/pull/51932
2024-03-06 15:35:16 -03:00
Joyee Cheung
ec3040f721
sea: update stability index
The design is relatively stable now and it's more suitable to
describe it as being "in active developement".

PR-URL: https://github.com/nodejs/node/pull/51774
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-02-17 18:03:26 +00:00
Joyee Cheung
c307ad7686
sea: support sea.getRawAsset()
This patch adds support for `sea.getRawAsset()` which is
similar to `sea.getAsset()` but returns the raw asset
in an array buffer without copying. Users should avoid
writing to the returned array buffer. If the injected
section is not marked as writable or not aligned,
writing to the raw asset is likely to result in a crash.

PR-URL: https://github.com/nodejs/node/pull/50960
Refs: https://github.com/nodejs/single-executable/issues/68
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-02-02 15:25:34 +01:00
Joyee Cheung
ce8f085d26
sea: support embedding assets
With this patch:

Users can now include assets by adding a key-path dictionary
to the configuration as the `assets` field. At build time, Node.js
would read the assets from the specified paths and bundle them into
the preparation blob. In the generated executable, users can retrieve
the assets using the `sea.getAsset()` and `sea.getAssetAsBlob()` API.

```json
{
  "main": "/path/to/bundled/script.js",
  "output": "/path/to/write/the/generated/blob.blob",
  "assets": {
    "a.jpg": "/path/to/a.jpg",
    "b.txt": "/path/to/b.txt"
  }
}
```

The single-executable application can access the assets as follows:

```cjs
const { getAsset } = require('node:sea');
// Returns a copy of the data in an ArrayBuffer
const image = getAsset('a.jpg');
// Returns a string decoded from the asset as UTF8.
const text = getAsset('b.txt', 'utf8');
// Returns a Blob containing the asset.
const blob = getAssetAsBlob('a.jpg');
```

Drive-by: update the  documentation to include a section dedicated
to the injected main script and refer to it as "injected main
script" instead of "injected module" because it's a script, not
a module.

PR-URL: https://github.com/nodejs/node/pull/50960
Refs: https://github.com/nodejs/single-executable/issues/68
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-02-02 15:25:34 +01:00
Ulises Gascón
12354260db 2023-09-04, Version 20.6.0 (Current)
Notable changes:

deps:
  * V8: cherry-pick 93275031284c (Joyee Cheung) #48660
doc:
  * add new TSC members (Michael Dawson) #48841
  * add rluvaton to collaborators (Raz Luvaton) #49215
esm:
  * unflag import.meta.resolve (Guy Bedford) #49028
  * add `initialize` hook, integrate with `register` (Izaak Schroeder) #48842
  * unflag `Module.register` and allow nested loader `import()` (Izaak Schroeder) #48559
inspector:
  * (SEMVER-MINOR) open add `SymbolDispose` (Chemi Atlow) #48765
module:
  * implement `register` utility (João Lenon) #46826
  * make CJS load from ESM loader (Antoine du Hamel) #47999
src:
  * add built-in `.env` file support (Yagiz Nizipli) #48890
  * initialize cppgc (Daryl Haresign and Joyee Cheung) #48660 and #45704
test_runner:
  * (SEMVER-MINOR) expose location of tests (Colin Ihrig) #48975

PR-URL: https://github.com/nodejs/node/pull/49185
2023-09-04 15:01:52 -05:00
Darshan Sen
6cd678965f
sea: add support for V8 bytecode-only caching
Refs: https://github.com/nodejs/single-executable/issues/73
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48191
Fixes: https://github.com/nodejs/single-executable/issues/73
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-07-26 10:10:35 +00:00
Joyee Cheung
ac34e7561a
src: support snapshot in single executable applications
This patch adds snapshot support to single executable applications.
To build a snapshot from the main script when preparing the
blob that will be injected into the single executable application,
add `"useSnapshot": true` to the configuration passed to
`--experimental-sea-config`. For example:

```
{
    "main": "snapshot.js",
    "output": "sea-prep.blob",
    "useSnapshot": true
}
```

The main script used to build the snapshot must invoke
`v8.startupSnapshot.setDeserializeMainFunction()` to configure the
entry point. The generated startup snapshot would be part of the
preparation blob and get injected into the final executable.

When the single executable application is launched, instead of running
the `main` script from scratch, Node.js would instead deserialize the
snapshot to get to the state initialized during build-time directly.

PR-URL: https://github.com/nodejs/node/pull/46824
Refs: https://github.com/nodejs/single-executable/discussions/57
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-07-20 22:57:00 +00:00
Yoav Vainrich
d9438ccbd8
doc: fix copy node executable in Windows
Windows where command lists all places it finds a pattern in Path.
The first one is the one that executes when called.
So the old code was overriding the first executable by any other match.

PR-URL: https://github.com/nodejs/node/pull/48624
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-07-06 19:28:59 +00:00
Antoine du Hamel
00fcff575e
doc: add version info on the SEA docs
PR-URL: https://github.com/nodejs/node/pull/48173
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-05-25 15:54:46 +00:00
Darshan Sen
a7a1fc5e0b
test,doc,sea: run SEA tests on ppc64
The recent Postject upgrade, https://github.com/nodejs/node/pull/48072,
included a performance improvement for the injection operation
(see https://github.com/nodejs/postject/pull/86), so now it might be
possible to run the SEA tests on the ppc64 architecture runners on
Jenkins, which was previously getting timed out.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48111
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-05-24 10:49:05 +00:00
Rich Trott
c7fe303eaf
doc: update SEA source link
The code was moved in 3803b028d so the current source link is broken
in our docs.

PR-URL: https://github.com/nodejs/node/pull/48080
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-05-21 18:10:07 +00:00
Alex Schwartz
e49bb6851c doc: correct line break for Windows terminals
PR-URL: https://github.com/nodejs/node/pull/48083
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
2023-05-21 09:05:16 -07:00
Antoine du Hamel
30870d126b
doc: fix Windows code snippet tags
Those were wrongly marked as `bash`, when the text around it was
referencing PowerShell or Command Prompt.

PR-URL: https://github.com/nodejs/node/pull/48100
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2023-05-21 11:27:16 +00:00
Antoine du Hamel
260092eca3
doc: harmonize fenced code snippet flags
We had a few code snippets that were using a non-descriptive tag (e.g.
`console` or `text`), whereas the actual language it's using describes
it better, and improves the syntax highlighting. This commit also
removes non-necessary leading chars (e.g. `$`, `>`, or `%`) to make it
easier for readers to copy and paste to try the command themselves.

PR-URL: https://github.com/nodejs/node/pull/48082
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-05-21 09:36:57 +02:00
Darshan Sen
2de10f5149
sea: add option to disable the experimental SEA warning
Refs: https://github.com/nodejs/single-executable/discussions/60
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47588
Fixes: https://github.com/nodejs/node/issues/47741
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-05-04 15:27:54 +00:00
XLor
d225d95758 doc: add copy node executable guide on windows
PR-URL: https://github.com/nodejs/node/pull/47781
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-05-01 17:41:02 +05:30
Xuguang Mei
a75959b1bc
doc: mark signing the binary is macOS and Windows only in SEA
PR-URL: https://github.com/nodejs/node/pull/47722
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2023-04-28 09:02:55 +00:00
Joyee Cheung
491a5c968f
sea: use JSON configuration and blob content for SEA
PR-URL: https://github.com/nodejs/node/pull/47125
Refs: https://github.com/nodejs/single-executable/discussions/58
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-04-09 18:31:15 +00:00
Darshan Sen
86c831f643
doc,test: extend the list of platforms supported by single-executables
Now that https://github.com/nodejs/node/pull/46934 has landed, we can
extend the list of platforms and architectures where we can run the
single-executable test.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47026
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-03-11 08:58:52 +00:00
Darshan Sen
4cde39e817
doc: add steps about signing the binary in single-executable docs
We didn't catch this in https://github.com/nodejs/node/pull/45038
because the binary wasn't signed by default unlike the official Node.js
binary, which is signed by the Node.js Foundation identity by default.

Refs: https://github.com/nodejs/postject/issues/76 (macOS arm64 part only)
Fixes: https://github.com/nodejs/postject/issues/75
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46764
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-26 12:26:40 +05:30
Myles Borins
89322aed7e
2023-02-21, Version 19.7.0 (Current)
Notable changes:

deps:
  * upgrade npm to 9.5.0 (npm team) https://github.com/nodejs/node/pull/46673
  * add ada as a dependency (Yagiz Nizipli) https://github.com/nodejs/node/pull/46410
doc:
  * add debadree25 to collaborators (Debadree Chatterjee) https://github.com/nodejs/node/pull/46716
  * add deokjinkim to collaborators (Deokjin Kim) https://github.com/nodejs/node/pull/46444
doc,lib,src,test:
  * rename --test-coverage (Colin Ihrig) https://github.com/nodejs/node/pull/46017
lib:
  * (SEMVER-MINOR) add aborted() utility function (Debadree Chatterjee) https://github.com/nodejs/node/pull/46494
src:
  * (SEMVER-MINOR) add initial support for single executable applications (Darshan Sen) https://github.com/nodejs/node/pull/45038
  * (SEMVER-MINOR) allow optional Isolate termination in node::Stop() (Shelley Vohr) https://github.com/nodejs/node/pull/46583
  * (SEMVER-MINOR) allow blobs in addition to `FILE*`s in embedder snapshot API (Anna Henningsen) https://github.com/nodejs/node/pull/46491
  * (SEMVER-MINOR) allow snapshotting from the embedder API (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) make build_snapshot a per-Isolate option, rather than a global one (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) add snapshot support for embedder API (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) allow embedder control of code generation policy (Shelley Vohr) https://github.com/nodejs/node/pull/46368
stream:
  * (SEMVER-MINOR) add abort signal for ReadableStream and WritableStream (Debadree Chatterjee) https://github.com/nodejs/node/pull/46273
test_runner:
  * add initial code coverage support (Colin Ihrig) https://github.com/nodejs/node/pull/46017
url:
  * replace url-parser with ada (Yagiz Nizipli) https://github.com/nodejs/node/pull/46410

PR-URL: https://github.com/nodejs/node/pull/46725
2023-02-21 13:12:58 -05:00
Darshan Sen
9bbde3d7ba
src: add initial support for single executable applications
Compile a JavaScript file into a single executable application:

```console
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js

$ cp $(command -v node) hello

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
    --macho-segment-name NODE_JS

$ ./hello world
Hello, world!
```

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-18 02:49:18 +00:00