unplugin-keywords 2.10.1 → 2.11.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/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 kB │ gzip: 2.05 kB |
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. The official [`@preact/signals-core@1.14.1`](https://bundlephobia.com/package/@preact/signals-core@1.14.1) release achieves a smaller footprint (5.4 kB Minified / 1.9 kB Gzipped) by employing a hand-crafted [`mangle.json`](https://github.com/preactjs/signals/blob/main/mangle.json) for manual property obfuscation.
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 21.3%, the gzipped size is only 1.9% 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.
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 _="b0";const a={a0:_,c0:data};
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: 2, e.g., `"a0"`, `"b0"`). Intended for **internal and local** implementations where cross-boundary stability is irrelevant. This is the default for maximum minification.
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-CV-Tn-Zm.js";
1
+ import { a as transformCode, i as extractKeywords, n as createHasher, r as createRunner, t as createCounter } from "./hash-Bqp-2TPm.js";
2
2
  //#region src/api.ts
3
3
  /**
4
4
  * @license
package/dist/bun.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./plugin-BfUGt2kL.js";
1
+ import { t as unpluginFactory } from "./plugin-DlhkmOsT.js";
2
2
  import { createBunPlugin } from "unplugin";
3
3
  //#region src/bun.ts
4
4
  /**
package/dist/esbuild.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./plugin-BfUGt2kL.js";
1
+ import { t as unpluginFactory } from "./plugin-DlhkmOsT.js";
2
2
  import { createEsbuildPlugin } from "unplugin";
3
3
  //#region src/esbuild.ts
4
4
  /**
package/dist/farm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./plugin-BfUGt2kL.js";
1
+ import { t as unpluginFactory } from "./plugin-DlhkmOsT.js";
2
2
  import { createFarmPlugin } from "unplugin";
3
3
  //#region src/farm.ts
4
4
  /**