@lmjs/core 2.1.13 → 2.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmjs/core",
3
- "version": "2.1.13",
3
+ "version": "2.1.17",
4
4
  "description": "LumenJS reactive core runtime — the reactive engine, HTML/JS AST compiler, realtime socket client, and delegated event listeners powering LumenJS applications.",
5
5
  "files": [
6
6
  "dist/",
package/src/_re.js CHANGED
@@ -172,6 +172,27 @@ function _x(_x) {
172
172
  if (varsIdx === -1) return;
173
173
  let varName = varsIdx < currPath.length - 1 ? currPath[varsIdx + 1] : key;
174
174
  let rootPath = currPath.slice(0, varsIdx);
175
+
176
+ // 2026-09-22: `watch` (V1's real, documented global object for
177
+ // variable-change callbacks — `watch = { myVar: function(){...} }`)
178
+ // was declared (`var watch = {};`, vendor/reconnecting-
179
+ // websocket.js) but never actually consulted anywhere — a
180
+ // genuinely unimplemented feature, not a regression. Doesn't need
181
+ // to be a Proxy itself: it's a plain lookup table (name ->
182
+ // callback), not a reactive value that needs its own change-
183
+ // tracking — what it actually needs is for the EXISTING reactive
184
+ // dispatch (this function, the one place every tracked var write
185
+ // — View, Global, Widgets, subviews — passes through exactly
186
+ // once, regardless of how many mounted instances subsequently
187
+ // call their own .update()) to check it. Fires once per real
188
+ // Proxy write, not once per mounted instance, so a Global var
189
+ // watched from a page with several widgets/subviews doesn't
190
+ // multi-fire the callback.
191
+ try {
192
+ if (typeof watch !== 'undefined' && watch && Object.prototype.hasOwnProperty.call(watch, varName) && typeof watch[varName] === 'function') {
193
+ watch[varName]();
194
+ }
195
+ } catch (e) { cl(e); }
175
196
  // Global has no ._re of its own (see its plain {vars:{}} literal
176
197
  // below) — a Global write always re-renders whichever view is
177
198
  // currently looking at it, exactly like the pre-existing behavior
@@ -3067,6 +3088,18 @@ async function renderView(n, isSub, d, type = 'views', viewsArr, scopeBase = ["V
3067
3088
  // cl(el);
3068
3089
  el.append(..._re._RealDOM);
3069
3090
  _re.renderAll();
3091
+
3092
+ // 2026-09-22: same globalWatch() wiring gap as the
3093
+ // main-view renderView() branch below — real page
3094
+ // content (forms, @scroll-* listeners, lazy images)
3095
+ // frequently lives inside a view="..." subview mount
3096
+ // (e.g. the guide pages' own routing dispatcher),
3097
+ // which renders AFTER and separately from the
3098
+ // top-level page — a call only at the outer level
3099
+ // would already be too early for this content.
3100
+ if (typeof globalWatch === 'function') {
3101
+ try { globalWatch(); } catch (e) { cl(e); }
3102
+ }
3070
3103
  }
3071
3104
  // _re._RealDOM.forEach(_el => el[0].appendChild(_el))
3072
3105
  // cl(_re);
@@ -3211,6 +3244,26 @@ async function renderView(n, isSub, d, type = 'views', viewsArr, scopeBase = ["V
3211
3244
  }
3212
3245
 
3213
3246
  _re.renderAll();
3247
+
3248
+ // 2026-09-22, real bug found and fixed: nothing in the
3249
+ // real render pipeline ever called globalWatch() (the
3250
+ // function that actually binds forms/o-sub/b-sub via
3251
+ // renderPlugins(), lazy images via loadPics(), and
3252
+ // @scroll-*/carousel-refresh via reloads()->
3253
+ // applyTriggers()) after an ordinary navigation —
3254
+ // grepped every real call site, and all of them are
3255
+ // gated behind unrelated events (a modal-open click, a
3256
+ // real AJAX request completing) that most page loads
3257
+ // never trigger at all. This is on top of, and separate
3258
+ // from, the dead-code `return;` globalWatch() itself
3259
+ // had (also fixed this session) — even with that fixed,
3260
+ // nothing was ever calling it. Found chasing a real user
3261
+ // report of form data "not being sent to the next view"
3262
+ // on a page that never triggers any AJAX activity or
3263
+ // opens a modal.
3264
+ if (typeof globalWatch === 'function') {
3265
+ try { globalWatch(); } catch (e) { cl(e); }
3266
+ }
3214
3267
  }
3215
3268
  }
3216
3269
  } else {
package/src/dom-shim.js CHANGED
@@ -37,7 +37,37 @@
37
37
  } else {
38
38
  sel = selector;
39
39
  var root = context ? (context instanceof $ ? context[0] : context) : document;
40
- els = root ? toArray(root.querySelectorAll(selector)) : [];
40
+ // 2026-09-22, real bug found and fixed: a selector made
41
+ // ENTIRELY of comma-separated [\@name]-shaped tokens (real
42
+ // usage: applyTriggers()'s
43
+ // "[\@scroll],[\@scroll-start],[\@scroll-end],...") can
44
+ // never match anything through native querySelectorAll —
45
+ // same root cause as $.fn.on's own AT_ATTR_SELECTOR case
46
+ // (an `@`-prefixed write is redirected to el.events[name],
47
+ // never landing in the real attribute store an engine-
48
+ // level selector can see) — but this is the CONSTRUCTOR
49
+ // finding the initial element set, a different call shape
50
+ // from .on()'s delegated-selector case, so that existing
51
+ // fix doesn't cover it. Found as the real reason
52
+ // @scroll/@scroll-start/@scroll-end/... listeners were
53
+ // never actually attached to anything, even after
54
+ // globalWatch() itself started running for the first time
55
+ // this session. Falls back to a real DOM-wide scan +
56
+ // patch-aware getAttribute() check only when every
57
+ // comma-separated part matches this exact shape — every
58
+ // other selector (the overwhelming majority of real calls)
59
+ // stays on the fast native path.
60
+ var atParts = selector.split(',').map(function (s) { return s.trim(); });
61
+ var isAllAtAttrs = atParts.length > 0 && atParts.every(function (p) { return /^\[\\@[\w-]+\]$/.test(p); });
62
+ if (isAllAtAttrs) {
63
+ var names = atParts.map(function (p) { return '@' + /^\[\\@([\w-]+)\]$/.exec(p)[1]; });
64
+ var all = root ? toArray(root.querySelectorAll('*')) : [];
65
+ els = all.filter(function (el) {
66
+ return names.some(function (n) { return el.getAttribute(n) != null; });
67
+ });
68
+ } else {
69
+ els = root ? toArray(root.querySelectorAll(selector)) : [];
70
+ }
41
71
  }
42
72
  } else {
43
73
  els = toArray(selector);
@@ -77,14 +107,56 @@
77
107
  $.proxy = function (fn, context) { return fn.bind(context); };
78
108
  $.trim = function (s) { return (s == null ? '' : String(s)).trim(); };
79
109
  $.inArray = function (val, arr) { return Array.prototype.indexOf.call(arr, val); };
110
+ // 2026-09-22, real bug found and fixed: this only special-cased a real
111
+ // Array/$ set for the numeric-index loop — anything else (including a
112
+ // real NamedNodeMap, e.g. `$.each(el[0].attributes, ...)`, the real
113
+ // vendor code's own modal-open click handler) fell through to a plain
114
+ // `for...in`. A NamedNodeMap's `.length` property IS enumerable via
115
+ // `for...in` in real Chrome (confirmed directly, not assumed) — so the
116
+ // fallback loop ran the callback one extra time with `this` bound to
117
+ // the raw NUMBER `.length` value (`k = "length"`, `arr[k] = 4`), which
118
+ // has no `.value`/`.name`, breaking any callback that reads either
119
+ // (the real modal click handler reads `this.value.toLowerCase()`,
120
+ // throwing `Cannot read properties of undefined`). Real jQuery's own
121
+ // $.each treats anything array-like (a numeric `.length`, with
122
+ // `length-1` a valid index or length===0) via the numeric loop —
123
+ // matching that here closes this for every array-like caller, not
124
+ // just NamedNodeMap specifically.
125
+ function isArrayLike(obj) {
126
+ if (Array.isArray(obj) || obj instanceof $) return true;
127
+ var length = obj && typeof obj === 'object' && obj.length;
128
+ return typeof length === 'number' && (length === 0 || (length - 1) in obj);
129
+ }
80
130
  $.each = function (arr, fn) {
81
- if (Array.isArray(arr) || arr instanceof $) {
131
+ if (isArrayLike(arr)) {
82
132
  for (var i = 0; i < arr.length; i++) if (fn.call(arr[i], i, arr[i]) === false) break;
83
133
  } else {
84
134
  for (var k in arr) if (fn.call(arr[k], k, arr[k]) === false) break;
85
135
  }
86
136
  return arr;
87
137
  };
138
+ // 2026-09-22, real bug found and fixed: getFormData() (vendor/
139
+ // reconnecting-websocket.js, the one real caller) calls $.map() on a
140
+ // real form's serialized field array — genuinely missing, not just
141
+ // untested, so EVERY form submission going through this path (the
142
+ // "local"/non-o-sub ajaxForm branch used by every plain <form
143
+ // action=...> and every b-sub form) threw inside a try/catch that
144
+ // silently swallowed it (cl(e)), leaving the form looking like it
145
+ // just did nothing. Real jQuery semantics: like $.each but collects
146
+ // the callback's return values into a new flat array, dropping
147
+ // null/undefined results (jQuery's actual documented behavior, not
148
+ // just "no-op skip") and flattening any array a callback returns.
149
+ $.map = function (arr, fn) {
150
+ var out = [];
151
+ var src = Array.isArray(arr) || arr instanceof $ ? arr : Object.keys(arr || {}).map(function (k) { return arr[k]; });
152
+ for (var i = 0; i < src.length; i++) {
153
+ var r = fn(src[i], i);
154
+ if (r === null || r === undefined) continue;
155
+ if (Array.isArray(r)) out.push.apply(out, r);
156
+ else out.push(r);
157
+ }
158
+ return out;
159
+ };
88
160
  // Minimal fetch-based $.ajax — covers ws.js's one call site (a plain
89
161
  // GET/POST with success/error callbacks), not jQuery's full option set.
90
162
  // Fires the global ajaxStart/ajaxStop events real jQuery provides for a
@@ -316,6 +388,22 @@
316
388
  // pixel measurements, which nothing in this codebase's core does).
317
389
  $.fn.width = function () { return this[0] ? this[0].offsetWidth : 0; };
318
390
  $.fn.height = function () { return this[0] ? this[0].offsetHeight : 0; };
391
+ // 2026-09-22, found alongside the globalWatch() dead-code fix: real,
392
+ // live vendor code (applyTriggers()'s @scroll-left/@scroll-right/
393
+ // @scroll-top/@scroll-bottom edge detection) calls these — genuinely
394
+ // missing, not just untested.
395
+ $.fn.innerHeight = function () { return this[0] ? this[0].clientHeight : 0; };
396
+ $.fn.innerWidth = function () { return this[0] ? this[0].clientWidth : 0; };
397
+ $.fn.scrollLeft = function (value) {
398
+ if (!this[0]) return value === undefined ? 0 : this;
399
+ if (value === undefined) return this[0] === window ? window.scrollX : this[0].scrollLeft;
400
+ return this.each(function () { if (this === window) window.scrollTo(value, window.scrollY); else this.scrollLeft = value; });
401
+ };
402
+ $.fn.scrollTop = function (value) {
403
+ if (!this[0]) return value === undefined ? 0 : this;
404
+ if (value === undefined) return this[0] === window ? window.scrollY : this[0].scrollTop;
405
+ return this.each(function () { if (this === window) window.scrollTo(window.scrollX, value); else this.scrollTop = value; });
406
+ };
319
407
  $.fn.outerWidth = function (includeMargin) {
320
408
  if (!this[0]) return 0;
321
409
  var w = this[0].offsetWidth;
@@ -650,6 +738,132 @@
650
738
  return this;
651
739
  };
652
740
 
741
+ // 2026-09-22, real bug found and fixed: never implemented at all —
742
+ // the real modal open/close code (lstnrs.js, 3 real call sites, all
743
+ // the same `.delay(ms).queue(function(next){...;next();})` idiom)
744
+ // depends on jQuery's real per-element effects queue. Minimal, faithful
745
+ // subset: a real FIFO queue per element (default "fx" queue, matching
746
+ // real jQuery — nothing in this codebase's real usage names a queue
747
+ // explicitly, so a second name is accepted but untested), processed
748
+ // one entry at a time; each queued function receives a real `next()`
749
+ // it must call to advance, exactly like real jQuery.
750
+ var _queues = new WeakMap();
751
+ function _getQueue(el, name) {
752
+ var byName = _queues.get(el);
753
+ if (!byName) { byName = {}; _queues.set(el, byName); }
754
+ if (!byName[name]) byName[name] = { items: [], running: false };
755
+ return byName[name];
756
+ }
757
+ function _dequeue(el, name) {
758
+ var q = _getQueue(el, name);
759
+ if (q.running) return;
760
+ var next = q.items.shift();
761
+ if (!next) return;
762
+ q.running = true;
763
+ next.call(el, function () {
764
+ q.running = false;
765
+ _dequeue(el, name);
766
+ });
767
+ }
768
+ $.fn.queue = function (name, fn) {
769
+ if (typeof name === 'function') { fn = name; name = 'fx'; }
770
+ name = name || 'fx';
771
+ if (fn === undefined) return _getQueue(this[0], name).items;
772
+ return this.each(function () {
773
+ _getQueue(this, name).items.push(fn);
774
+ _dequeue(this, name);
775
+ });
776
+ };
777
+ $.fn.dequeue = function (name) {
778
+ return this.each(function () { _dequeue(this, name || 'fx'); });
779
+ };
780
+ $.fn.delay = function (ms, name) {
781
+ name = name || 'fx';
782
+ return this.each(function () {
783
+ _getQueue(this, name).items.push(function (next) { setTimeout(next, ms); });
784
+ _dequeue(this, name);
785
+ });
786
+ };
787
+
788
+ // 2026-09-22, real bug found and fixed: never implemented at all —
789
+ // vendor/reconnecting-websocket.js's real, live form-handling code
790
+ // (every plain <form> without `norm`, and every `o-sub`/`b-sub` form)
791
+ // is built entirely on jQuery.form's serializeArray()/ajaxForm(), two
792
+ // real plugin methods this lightweight runtime never provided. The
793
+ // DEFAULT (non--with-plugins-selected) runtime is what most real
794
+ // projects actually ship on now (--with-plugins itself was removed
795
+ // 2026-09-19) — meaning EVERY form on EVERY such project has always
796
+ // silently fallen through to a raw native browser submission (a full
797
+ // page reload) instead of LumenJS's intended pushURL()-based SPA
798
+ // navigation, with o-sub/b-sub handlers never firing at all. Found
799
+ // testing the real /guide/routing/form page: a form with `o-sub`
800
+ // and no `action` submitted natively to the CURRENT page's URL
801
+ // instead of navigating to the target view at all — exactly matching
802
+ // a real user report ("form data is not sent to the next view").
803
+ //
804
+ // serializeArray(): real jQuery-core semantics — successful form
805
+ // controls only (named, not disabled; checkboxes/radios only when
806
+ // checked; submit/button/reset excluded). File inputs are included
807
+ // (unlike real jQuery core's own serializeArray, which drops them
808
+ // entirely) because getFormData() — the one real caller — explicitly
809
+ // branches on `x.type == "file"`, so dropping them silently would
810
+ // just move the gap rather than close it.
811
+ $.fn.serializeArray = function () {
812
+ var result = [];
813
+ this.each(function () {
814
+ if (this.tagName !== 'FORM') return;
815
+ var elements = this.elements ? Array.prototype.slice.call(this.elements) : [];
816
+ elements.forEach(function (field) {
817
+ if (!field.name || field.disabled) return;
818
+ var tag = field.tagName.toLowerCase();
819
+ var type = (field.type || tag).toLowerCase();
820
+ if (type === 'submit' || type === 'button' || type === 'reset' || type === 'fieldset') return;
821
+ if ((type === 'checkbox' || type === 'radio') && !field.checked) return;
822
+ if (type === 'file') {
823
+ var files = field.files ? Array.prototype.map.call(field.files, function (f) { return f.name; }) : [];
824
+ result.push({ name: field.name, value: files, type: type });
825
+ return;
826
+ }
827
+ if (tag === 'select' && field.multiple) {
828
+ Array.prototype.forEach.call(field.selectedOptions || [], function (opt) {
829
+ result.push({ name: field.name, value: opt.value, type: type });
830
+ });
831
+ return;
832
+ }
833
+ result.push({ name: field.name, value: field.value, type: type });
834
+ });
835
+ });
836
+ return result;
837
+ };
838
+ // ajaxForm(options): a deliberate SUBSET of real jQuery.form, scoped
839
+ // to exactly the one shape every real call site in this codebase
840
+ // actually uses — bind a submit interceptor, hand the real, live
841
+ // caller `options.beforeSubmit(formData, $form, options)`. Every real
842
+ // beforeSubmit in vendor/reconnecting-websocket.js unconditionally
843
+ // returns `false` at its end (it always does its own pushURL()-based
844
+ // navigation instead of a real AJAX submit) — so a real AJAX
845
+ // submission path (multipart encoding, XHR/iframe fallback for file
846
+ // uploads, success/error callbacks) is never actually reached in
847
+ // practice and is intentionally NOT implemented here. The native
848
+ // submit is always prevented; if a future beforeSubmit legitimately
849
+ // wants the real jQuery.form AJAX-submit behavior instead of
850
+ // cancelling, that's a real, separate feature to add then, not
851
+ // silently guessed at now.
852
+ $.fn.ajaxForm = function (options) {
853
+ options = options || {};
854
+ return this.each(function () {
855
+ var formEl = this;
856
+ var $form = $(formEl);
857
+ formEl.addEventListener('submit', function (ev) {
858
+ ev.preventDefault();
859
+ var formData = $form.serializeArray();
860
+ if (typeof options.beforeSubmit === 'function') {
861
+ options.beforeSubmit(formData, $form, options);
862
+ }
863
+ });
864
+ });
865
+ };
866
+
653
867
  global.$ = $;
654
868
  global.jQuery = $;
655
869
  })(typeof window !== 'undefined' ? window : globalThis);
@@ -928,8 +928,25 @@ $.fn.attach = function (type, selector, data, fn) {
928
928
  return this;
929
929
  };
930
930
 
931
+ // 2026-09-22, real, severe bug found and fixed: this redefinition
932
+ // OVERWROTE dom-shim.js's own correct $.fn.hasAttr (this file loads
933
+ // after dom-shim.js in the bundle) with a broken one — this.attr(k)
934
+ // (dom-shim's $.fn.attr) returns `null`, matching real getAttribute()
935
+ // semantics, for a genuinely absent attribute, never `undefined` (that
936
+ // only happens when there's no element at all). `null !== undefined` is
937
+ // always true, so this made hasAttr() return TRUE for essentially any
938
+ // attribute name on any real element, present or not — masked for
939
+ // `@`-prefixed names specifically by an unrelated coincidence (the
940
+ // getAttribute monkey-patch above returns real `undefined` for those),
941
+ // which is why @-event guards kept working while ~40 other real call
942
+ // sites across this file and lstnrs.js (stop/confirm/econfirm/reset/
943
+ // o-sub/b-sub/:required/n0-n9 nav-highlighting/data-into/...) did not.
944
+ // Found chasing applyTriggers() crashing on a real page — n9.hasAttr()
945
+ // returning true for an element that only has n1/n2 was the exact,
946
+ // confirmed repro. Matches dom-shim.js's own already-correct
947
+ // implementation now.
931
948
  $.fn.hasAttr = function (k) {
932
- return this.attr(k) !== undefined;
949
+ return !!(this[0] && this[0].getAttribute(k) != null);
933
950
  };
934
951
 
935
952
  $.fn.hasKey = function (k) {
@@ -1683,12 +1700,19 @@ function reloads() {
1683
1700
  : null;
1684
1701
  if (typeof tickFunc === "function") tickFunc();
1685
1702
 
1686
- scsc.reset();
1687
- dgsc.reset();
1703
+ // 2026-09-22: scsc/dgsc (scroll-scope/drag-scope reset helpers) are
1704
+ // referenced here but never defined anywhere in this codebase — real,
1705
+ // pre-existing V1 references to some scroll/drag-effect library that
1706
+ // was apparently never ported. Guarded rather than reproduced (out of
1707
+ // scope here) so this function's real, needed work — applyTriggers(),
1708
+ // the actual bind site for @scroll/@scroll-start/@scroll-end/etc. —
1709
+ // isn't blocked by an unrelated, longstanding gap.
1710
+ if (typeof scsc !== "undefined") scsc.reset();
1711
+ if (typeof dgsc !== "undefined") dgsc.reset();
1688
1712
  applyTriggers();
1689
1713
  setTimeout(() => {
1690
- scsc.reset();
1691
- dgsc.reset();
1714
+ if (typeof scsc !== "undefined") scsc.reset();
1715
+ if (typeof dgsc !== "undefined") dgsc.reset();
1692
1716
  applyTriggers();
1693
1717
  }, _tickTime * 2);
1694
1718
  }
@@ -2960,10 +2984,39 @@ _viewLoaded = false;
2960
2984
  function globalWatch() {
2961
2985
  if (!_initialized) return;
2962
2986
 
2963
-
2964
- return;
2965
-
2966
- $("[beajs=1]").remove();
2987
+ // 2026-09-22, real bug found and fixed: this function used to
2988
+ // unconditionally `return;` right here, making EVERYTHING below —
2989
+ // renderPlugins() (all of: form-binding/ajaxForm/o-sub/b-sub, [crsl]
2990
+ // carousel auto-init, [up] file-upload widget setup), loadPics()
2991
+ // ([lazy] image loading), and reloads() (which calls applyTriggers(),
2992
+ // the real bind site for @scroll/@scroll-start/@scroll-end/etc. event
2993
+ // listeners) — permanently dead code, never once executed by any real
2994
+ // V2 app. Found chasing a real user report ("form data is not sent to
2995
+ // the next view" on a plain o-sub form with no real error at all) —
2996
+ // traced to el.ajaxForm() throwing silently inside this dead branch,
2997
+ // which led here. The early return also disabled real, unrelated
2998
+ // functionality (scroll-triggered events, lazy image loading, live
2999
+ // carousel refresh) with no error anywhere, since dead code throws
3000
+ // nothing.
3001
+ //
3002
+ // The `[bind]:not(.binded)` block right below (V1's legacy per-element
3003
+ // data-binding convention, `setRe()`) stays intentionally skipped —
3004
+ // `bind=` is a confirmed-inert V1 authoring leftover in V2 (real
3005
+ // migrated content still carries bind="..." attributes on real
3006
+ // elements; V1's own setRe() binding mechanism was never designed to
3007
+ // coexist with V2's reactive Proxy system, so re-enabling it here
3008
+ // would be a real, separate, unreviewed behavior change, not a return
3009
+ // to "how it always worked"). Skipping it does not skip the real,
3010
+ // still-needed calls below — bindsCount staying 0 already makes the
3011
+ // `if (bindsCount == 0) prom.resolve();` line further down resolve the
3012
+ // promise chain that leads to them.
3013
+ // 2026-09-22: unquoted attribute selector — invalid CSS, throws a
3014
+ // SyntaxError from querySelectorAll (not just jQuery-specific; real
3015
+ // browsers reject an unquoted value starting with a digit). This was
3016
+ // masked for as long as the early `return;` above existed; fixing
3017
+ // that alone would have just traded one silent no-op for a crash
3018
+ // here without this.
3019
+ $('[beajs="1"]').remove();
2967
3020
  $('script[type="beajs"]').each(function () {
2968
3021
  var html = $(this).html();
2969
3022
  $(this).remove();
@@ -2974,20 +3027,25 @@ function globalWatch() {
2974
3027
  });
2975
3028
  let bindsCount = 0;
2976
3029
  let prom = defer();
2977
- $("[bind]:not(.binded)").each(function () {
2978
- bindsCount++;
2979
- let _el = $(this);
2980
- _el.addClass("binded");
2981
- if (!setRe(_el, _el.attr("bind")))
2982
- setError(
2983
- null,
2984
- "Error in binding for the element that has these in its bind attribute " +
2985
- _el.attr("bind")
2986
- );
2987
- });
2988
3030
  prom
2989
3031
  .then(function (val) {
2990
- renderViewsTpls();
3032
+ // 2026-09-22: renderViewsTpls() deliberately NOT re-enabled
3033
+ // here — real, confirmed regression found testing this fix:
3034
+ // [view] attributes DO survive into real rendered DOM
3035
+ // (verified directly; an earlier session note claiming they
3036
+ // never do was true for a different, narrower case, not
3037
+ // universally), and this function's own V1-era "_status"
3038
+ // dedup (el.data("_status")) doesn't reliably stop it from
3039
+ // re-triggering renderView() on the same element once a
3040
+ // PARENT view has re-rendered and produced a fresh, dataset-
3041
+ // less [view] element — causing a real, observed render
3042
+ // cascade (repeated "Rendering ..." log spam) once
3043
+ // globalWatch() actually started running. V2's own subview
3044
+ // mount path (renderView()'s isSub branch, _re.js) already
3045
+ // handles every real view="..." mount correctly and is the
3046
+ // one this whole codebase actually relies on — this function
3047
+ // is legacy V1 plumbing for a mounting mechanism V2 replaced,
3048
+ // same category as the [bind] loop already skipped above.
2991
3049
  renderPlugins();
2992
3050
  loadPics();
2993
3051
  reloads();
@@ -3000,7 +3058,6 @@ function globalWatch() {
3000
3058
  if (typeof tickFunc === "function") tickFunc();
3001
3059
  })
3002
3060
  .catch((reason) => {
3003
- renderViewsTpls();
3004
3061
  renderPlugins();
3005
3062
  loadPics();
3006
3063
  reloads();
@@ -3491,9 +3548,25 @@ let _cookies = {
3491
3548
  document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
3492
3549
  return true;
3493
3550
  },
3551
+ // 2026-09-22, real bug found and fixed: removeItem("key") (the
3552
+ // documented, real usage shape — see lumenjs-spec.md's own example,
3553
+ // no explicit sPath) silently never deleted anything. setItem()
3554
+ // always defaults a missing sPath to "/" before writing the cookie,
3555
+ // but removeItem() left a missing sPath out of the expiring cookie
3556
+ // string entirely — the browser then scopes that expiring write to
3557
+ // the CURRENT page's own path (real cookie-scoping rules: cookies
3558
+ // with a different `path` are entirely separate cookies), which
3559
+ // never matches the real cookie's actual `path=/` unless the caller
3560
+ // happens to be on the site's root page. The expiring write silently
3561
+ // creates and immediately discards an unrelated cookie while the
3562
+ // real one survives untouched — confirmed directly: document.cookie
3563
+ // still contained the real cookie after a real removeItem() call.
3564
+ // Defaulting sPath the same way setItem() does closes this for the
3565
+ // real, common no-path call shape.
3494
3566
  removeItem: function (sKey, sPath, sDomain) {
3495
3567
  if (!this.hasItem(sKey)) { return false; }
3496
- document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
3568
+ if (!sPath) sPath = "/";
3569
+ document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + "; path=" + sPath;
3497
3570
  return true;
3498
3571
  },
3499
3572
  hasItem: function (sKey) {