@zkmake/three-meter 0.13.0 → 0.13.2

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
@@ -9,7 +9,7 @@ textures and shaders in GPU memory. Zero dependencies. Works with `WebGLRenderer
9
9
  bun add -d @zkmake/three-meter # or npm i -D / pnpm add -D
10
10
  ```
11
11
 
12
- Live demo: [zkmake.github.io/three-kit/three-meter](https://zkmake.github.io/three-kit/three-meter/), with a vanilla three and a
12
+ Live demo: [zkmake.github.io/three-kit/three-meter/demo](https://zkmake.github.io/three-kit/three-meter/demo/), with a vanilla three and a
13
13
  React Three Fiber take on the same scene. Add `?webgpu` for the WebGPU renderer and `?count=30000` to
14
14
  load the scene up past the demo's triangle budget.
15
15
 
@@ -346,7 +346,7 @@ The card is `.perf-hud__card`, holding `.perf-hud__brand` and your content (the
346
346
 
347
347
  ## Examples
348
348
 
349
- [`apps/site/src/demos/three-meter`](https://github.com/zkmake/three-kit/tree/main/apps/site/src/demos/three-meter) is what runs at [zkmake.github.io/three-kit/three-meter](https://zkmake.github.io/three-kit/three-meter/):
349
+ [`apps/site/src/demos/three-meter`](https://github.com/zkmake/three-kit/tree/main/apps/site/src/demos/three-meter) is what runs at [zkmake.github.io/three-kit/three-meter/demo](https://zkmake.github.io/three-kit/three-meter/demo/):
350
350
  both integrations of the same scene, swapped from the header.
351
351
  [`vanilla.ts`](https://github.com/zkmake/three-kit/blob/main/apps/site/src/demos/three-meter/vanilla.ts) is plain three with `mountPerfHud`;
352
352
  [`r3f.tsx`](https://github.com/zkmake/three-kit/blob/main/apps/site/src/demos/three-meter/r3f.tsx) is React Three Fiber with `PerfSampler` and
@@ -361,6 +361,25 @@ Styles inject at runtime by default. To link them instead, pass `injectStyles: f
361
361
 
362
362
  The package never reads `NODE_ENV` or `import.meta.env`. Whether the HUD exists in production is
363
363
  your call. Gate the import in the app with a `?debug=` query, a build flag or a dynamic `import()`.
364
+ [three-devtools](../three-devtools) is that gate, done once.
365
+
366
+ A dynamic `import()` only keeps the HUD out of the first load if the bundler leaves it in its own
367
+ chunk. A catch-all chunk group that sends every `node_modules` module to one `vendor` chunk (Vite's
368
+ `codeSplitting.groups`, `manualChunks`) pulls the meter into a chunk `index.html` preloads, so every
369
+ player downloads it. Leave `@zkmake` out of that group:
370
+
371
+ ```ts
372
+ // vite.config.ts, build.rolldownOptions.output.codeSplitting.groups
373
+ {
374
+ name: "vendor",
375
+ // Everything in node_modules but @zkmake, whose dev tools load behind ?debug.
376
+ test: /^(?!.*[\\/]node_modules[\\/]@zkmake[\\/]).*[\\/]node_modules[\\/]/,
377
+ priority: 10,
378
+ },
379
+ ```
380
+
381
+ Then check a production build: no chunk that `index.html` loads or preloads contains
382
+ `PerformanceMonitor`.
364
383
 
365
384
  ## Contract
366
385
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as RingBuffer, t as PerformanceMonitor } from "./performance-monitor-CKAI0-Dp.js";
1
+ import { n as RingBuffer, t as PerformanceMonitor } from "./performance-monitor-Dj5H2VXT.js";
2
2
  // src/core/wrap-animation-loop.ts
3
3
  /**
4
4
  * Wrap a `renderer.setAnimationLoop` callback so each tick is one frame:
@@ -1428,7 +1428,7 @@ const mountDevPanel = (options) => {
1428
1428
  };
1429
1429
  // package.json
1430
1430
  var name = "@zkmake/three-meter";
1431
- var version = "0.13.0";
1431
+ var version = "0.13.2";
1432
1432
  // src/ui/clipboard.ts
1433
1433
  /**
1434
1434
  * Copy text from a click handler. The async Clipboard API needs a secure
@@ -2648,4 +2648,4 @@ const mountPerfHud = (monitor, options = {}) => {
2648
2648
  };
2649
2649
  export { mountDevPanel as a, dockPanel as c, HudTheme as d, THEME_MODES as f, formatQuality as i, DEFAULT_STORAGE_KEY as l, resolveBudgets as m, PerformanceView as n, PERF_HUD_STYLES as o, isThemeMode as p, formatReport as r, injectStyles as s, mountPerfHud as t, HudSettings as u };
2650
2650
 
2651
- //# sourceMappingURL=mount-perf-hud-DefBWWKu.js.map
2651
+ //# sourceMappingURL=mount-perf-hud-s8ezVm_5.js.map