marko 6.3.18 → 6.3.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.
package/dist/debug/dom.js CHANGED
@@ -1110,7 +1110,7 @@ function _attr_select_value_script(scope, nodeAccessor) {
1110
1110
  syncControllableFormInput(el, hasSelectChanged, onChange);
1111
1111
  new MutationObserver(() => {
1112
1112
  const value = scope["ControlledValue:" + nodeAccessor];
1113
- if (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value, i) => value != el.selectedOptions[i].value) : el.value !== value) onChange();
1113
+ if (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((_, i) => !value.includes(el.selectedOptions[i].value)) : el.value !== value) onChange();
1114
1114
  }).observe(el, {
1115
1115
  childList: true,
1116
1116
  subtree: true
@@ -1108,7 +1108,7 @@ function _attr_select_value_script(scope, nodeAccessor) {
1108
1108
  syncControllableFormInput(el, hasSelectChanged, onChange);
1109
1109
  new MutationObserver(() => {
1110
1110
  const value = scope["ControlledValue:" + nodeAccessor];
1111
- if (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value, i) => value != el.selectedOptions[i].value) : el.value !== value) onChange();
1111
+ if (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((_, i) => !value.includes(el.selectedOptions[i].value)) : el.value !== value) onChange();
1112
1112
  }).observe(el, {
1113
1113
  childList: true,
1114
1114
  subtree: true
@@ -3171,6 +3171,10 @@ function addAsset(g, id, triggers) {
3171
3171
  id,
3172
3172
  triggers
3173
3173
  });
3174
+ else {
3175
+ const existing = assets.find((a) => a.id === id);
3176
+ if (JSON.stringify(existing.triggers) !== JSON.stringify(triggers)) console.error(`The lazy asset "${id}" is imported with different \`load\` triggers; an asset must use one consistent trigger.`);
3177
+ }
3174
3178
  }
3175
3179
  function writeTriggerScript(html, triggers) {
3176
3180
  const htmlStr = _escape_script(JSON.stringify(html));
@@ -3260,7 +3264,7 @@ const compat = {
3260
3264
  render(renderer, willRerender, classAPIOut, component, input, completeChunks, registerChildScope) {
3261
3265
  const state = this.ensureState(classAPIOut.global);
3262
3266
  const boundary = new Boundary(state);
3263
- let head = new Chunk(boundary, null, null, state);
3267
+ let head = new Chunk(boundary, null, getChunk()?.context ?? null, state);
3264
3268
  let normalizedInput = input;
3265
3269
  if ("renderBody" in input) {
3266
3270
  normalizedInput = {};
@@ -3169,6 +3169,10 @@ function addAsset(g, id, triggers) {
3169
3169
  id,
3170
3170
  triggers
3171
3171
  });
3172
+ else {
3173
+ const existing = assets.find((a) => a.id === id);
3174
+ if (JSON.stringify(existing.triggers) !== JSON.stringify(triggers)) console.error(`The lazy asset "${id}" is imported with different \`load\` triggers; an asset must use one consistent trigger.`);
3175
+ }
3172
3176
  }
3173
3177
  function writeTriggerScript(html, triggers) {
3174
3178
  const htmlStr = _escape_script(JSON.stringify(html));
@@ -3258,7 +3262,7 @@ const compat = {
3258
3262
  render(renderer, willRerender, classAPIOut, component, input, completeChunks, registerChildScope) {
3259
3263
  const state = this.ensureState(classAPIOut.global);
3260
3264
  const boundary = new Boundary(state);
3261
- let head = new Chunk(boundary, null, null, state);
3265
+ let head = new Chunk(boundary, null, getChunk()?.context ?? null, state);
3262
3266
  let normalizedInput = input;
3263
3267
  if ("renderBody" in input) {
3264
3268
  normalizedInput = {};
package/dist/dom.js CHANGED
@@ -694,7 +694,7 @@ function _attr_select_value_script(scope, nodeAccessor) {
694
694
  }
695
695
  syncControllableFormInput(el, hasSelectChanged, onChange), new MutationObserver(() => {
696
696
  let value = scope["G" + nodeAccessor];
697
- (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value, i) => value != el.selectedOptions[i].value) : el.value !== value) && onChange();
697
+ (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((_, i) => !value.includes(el.selectedOptions[i].value)) : el.value !== value) && onChange();
698
698
  }).observe(el, {
699
699
  childList: !0,
700
700
  subtree: !0
package/dist/dom.mjs CHANGED
@@ -693,7 +693,7 @@ function _attr_select_value_script(scope, nodeAccessor) {
693
693
  }
694
694
  syncControllableFormInput(el, hasSelectChanged, onChange), new MutationObserver(() => {
695
695
  let value = scope["G" + nodeAccessor];
696
- (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value, i) => value != el.selectedOptions[i].value) : el.value !== value) && onChange();
696
+ (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((_, i) => !value.includes(el.selectedOptions[i].value)) : el.value !== value) && onChange();
697
697
  }).observe(el, {
698
698
  childList: !0,
699
699
  subtree: !0
package/dist/html.js CHANGED
@@ -332,7 +332,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
332
332
  return new Chunk(boundary, null, null, state).flushScript().scripts;
333
333
  },
334
334
  render(renderer, willRerender, classAPIOut, component, input, completeChunks, registerChildScope) {
335
- let state = this.ensureState(classAPIOut.global), boundary = new Boundary(state), head = new Chunk(boundary, null, null, state), normalizedInput = input;
335
+ let state = this.ensureState(classAPIOut.global), boundary = new Boundary(state), head = new Chunk(boundary, null, getChunk()?.context ?? null, state), normalizedInput = input;
336
336
  if ("renderBody" in input) {
337
337
  normalizedInput = {};
338
338
  for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
package/dist/html.mjs CHANGED
@@ -332,7 +332,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
332
332
  return new Chunk(boundary, null, null, state).flushScript().scripts;
333
333
  },
334
334
  render(renderer, willRerender, classAPIOut, component, input, completeChunks, registerChildScope) {
335
- let state = this.ensureState(classAPIOut.global), boundary = new Boundary(state), head = new Chunk(boundary, null, null, state), normalizedInput = input;
335
+ let state = this.ensureState(classAPIOut.global), boundary = new Boundary(state), head = new Chunk(boundary, null, getChunk()?.context ?? null, state), normalizedInput = input;
336
336
  if ("renderBody" in input) {
337
337
  normalizedInput = {};
338
338
  for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
@@ -7377,7 +7377,12 @@ function addBindingGetter(binding, { invoked, hoisted }) {
7377
7377
  }
7378
7378
  }
7379
7379
  function isLazyRead(expr, read, binding, isChangeHandlerRead) {
7380
- return !!(expr.invokeOnly && read.deferred && !isChangeHandlerRead && !binding.upstreamAlias && binding.type !== 0 && binding.type !== 6 && (binding.type !== 4 || binding.section === expr.section));
7380
+ return !!(expr.invokeOnly && read.deferred && !isChangeHandlerRead && (!binding.upstreamAlias || isParamBinding(binding)) && binding.type !== 0 && binding.type !== 6 && (binding.type !== 4 || binding.section === expr.section));
7381
+ }
7382
+ function isParamBinding(binding) {
7383
+ let root = binding;
7384
+ while (root.upstreamAlias) root = root.upstreamAlias;
7385
+ return root === root.section.params;
7381
7386
  }
7382
7387
  function resolveReferencedBindings(expr, reads, intersectionsBySection) {
7383
7388
  let referencedBindings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.3.18",
3
+ "version": "6.3.20",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -54,8 +54,8 @@
54
54
  "magic-string": "^0.30.21"
55
55
  },
56
56
  "devDependencies": {
57
- "@marko/runtime-tags": "npm:marko@6.3.18",
58
- "marko": "5.39.26"
57
+ "@marko/runtime-tags": "npm:marko@6.3.20",
58
+ "marko": "5.39.27"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=22"