streetui 1.4.0 → 1.6.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.
@@ -1,6 +1,6 @@
1
- import { S as StreetApp } from './compile-Cgx1PjG6.cjs';
2
- export { V as VERSION } from './compile-Cgx1PjG6.cjs';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-DWZZylCS.cjs';
1
+ import { S as StreetApp } from './compile-CEom4hkp.cjs';
2
+ export { V as VERSION } from './compile-CEom4hkp.cjs';
3
+ import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-D286jpZZ.cjs';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as StreetApp } from './compile-Cgx1PjG6.js';
2
- export { V as VERSION } from './compile-Cgx1PjG6.js';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-e6iDuR1D.js';
1
+ import { S as StreetApp } from './compile-CEom4hkp.js';
2
+ export { V as VERSION } from './compile-CEom4hkp.js';
3
+ import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-YrG-OJJe.js';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
package/dist/testing.js CHANGED
@@ -315,13 +315,30 @@ var ServerElement = class {
315
315
  parent = null;
316
316
  tagName;
317
317
  attributes = /* @__PURE__ */ new Map();
318
- /** JS properties set via `setProperty` (e.g. input `value`, `checked`). */
319
- properties = /* @__PURE__ */ new Map();
320
318
  children = [];
321
- style = new ServerStyle();
319
+ // Lazily-allocated stores. On the 10k-row SSR corpus ~0% of elements carry JS
320
+ // properties or inline styles (measured, §5: 1 of 80,029 elements uses
321
+ // `properties`, 0 use `style`), so eagerly allocating a `properties` Map plus
322
+ // a `ServerStyle` (which itself holds a Map) per element wasted ~240k
323
+ // allocations per /users render — all in the dominant mount phase. These are
324
+ // created on first WRITE via the `properties`/`style` getters; the serializer
325
+ // reads the raw `_properties`/`_style` fields so a READ never forces an
326
+ // allocation. Output is byte-identical: an unset store previously serialized
327
+ // to nothing (empty `properties.has(...)` / `style.isEmpty`), and a null store
328
+ // is skipped the same way.
329
+ _properties = null;
330
+ _style = null;
322
331
  constructor(tagName) {
323
332
  this.tagName = tagName.toLowerCase();
324
333
  }
334
+ /** JS properties set via `setProperty` (e.g. input `value`, `checked`). Allocated on first access. */
335
+ get properties() {
336
+ return this._properties ??= /* @__PURE__ */ new Map();
337
+ }
338
+ /** Inline-style holder mirroring `element.style`. Allocated on first access. */
339
+ get style() {
340
+ return this._style ??= new ServerStyle();
341
+ }
325
342
  };
326
343
  var VOID_ELEMENTS = /* @__PURE__ */ new Set([
327
344
  "area",
@@ -414,20 +431,24 @@ function serializeAttributes(el) {
414
431
  parts.push(` ${name}="${escapeHtmlAttr(value)}"`);
415
432
  }
416
433
  }
417
- for (const [name, kind] of SERIALIZED_PROPERTY_ENTRIES) {
418
- if (!el.properties.has(name)) continue;
419
- if (el.attributes.has(name)) continue;
420
- const raw = el.properties.get(name);
421
- if (kind === "boolean") {
422
- if (raw === true) parts.push(` ${name}`);
423
- } else {
424
- if (raw !== void 0 && raw !== null) {
425
- parts.push(` ${name}="${escapeHtmlAttr(String(raw))}"`);
434
+ const props = el._properties;
435
+ if (props !== null) {
436
+ for (const [name, kind] of SERIALIZED_PROPERTY_ENTRIES) {
437
+ if (!props.has(name)) continue;
438
+ if (el.attributes.has(name)) continue;
439
+ const raw = props.get(name);
440
+ if (kind === "boolean") {
441
+ if (raw === true) parts.push(` ${name}`);
442
+ } else {
443
+ if (raw !== void 0 && raw !== null) {
444
+ parts.push(` ${name}="${escapeHtmlAttr(String(raw))}"`);
445
+ }
426
446
  }
427
447
  }
428
448
  }
429
- if (!el.style.isEmpty && !el.attributes.has("style")) {
430
- parts.push(` style="${escapeHtmlAttr(el.style.toCss())}"`);
449
+ const style = el._style;
450
+ if (style !== null && !style.isEmpty && !el.attributes.has("style")) {
451
+ parts.push(` style="${escapeHtmlAttr(style.toCss())}"`);
431
452
  }
432
453
  return parts.join("");
433
454
  }
@@ -2014,7 +2035,7 @@ function formatInspection(inspection) {
2014
2035
  }
2015
2036
 
2016
2037
  // src/version.ts
2017
- var VERSION = "1.4.0";
2038
+ var VERSION = "1.6.0";
2018
2039
  export {
2019
2040
  VERSION,
2020
2041
  analyzeGraph,