@kirana-style/rolldown 0.2.1 → 0.2.3

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 CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.3](https://github.com/kirana-style/kirana/compare/v0.2.2...v0.2.3) (2026-10-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * opt-in dense class names for production builds ([#56](https://github.com/kirana-style/kirana/issues/56)) ([8de7aa1](https://github.com/kirana-style/kirana/commit/8de7aa1860a3e2d090d46dd8ef7fd5ba74a03c83))
9
+ * **site:** show the lab's scale curve on the benchmarks page ([#53](https://github.com/kirana-style/kirana/issues/53)) ([006313d](https://github.com/kirana-style/kirana/commit/006313d61bc0331059b30cfcf2ea6a31c0772ea2))
10
+ * **site:** the large-dom table, a homepage chart and visual habits ([#52](https://github.com/kirana-style/kirana/issues/52)) ([7af6734](https://github.com/kirana-style/kirana/commit/7af6734384f71add75ba12fb506aee11a24aa4d3))
11
+
12
+
13
+ ### Bug fixes
14
+
15
+ * **compiler:** let bundlers drop recipe tables resolved at build time ([#55](https://github.com/kirana-style/kirana/issues/55)) ([1a2eb9b](https://github.com/kirana-style/kirana/commit/1a2eb9bd50c549165cd69fc911b15f3a37f40fc7))
16
+ * **release:** publish a package only once npm serves what it depends on ([#50](https://github.com/kirana-style/kirana/issues/50)) ([f52fc50](https://github.com/kirana-style/kirana/commit/f52fc50b5043826efbf87a867b2ef0d1aa9b2cae))
17
+
18
+
19
+ ### Performance
20
+
21
+ * **core:** merge each combination of handles once at runtime ([#54](https://github.com/kirana-style/kirana/issues/54)) ([633486f](https://github.com/kirana-style/kirana/commit/633486f3d212ce2a132ccaac046fecf92516c518))
22
+
23
+ ## [0.2.2](https://github.com/kirana-style/kirana/compare/v0.2.1...v0.2.2) (2026-10-16)
24
+
25
+
26
+ ### Features
27
+
28
+ * **site:** show stylex's swc build beside its babel one ([#44](https://github.com/kirana-style/kirana/issues/44)) ([8d7c870](https://github.com/kirana-style/kirana/commit/8d7c870781c66ae9168774072e75c22772d92c40))
29
+
30
+
31
+ ### Bug fixes
32
+
33
+ * **cli:** let doctor and init see a monorepo's shared setup ([#49](https://github.com/kirana-style/kirana/issues/49)) ([34d4e77](https://github.com/kirana-style/kirana/commit/34d4e774c300d817b591bc77f468fac701a353f3))
34
+ * **site:** fill the browser tables and add editors and skills to the ecosystem ([#48](https://github.com/kirana-style/kirana/issues/48)) ([16b83c0](https://github.com/kirana-style/kirana/commit/16b83c0dcf054dda5b2cb1d34e60b7a6c382a431))
35
+ * **site:** show only the benchmark targets the site names ([#43](https://github.com/kirana-style/kirana/issues/43)) ([7519e55](https://github.com/kirana-style/kirana/commit/7519e552dd9b65fbd81c2d8524614846e1529d1b))
36
+ * **vite:** keep a stylesheet change made while vite is still serving it ([#41](https://github.com/kirana-style/kirana/issues/41)) ([1225bf2](https://github.com/kirana-style/kirana/commit/1225bf28e5f10915626c7c9ed0d3502a9c87cdb9))
37
+ * **zed:** find the project's kirana-style through package.json ([#47](https://github.com/kirana-style/kirana/issues/47)) ([5bcbe16](https://github.com/kirana-style/kirana/commit/5bcbe16050fea8f60f5ea538c9b924aa8b3bb966))
38
+
39
+
40
+ ### Documentation
41
+
42
+ * take the benchmarks of kirana 0.2.1 from kirana-lab ([#46](https://github.com/kirana-style/kirana/issues/46)) ([0d8b91b](https://github.com/kirana-style/kirana/commit/0d8b91b99027cd494a68d145a6dd651941aeed23))
43
+
3
44
  ## [0.2.1](https://github.com/kirana-style/kirana/compare/v0.2.0...v0.2.1) (2026-10-16)
4
45
 
5
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirana-style/rolldown",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Kirana for Rolldown: compiles modules and emits the stylesheet.",
5
5
  "license": "MIT",
6
6
  "author": "The Kirana authors",
@@ -25,8 +25,8 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@kirana-style/compiler": "0.2.1",
29
- "@kirana-style/core": "0.2.1"
28
+ "@kirana-style/compiler": "0.2.3",
29
+ "@kirana-style/core": "0.2.3"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "rolldown": "^1.2.12"
package/src/index.d.ts CHANGED
@@ -16,6 +16,14 @@ export type KiranaRolldownOptions = {
16
16
  * bundles CSS, the stylesheet follows Vite's asset naming instead.
17
17
  */
18
18
  fileName?: string;
19
+ /**
20
+ * `"dense"` gives a production build short class names (D-084): the condition and value hashes
21
+ * in every chunk and in the stylesheet become codes of one or two characters, assigned from the
22
+ * whole build, and everything the runtime merge reads stays. A development server keeps the
23
+ * hashed names. Not available with a class map (`classes`), whose server-side helpers read hashed
24
+ * names. Default `"hashed"`.
25
+ */
26
+ names?: "hashed" | "dense";
19
27
  /** Injected Driver options (tests). */
20
28
  driver?: Pick<DriverOptions, "native" | "importModule">;
21
29
  };
@@ -42,6 +50,12 @@ export declare function createKirana(options?: KiranaRolldownOptions, host?: Hos
42
50
  plugin: {
43
51
  name: string;
44
52
  buildStart(): Promise<void>;
53
+ renderChunk(code: string, chunk: {
54
+ fileName: string;
55
+ }): Promise<{
56
+ code: string;
57
+ map: import("magic-string").SourceMap;
58
+ } | null>;
45
59
  load: {
46
60
  filter: {
47
61
  id: RegExp[];
package/src/index.js CHANGED
@@ -31,6 +31,7 @@ function createKirana(options = {}, host = {}) {
31
31
  const filled = /* @__PURE__ */ new Set();
32
32
  const development = () => host.development?.() ?? false;
33
33
  const fileName = options.fileName ?? "kirana.css";
34
+ const dense = () => options.names === "dense" && !development();
34
35
  const session = () => {
35
36
  driver ??= Driver.create({
36
37
  root: state.root,
@@ -43,7 +44,15 @@ function createKirana(options = {}, host = {}) {
43
44
  const plugin = {
44
45
  name: "kirana",
45
46
  async buildStart() {
46
- await session();
47
+ const compiler = await session();
48
+ if (dense()) {
49
+ if (compiler.classModules.length > 0) throw new Error("kirana: `names: \"dense\"` cannot be used with a class map (`classes`): server templates read hashed names");
50
+ compiler.markDense();
51
+ }
52
+ },
53
+ async renderChunk(code, chunk) {
54
+ if (!dense()) return null;
55
+ return (await session()).dense(code, chunk.fileName) ?? null;
47
56
  },
48
57
  load: {
49
58
  filter: { id: [/stylesheet\.css/, COMPONENT] },
@@ -104,7 +113,7 @@ function createKirana(options = {}, host = {}) {
104
113
  order: "pre",
105
114
  async handler(_output, bundle) {
106
115
  if (!host.bundlesCss) {
107
- const css = (await session()).stylesheet(true);
116
+ const css = (await session()).stylesheet(true, dense());
108
117
  this.emitFile({
109
118
  type: "asset",
110
119
  fileName,
@@ -123,7 +132,7 @@ function createKirana(options = {}, host = {}) {
123
132
  * plugin added after the first pass (Qwik's).
124
133
  */
125
134
  const fill = async (bundle, emitFile) => {
126
- const css = (await session()).stylesheet(true);
135
+ const css = (await session()).stylesheet(true, dense());
127
136
  for (const [key, asset] of Object.entries(bundle)) {
128
137
  if (asset.type !== "asset") continue;
129
138
  const source = fillStylesheet(String(asset.source), css);