bimba-cli 0.5.18 → 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 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimba-cli",
3
- "version": "0.5.18",
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
@@ -28,6 +28,7 @@ const hmrClient = `
28
28
  const _newClasses = new Map(); // tagName → latest class from HMR import
29
29
  const _oldNs = new Map(); // tagName → previous _ns_ (saved before _patchClass wipes it)
30
30
  let _collector = null; // when set, captures tag names defined during one HMR import
31
+ let _stableSlots = false; // when true, _patchClass skips Symbol-keyed props (CSS-only HMR)
31
32
 
32
33
  customElements.define = function(name, cls, opts) {
33
34
  if (_collector) _collector.push(name);
@@ -41,7 +42,9 @@ const hmrClient = `
41
42
  if (target) {
42
43
  // Save old _ns_ before _patchClass overwrites prototype descriptors
43
44
  if (target.prototype._ns_) _oldNs.set(name, target.prototype._ns_);
44
- _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);
45
48
  }
46
49
  }
47
50
  };
@@ -106,10 +109,12 @@ const hmrClient = `
106
109
  const collected = [];
107
110
  const prev = _collector;
108
111
  _collector = collected;
112
+ _stableSlots = (slots === 'stable');
109
113
  try {
110
114
  await import('/' + file + '?t=' + Date.now());
111
115
  } finally {
112
116
  _collector = prev;
117
+ _stableSlots = false;
113
118
  }
114
119
 
115
120
  // Sync _ns_ (CSS namespace) from the new classes. imba_defineTag sets