unplugin-keywords 2.10.1 → 2.11.1
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/README.md +5 -5
- package/dist/api.js +1 -1
- package/dist/bun.js +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/farm.js +1 -1
- package/dist/hash-CKju2_N1.js +2744 -0
- package/dist/hash-CKju2_N1.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{plugin-BfUGt2kL.js → plugin-BwhGea-8.js} +2 -2
- package/dist/{plugin-BfUGt2kL.js.map → plugin-BwhGea-8.js.map} +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.js +1 -1
- package/dist/rspack.js +1 -1
- package/dist/vite.js +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +4 -1
- package/dist/hash-CV-Tn-Zm.js +0 -422
- package/dist/hash-CV-Tn-Zm.js.map +0 -1
package/README.md
CHANGED
|
@@ -37,12 +37,12 @@ A side-by-side comparison of minified bundles:
|
|
|
37
37
|
| [Unmodified](https://github.com/cueaz/unplugin-keywords/blob/main/demo/signals/src/original.ts) (Standard Minification) | [Keywordified](https://github.com/cueaz/unplugin-keywords/blob/main/demo/signals/src/keywordified.ts) (Literal Obfuscation) |
|
|
38
38
|
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
39
39
|
| <picture><source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/cueaz/unplugin-keywords/refs/heads/main/demo/signals/dist_sample/original.min.js.light.png" width="400"><img src="https://raw.githubusercontent.com/cueaz/unplugin-keywords/refs/heads/main/demo/signals/dist_sample/original.min.js.dark.png" width="400" alt="Original"></picture> | <picture><source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/cueaz/unplugin-keywords/refs/heads/main/demo/signals/dist_sample/keywordified.min.js.light.png" width="400"><img src="https://raw.githubusercontent.com/cueaz/unplugin-keywords/refs/heads/main/demo/signals/dist_sample/keywordified.min.js.dark.png" width="400" alt="Keywordified"></picture> |
|
|
40
|
-
| 6.86 kB │ gzip: 2.09 kB | 5.
|
|
40
|
+
| 6.86 kB │ gzip: 2.09 kB | 5.17 kB │ gzip: 2.01 kB |
|
|
41
41
|
|
|
42
42
|
> [!NOTE]
|
|
43
|
-
> **Baseline Metrics:** Both the "Unmodified" and "Keywordified" metrics represent standard `tsdown` minification.
|
|
43
|
+
> **Baseline Metrics:** Both the "Unmodified" and "Keywordified" metrics represent standard `tsdown` minification. For comparison, the official [`@preact/signals-core@1.14.1`](https://bundlephobia.com/package/@preact/signals-core@1.14.1) release achieves a 5.4 kB Minified / 1.9 kB Gzipped footprint by employing a hand-crafted [`mangle.json`](https://github.com/preactjs/signals/blob/main/mangle.json) for manual property obfuscation.
|
|
44
44
|
>
|
|
45
|
-
> **Compression Efficiency:** While the uncompressed bundle size is reduced by
|
|
45
|
+
> **Compression Efficiency:** While the uncompressed bundle size is reduced by 24.6%, the gzipped size is only 3.8% smaller. This demonstrates the effectiveness of standard gzip compression on unmodified code: if minimizing the gzipped network payload is the sole objective, adopting this plugin is unnecessary.
|
|
46
46
|
|
|
47
47
|
_For more information, see the [demo documentation](https://github.com/cueaz/unplugin-keywords/blob/main/demo/signals/README.md)._
|
|
48
48
|
|
|
@@ -73,7 +73,7 @@ The bundler receives the transformed code and processes the obfuscated literals.
|
|
|
73
73
|
<!-- prettier-ignore-start -->
|
|
74
74
|
```ts
|
|
75
75
|
// Example of minifier output: strings may be inlined or assigned to variables if used multiple times
|
|
76
|
-
const _="
|
|
76
|
+
const _="b";const a={a:_,c:data};
|
|
77
77
|
```
|
|
78
78
|
<!-- prettier-ignore-end -->
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ const _="b0";const a={a0:_,c0:data};
|
|
|
82
82
|
`unplugin-keywords` provides two distinct virtual modules. By default, the shortest possible compression is used, but the dual-module system allows for stable cross-boundary contracts when necessary.
|
|
83
83
|
|
|
84
84
|
- **`~keywords` (Lexical Counter):**
|
|
85
|
-
Generates the shortest safe sequential identifiers (min length:
|
|
85
|
+
Generates the shortest safe sequential identifiers (min length: 1, e.g., `"a"`, `"b"`). Intended for **internal and local** implementations where cross-boundary stability is irrelevant. This is the default for maximum minification.
|
|
86
86
|
_Convention:_ `import * as K from '~keywords';`
|
|
87
87
|
|
|
88
88
|
- **`~keywords/public` (Stable Hash):**
|
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as transformCode, i as extractKeywords, n as createHasher, r as createRunner, t as createCounter } from "./hash-
|
|
1
|
+
import { a as transformCode, i as extractKeywords, n as createHasher, r as createRunner, t as createCounter } from "./hash-CKju2_N1.js";
|
|
2
2
|
//#region src/api.ts
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
package/dist/bun.js
CHANGED
package/dist/esbuild.js
CHANGED
package/dist/farm.js
CHANGED