bimba-cli 0.5.19 → 0.5.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/serve.js +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimba-cli",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/HeapVoid/bimba.git"
package/serve.js CHANGED
@@ -42,7 +42,9 @@ const hmrClient = `
42
42
  if (target) {
43
43
  // Save old _ns_ before _patchClass overwrites prototype descriptors
44
44
  if (target.prototype._ns_) _oldNs.set(name, target.prototype._ns_);
45
- _patchClass(target, cls);
45
+ // When CSS-only (stable slots), skip patching render/methods —
46
+ // new render() has new Symbol closures that would cause duplicate DOM.
47
+ if (!_stableSlots) _patchClass(target, cls);
46
48
  }
47
49
  }
48
50
  };
@@ -51,13 +53,12 @@ const hmrClient = `
51
53
 
52
54
  // Copy all own property descriptors from source to target, skipping keys
53
55
  // that match the shouldSkip predicate. Handles both string and symbol keys.
54
- function _copyDescriptors(target, source, shouldSkip, skipSymbols) {
56
+ function _copyDescriptors(target, source, shouldSkip) {
55
57
  for (const key of Object.getOwnPropertyNames(source)) {
56
58
  if (shouldSkip(key)) continue;
57
59
  const d = Object.getOwnPropertyDescriptor(source, key);
58
60
  if (d) try { Object.defineProperty(target, key, d); } catch(_) {}
59
61
  }
60
- if (skipSymbols) return; // CSS-only: keep existing Symbol-keyed render caches
61
62
  for (const key of Object.getOwnPropertySymbols(source)) {
62
63
  const d = Object.getOwnPropertyDescriptor(source, key);
63
64
  if (d) try { Object.defineProperty(target, key, d); } catch(_) {}
@@ -65,8 +66,8 @@ const hmrClient = `
65
66
  }
66
67
 
67
68
  function _patchClass(target, source) {
68
- _copyDescriptors(target.prototype, source.prototype, k => k === 'constructor', _stableSlots);
69
- _copyDescriptors(target, source, k => _skipStatics.has(k), _stableSlots);
69
+ _copyDescriptors(target.prototype, source.prototype, k => k === 'constructor');
70
+ _copyDescriptors(target, source, k => _skipStatics.has(k));
70
71
  }
71
72
 
72
73
  // ── HMR update handler ─────────────────────────────────────────────────────