@medicomind/rolldown-compression 2.1.8 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +25 -17
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/index.d.ts +2 -2
- package/index.js +54 -54
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @medicomind/rolldown-compression
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#28](https://github.com/Medico-Mind/rolldown-compression/pull/28) [`f738722`](https://github.com/Medico-Mind/rolldown-compression/commit/f7387220e91fcf9fd3eb27b0c969891a8eefd446) Thanks [@Mnwa](https://github.com/Mnwa)! - Build the x86_64 binaries for the x86-64-v2 baseline.
|
|
8
|
+
|
|
9
|
+
- The prebuilt `x86_64` bindings (linux-gnu, linux-musl, darwin and windows-msvc) are now compiled with `-C target-cpu=x86-64-v2`, and the C dependencies on the linux and darwin targets with the matching `-march=x86-64-v2`. That lets the compressors use SSE3 through SSE4.2, POPCNT and CMPXCHG16B directly instead of the 2003-era baseline rustc and cc default to.
|
|
10
|
+
- The requirement that follows: the `x86_64` binaries need a CPU from Intel Nehalem (2008) or AMD Bulldozer (2011) onwards. Every x86_64 machine and cloud instance still in service clears that bar, but a build host older than those, or a VM pinned to an emulated pre-Nehalem CPU model, will now fault on load instead of running. `aarch64` and `wasm32-wasi` builds are untouched.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#28](https://github.com/Medico-Mind/rolldown-compression/pull/28) [`f738722`](https://github.com/Medico-Mind/rolldown-compression/commit/f7387220e91fcf9fd3eb27b0c969891a8eefd446) Thanks [@Mnwa](https://github.com/Mnwa)! - Internal: hold the per-worker compression scratch in rayon's own state, and trim the zstd build.
|
|
15
|
+
|
|
16
|
+
- The brotli scratch buffers and the zstd compressor moved out of `thread_local!` storage and into a `CompressMeta` value that rayon creates once per worker via `map_init` and threads through the batch by `&mut`. The state is reused across the files a worker handles exactly as before, but no thread-local storage is involved: the brotli scratch is a plain inline array again rather than a heap `Vec` working around glibc's static TLS surplus in a `dlopen`ed `cdylib`, and neither buffer depends on the lifetime of the thread that first touched it.
|
|
17
|
+
- zstd is built with `default-features = false`, dropping the legacy-format decoder (v0.1–0.7), the array APIs and the dictionary builder — none of which this plugin calls — from the compiled C, and the `wasm32-wasi` build adds `no_asm` so it stops trying to assemble the x86 decompression routines.
|
|
18
|
+
|
|
19
|
+
## 2.2.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [`e170791`](https://github.com/Medico-Mind/rolldown-compression/commit/e170791f0fbb3c78666604245054131c286272a8) Thanks [@Mnwa](https://github.com/Mnwa)! - Run brotli's sectioned path on rayon, and scale it to the whole pool.
|
|
24
|
+
|
|
25
|
+
- Large brotli inputs are now split across rayon's global thread pool instead of brotli's own `WorkerPool`. Sections share the threads that already run the per-file batch, so there are no dedicated OS threads to spawn, no pool to check out and hand back, and no oversubscription when many large files compress at once. Joining a section works rayon's queue instead of parking the worker, so a batch whose every worker sits inside a large-file compression cannot starve itself.
|
|
26
|
+
- A large input is now cut into one section per full `sectionSize`, capped at one section per worker thread, where the count was previously capped at four regardless of how wide the pool was. Very large bundles now finish on every core instead of a quarter of them: on 100 MiB of real JS at quality 11 with 18 workers, the file compresses in 6.1s instead of 19.0s (3.1x) for 0.1% more output — a tenth of the ratio that splitting the file at all already costs. Going past one section per worker was measured to be slower, not faster, as the extra sections queue behind each other.
|
|
27
|
+
- Because that cap follows the pool, a file big enough to reach it (larger than `threads * sectionSize`, i.e. 8 MiB per thread at the default window) is split according to the machine's core count or the `concurrency` setting, so its compressed bytes can differ between machines. Inputs below the cap are split by length alone and compress identically everywhere, as does everything gzip and zstd produce. If you need byte-identical brotli output for very large files across a heterogeneous fleet, either set `concurrency` so every machine builds a pool of the same width, or raise `sectionSize` far enough that the section count stays under the cap.
|
|
28
|
+
- `sectionSize` defaults to two windows (`2^(windowBits + 1)` bytes) instead of one, and inputs take the multithreaded path from twice `sectionSize` instead of four times. At the default window that is 8 MiB sections with multithreading still starting at 16 MiB, so large files are cut into fewer, larger sections and keep more cross-section matches. Compressed bytes for brotli inputs above the threshold differ from 2.1.7; gzip and zstd output is unchanged.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- [`e170791`](https://github.com/Medico-Mind/rolldown-compression/commit/e170791f0fbb3c78666604245054131c286272a8) Thanks [@Mnwa](https://github.com/Mnwa)! - Internal: split the compression core into per-algorithm submodules (`compress/inner_{brotli,gzip,zstd}.rs`), and add opt-in [hotpath](https://hotpath.rs) profiling of the batch, per-file and per-algorithm paths behind the crate's `hotpath` / `hotpath-alloc` cargo features. Both are off in every published build — the macros expand to noops and pull in no third-party dependencies — so released bindings are unaffected at compile time and at runtime.
|
|
33
|
+
|
|
3
34
|
## 2.1.8
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ All options are validated when `compression()` is called — invalid levels (e.g
|
|
|
104
104
|
| `gzip` | `level` | 0–9 | 6 |
|
|
105
105
|
| `brotli` | `quality` | 0–11 | 11 |
|
|
106
106
|
| `brotli` | `windowBits` | 10–24 | 22 |
|
|
107
|
-
| `brotli` | `sectionSize` | ≥ 1 (bytes) | `2^windowBits` B |
|
|
107
|
+
| `brotli` | `sectionSize` | ≥ 1 (bytes) | `2^(windowBits + 1)` B |
|
|
108
108
|
| `zstd` | `level` | 1–22 | 19 |
|
|
109
109
|
|
|
110
110
|
```ts
|
|
@@ -113,7 +113,13 @@ defineAlgorithm('brotli', { quality: 7, windowBits: 22 })
|
|
|
113
113
|
defineAlgorithm('zstd', { level: 12 })
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
`sectionSize` is the target number of bytes each brotli worker thread compresses when a large input is split across the native worker pool; inputs at least
|
|
116
|
+
`sectionSize` is the target number of bytes each brotli worker thread compresses when a large input is split across the native worker pool; inputs at least twice `sectionSize` take the multithreaded path. It defaults to two windows (`2^(windowBits + 1)` bytes) — 8 MiB and multithreading from 16 MiB at the default window — because sections much smaller than the window lose too many cross-section matches. Smaller sections finish large files faster at a slight cost in compression ratio.
|
|
117
|
+
|
|
118
|
+
An input is cut into one section per full `sectionSize`, up to one section per worker thread — more sections than there are threads only queue behind each other. A file large enough to hit that cap is therefore split according to the pool size (the machine's core count, or [`concurrency`](#options) when set), so its compressed bytes can differ between machines; smaller inputs are split by length alone and compress identically everywhere. On 100 MiB of real JS at quality 11 with 18 workers, one section per worker compresses 3.1x faster than the previous four-section limit for 0.1% more output.
|
|
119
|
+
|
|
120
|
+
**`windowBits` is the main speed/ratio dial.** It sets the brotli sliding window (`2^windowBits` bytes) — how far back a match can be found — and, through the `sectionSize` default above, how large a file has to be before it is split across threads. **Lowering it makes compression faster in two ways at once and costs compression ratio**: a smaller window is cheaper to search, *and* it drops the split threshold to `2^(windowBits + 2)` bytes, so big bundles are cut into sections sooner and finish on more cores (`windowBits: 20` splits from 4 MiB instead of 16 MiB). On the [benchmark](#synthetic-benchmark) fixtures, `windowBits: 20` takes brotli quality 11 from 10.08s to 6.48s. Raising it does the reverse: better ratio, less parallelism, slower builds.
|
|
121
|
+
|
|
122
|
+
The size penalty depends entirely on how far apart your content's repetitions are: it is real on production bundles (repeated vendor copies, inlined assets, source maps), but on those synthetic fixtures — whose matches are nearly all short-range — it stays within 0.1%, and there `windowBits: 20` even came out marginally *smaller*. **Measure your own output before shipping a lower window** — decoders also allocate the window the stream declares, and above 24 bits brotli needs the large-window extension that browsers do not implement, hence the 10–24 range. The default `22` matches `BROTLI_DEFAULT_WINDOW`, i.e. what `node:zlib` and the `brotli` CLI emit.
|
|
117
123
|
|
|
118
124
|
## How it works
|
|
119
125
|
|
|
@@ -190,28 +196,30 @@ Results on an Apple M5 Pro (18 cores), Node 26, default `UV_THREADPOOL_SIZE`:
|
|
|
190
196
|
#### With PGO
|
|
191
197
|
| scenario | output | native (rust) | node:zlib | speedup |
|
|
192
198
|
|-----------------------------------|----------|---------------|-----------|---------|
|
|
193
|
-
| gzip+brotli (ref. defaults: 9/11) | 15.
|
|
194
|
-
| gzip (level 9) | 9.62 MB | 0.18s | 0.53s | 2.
|
|
195
|
-
| gzip (level 6) | 9.86 MB | 0.11s | 0.24s | 2.
|
|
196
|
-
| brotli (quality 11) | 5.45 MB |
|
|
197
|
-
| brotli (quality 6) | 9.88 MB | 0.
|
|
198
|
-
| zstd (level 19) | 5.54 MB |
|
|
199
|
+
| gzip+brotli (ref. defaults: 9/11) | 15.07 MB | 9.72s | 23.66s | 2.43x |
|
|
200
|
+
| gzip (level 9) | 9.62 MB | 0.18s | 0.53s | 2.91x |
|
|
201
|
+
| gzip (level 6) | 9.86 MB | 0.11s | 0.24s | 2.07x |
|
|
202
|
+
| brotli (quality 11) | 5.45 MB | 10.17s | 23.50s | 2.31x |
|
|
203
|
+
| brotli (quality 6) | 9.88 MB | 0.15s | 0.22s | 1.42x |
|
|
204
|
+
| zstd (level 19) | 5.54 MB | 4.90s | 8.03s | 1.64x |
|
|
199
205
|
|
|
200
206
|
#### Without PGO
|
|
201
207
|
| scenario | output | native (rust) | node:zlib | speedup |
|
|
202
208
|
|-----------------------------------|----------|---------------|-----------|---------|
|
|
203
|
-
| gzip+brotli (ref. defaults: 9/11) | 15.
|
|
204
|
-
| gzip (level 9) | 9.62 MB | 0.16s | 0.
|
|
205
|
-
| gzip (level 6) | 9.86 MB | 0.
|
|
206
|
-
| brotli (quality 11) | 5.45 MB |
|
|
207
|
-
| brotli (quality 6) | 9.88 MB | 0.
|
|
208
|
-
| zstd (level 19) | 5.54 MB |
|
|
209
|
+
| gzip+brotli (ref. defaults: 9/11) | 15.07 MB | 10.29s | 23.51s | 2.29x |
|
|
210
|
+
| gzip (level 9) | 9.62 MB | 0.16s | 0.53s | 3.23x |
|
|
211
|
+
| gzip (level 6) | 9.86 MB | 0.12s | 0.24s | 1.99x |
|
|
212
|
+
| brotli (quality 11) | 5.45 MB | 9.82s | 23.66s | 2.41x |
|
|
213
|
+
| brotli (quality 6) | 9.88 MB | 0.15s | 0.22s | 1.41x |
|
|
214
|
+
| zstd (level 19) | 5.54 MB | 4.93s | 8.02s | 1.63x |
|
|
209
215
|
|
|
210
216
|
Reading these numbers honestly:
|
|
211
217
|
|
|
212
218
|
- **gzip** and **zstd** are faster per core ([zlib-rs](https://github.com/trifectatechfoundation/zlib-rs), ~2.4x faster per core than node's bundled zlib in our measurements; libzstd) *and* use every core, while `node:zlib` is capped at `UV_THREADPOOL_SIZE` (default 4) threads. The two >16 MiB bundles temper the headline numbers: neither algorithm has a sectioned mode, so each giant file occupies a single thread on both sides and that tail runs at the per-core ratio rather than the thread-count ratio.
|
|
213
|
-
- **brotli at quality 11** is the bound on the combined number: the Rust `brotli` crate is at per-core parity with node's C brotli (we measured a 1.01 single-thread ratio), so the speedup is parallelism — every core against `UV_THREADPOOL_SIZE` threads across the many small files, plus the sectioned worker pool (
|
|
214
|
-
- The
|
|
219
|
+
- **brotli at quality 11** is the bound on the combined number: the Rust `brotli` crate is at per-core parity with node's C brotli (we measured a 1.01 single-thread ratio), so the speedup is parallelism — every core against `UV_THREADPOOL_SIZE` threads across the many small files, plus the sectioned worker pool (2 x 8 MiB sections) on the >16 MiB bundles that `node:zlib` has to compress one thread per file.
|
|
220
|
+
- **The brotli rows are slower than the previous release's tables, by design.** `sectionSize` used to default to one window (4 MiB at `windowBits: 22`), splitting a >16 MiB input into up to 4 sections; it now defaults to two windows (8 MiB), so the fixture set's two ~20 MiB bundles are cut into 2 sections instead of 4 and their tail runs on half as many cores. Brotli quality 11 went from ~6.9s to ~10.2s and the combined scenario from 3.34x to 2.43x. Holding the *current* binding fixed and passing only `sectionSize: 4 * 1024 * 1024` brings quality 11 back to 7.29s (vs 10.08s at the default), so the regression is the new default rather than the rayon worker-pool rewrite that landed alongside it. Pass `sectionSize` explicitly if you want the old wall clock.
|
|
221
|
+
- **The ratio this buys is not visible on these fixtures.** The larger default exists because sections much smaller than the window lose cross-section matches, but at quality 11 the same 85 MB comes out **5.450 MB with 8 MiB sections and 5.445 MB with 4 MiB ones** — 0.09%, and in the wrong direction, i.e. block-splitting noise rather than a real gain. The generated fixtures repeat a small vocabulary line by line, so nearly every match is short-range and even a 4 MiB window already finds it. Expect the trade to favor the larger default on real bundles with long-range redundancy (repeated vendor copies, inlined assets, source maps) — and measure your own output before trading wall clock for it.
|
|
222
|
+
- The speedup grows with core count and shrinks if you raise `UV_THREADPOOL_SIZE` for the JS side — the benchmark prints both so runs are comparable. The 10-core M1 Pro these tables previously covered landed around 2.4x on the combined scenario, and the 18-core M5 Pro reaches 2.3–2.4x at the current section default (it reached 3.3–3.6x at the old 4 MiB one) against the same 4-thread JS side.
|
|
215
223
|
- The two tables above are single runs of each binding, so the small differences *between* them are run-to-run noise, not a PGO effect — see [PGO / BOLT builds](#pgo--bolt-builds) for an interleaved median comparison of the same two binaries.
|
|
216
224
|
|
|
217
225
|
### PGO / BOLT builds
|
|
@@ -232,7 +240,7 @@ Reading these numbers honestly:
|
|
|
232
240
|
| baseline | plain `--release` (fat LTO, `codegen-units = 1`) |
|
|
233
241
|
| pgo / pgo+bolt | same flags plus `-Cprofile-use` (and BOLT layout on Linux) |
|
|
234
242
|
|
|
235
|
-
Expect modest gains at best: the baseline already ships fat LTO with `codegen-units = 1`, so there is little left for PGO to find. On an M5 Pro the interleaved medians come out at parity (0.
|
|
243
|
+
Expect modest gains at best: the baseline already ships fat LTO with `codegen-units = 1`, so there is little left for PGO to find. On an M5 Pro the interleaved medians come out at parity (0.96x–1.03x across the compression-heavy scenarios); an earlier M1 Pro run measured ~1.1x on brotli quality 11. Treat single-digit-percent deltas in either direction — and every sub-second scenario — as measurement noise rather than a real speedup or regression.
|
|
236
244
|
|
|
237
245
|
The release workflow builds every published binary with PGO. Cross-compiled targets run the training workload through an emulation layer — x64 Node under Rosetta 2 for `x86_64-apple-darwin`, an arm64 Node container under QEMU for `aarch64-unknown-linux-gnu`, and an Alpine container for musl — so each target trains on its own instrumented binding.
|
|
238
246
|
|
package/dist/index.d.cts
CHANGED
|
@@ -11,9 +11,9 @@ interface GzipOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
|
|
13
13
|
* `sectionSize`: target bytes per worker thread when large inputs are split
|
|
14
|
-
* across the native brotli worker pool; inputs at least
|
|
15
|
-
* take the multithreaded path. Defaults to
|
|
16
|
-
* i.e.
|
|
14
|
+
* across the native brotli worker pool; inputs at least twice this size
|
|
15
|
+
* take the multithreaded path. Defaults to two windows (`2^(windowBits + 1)`
|
|
16
|
+
* bytes), i.e. 8 MiB and multithreading from 16 MiB at the default window. Smaller
|
|
17
17
|
* sections finish large files faster at a slight cost in compression ratio.
|
|
18
18
|
*/
|
|
19
19
|
interface BrotliOptions {
|
package/dist/index.d.mts
CHANGED
|
@@ -11,9 +11,9 @@ interface GzipOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Brotli options. `quality`: 0-11, default 11. `windowBits`: 10-24, default 22.
|
|
13
13
|
* `sectionSize`: target bytes per worker thread when large inputs are split
|
|
14
|
-
* across the native brotli worker pool; inputs at least
|
|
15
|
-
* take the multithreaded path. Defaults to
|
|
16
|
-
* i.e.
|
|
14
|
+
* across the native brotli worker pool; inputs at least twice this size
|
|
15
|
+
* take the multithreaded path. Defaults to two windows (`2^(windowBits + 1)`
|
|
16
|
+
* bytes), i.e. 8 MiB and multithreading from 16 MiB at the default window. Smaller
|
|
17
17
|
* sections finish large files faster at a slight cost in compression ratio.
|
|
18
18
|
*/
|
|
19
19
|
interface BrotliOptions {
|
package/index.d.ts
CHANGED
|
@@ -56,8 +56,8 @@ export interface CompressTask {
|
|
|
56
56
|
/**
|
|
57
57
|
* Brotli only: target section size in bytes per worker thread when
|
|
58
58
|
* large inputs are split across the brotli worker pool; inputs at
|
|
59
|
-
* least
|
|
60
|
-
* to
|
|
59
|
+
* least twice this size take the multithreaded path. Defaults
|
|
60
|
+
* to two windows (`2^(windowBits + 1)` bytes), i.e. 8 MiB and
|
|
61
61
|
* multithreading from 16 MiB at the default window.
|
|
62
62
|
*/
|
|
63
63
|
sectionSize?: number
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@medicomind/rolldown-compression-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '2.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
80
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@medicomind/rolldown-compression-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '2.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
96
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@medicomind/rolldown-compression-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '2.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
117
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@medicomind/rolldown-compression-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '2.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
133
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@medicomind/rolldown-compression-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '2.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
150
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@medicomind/rolldown-compression-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '2.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
166
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@medicomind/rolldown-compression-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '2.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
185
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@medicomind/rolldown-compression-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '2.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
201
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@medicomind/rolldown-compression-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '2.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
217
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@medicomind/rolldown-compression-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '2.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
237
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@medicomind/rolldown-compression-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '2.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
253
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@medicomind/rolldown-compression-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '2.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
274
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@medicomind/rolldown-compression-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '2.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
290
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@medicomind/rolldown-compression-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '2.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
308
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@medicomind/rolldown-compression-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '2.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
324
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@medicomind/rolldown-compression-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '2.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
342
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@medicomind/rolldown-compression-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '2.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
358
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@medicomind/rolldown-compression-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '2.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
376
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@medicomind/rolldown-compression-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '2.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
392
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@medicomind/rolldown-compression-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '2.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
410
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@medicomind/rolldown-compression-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '2.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
426
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@medicomind/rolldown-compression-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '2.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
443
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@medicomind/rolldown-compression-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '2.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
459
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@medicomind/rolldown-compression-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '2.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
479
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@medicomind/rolldown-compression-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '2.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
495
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@medicomind/rolldown-compression-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '2.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 2.
|
|
511
|
+
if (bindingPackageVersion !== '2.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -648,8 +648,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
648
648
|
if (!candidateFailed) {
|
|
649
649
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
650
650
|
const bindingPackageVersion = require('@medicomind/rolldown-compression-wasm32-wasi/package.json').version
|
|
651
|
-
if (bindingPackageVersion !== '2.
|
|
652
|
-
throw new Error(`WASI binding package version mismatch, expected 2.
|
|
651
|
+
if (bindingPackageVersion !== '2.3.0') {
|
|
652
|
+
throw new Error(`WASI binding package version mismatch, expected 2.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
wasiBinding = require('@medicomind/rolldown-compression-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicomind/rolldown-compression",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Fast native (Rust) gzip / brotli / zstd compression plugin for Rolldown, powered by napi-rs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rolldown",
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
"rolldown": "^1.0.0"
|
|
92
92
|
},
|
|
93
93
|
"optionalDependencies": {
|
|
94
|
-
"@medicomind/rolldown-compression-darwin-arm64": "2.
|
|
95
|
-
"@medicomind/rolldown-compression-darwin-x64": "2.
|
|
96
|
-
"@medicomind/rolldown-compression-linux-arm64-gnu": "2.
|
|
97
|
-
"@medicomind/rolldown-compression-linux-x64-gnu": "2.
|
|
98
|
-
"@medicomind/rolldown-compression-linux-x64-musl": "2.
|
|
99
|
-
"@medicomind/rolldown-compression-wasm32-wasi": "2.
|
|
100
|
-
"@medicomind/rolldown-compression-win32-x64-msvc": "2.
|
|
94
|
+
"@medicomind/rolldown-compression-darwin-arm64": "2.3.0",
|
|
95
|
+
"@medicomind/rolldown-compression-darwin-x64": "2.3.0",
|
|
96
|
+
"@medicomind/rolldown-compression-linux-arm64-gnu": "2.3.0",
|
|
97
|
+
"@medicomind/rolldown-compression-linux-x64-gnu": "2.3.0",
|
|
98
|
+
"@medicomind/rolldown-compression-linux-x64-musl": "2.3.0",
|
|
99
|
+
"@medicomind/rolldown-compression-wasm32-wasi": "2.3.0",
|
|
100
|
+
"@medicomind/rolldown-compression-win32-x64-msvc": "2.3.0"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@biomejs/biome": "^2.5.3",
|