marko 6.0.47 → 6.0.49

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
@@ -256,11 +256,6 @@ function enableBranches() {
256
256
  }
257
257
  function init(runtimeId = DEFAULT_RUNTIME_ID) {
258
258
  if (true) {
259
- if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
260
- throw new Error(
261
- `Invalid runtimeId: "${runtimeId}". The runtimeId must be a valid JavaScript identifier.`
262
- );
263
- }
264
259
  const descriptor = Object.getOwnPropertyDescriptor(self, runtimeId);
265
260
  if (descriptor && (descriptor.set || descriptor.configurable === false)) {
266
261
  throw new Error(
@@ -1362,15 +1357,13 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1362
1357
  case "style":
1363
1358
  styleAttr(el, value2);
1364
1359
  break;
1365
- case "content": {
1366
- break;
1367
- }
1368
1360
  default: {
1369
1361
  if (isEventHandler(name)) {
1370
1362
  (events ||= scope["EventAttributes:" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2;
1371
- } else if (!skip?.test(name)) {
1363
+ } else if (!(skip?.test(name) || name === "content" && el.tagName !== "META")) {
1372
1364
  attr(el, name, value2);
1373
1365
  }
1366
+ break;
1374
1367
  }
1375
1368
  }
1376
1369
  }
@@ -2318,6 +2311,18 @@ function mount(input = {}, reference, position) {
2318
2311
  renderId: DEFAULT_RENDER_ID,
2319
2312
  ...$global
2320
2313
  };
2314
+ if (true) {
2315
+ if (!String($global.runtimeId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2316
+ throw new Error(
2317
+ `Invalid runtimeId: "${$global.runtimeId}". The runtimeId must be a valid JavaScript identifier.`
2318
+ );
2319
+ }
2320
+ if (!String($global.renderId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2321
+ throw new Error(
2322
+ `Invalid renderId: "${$global.renderId}". The renderId must be a valid JavaScript identifier.`
2323
+ );
2324
+ }
2325
+ }
2321
2326
  } else {
2322
2327
  $global = {
2323
2328
  ___nextScopeId: 0,
@@ -160,11 +160,6 @@ function enableBranches() {
160
160
  }
161
161
  function init(runtimeId = DEFAULT_RUNTIME_ID) {
162
162
  if (true) {
163
- if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
164
- throw new Error(
165
- `Invalid runtimeId: "${runtimeId}". The runtimeId must be a valid JavaScript identifier.`
166
- );
167
- }
168
163
  const descriptor = Object.getOwnPropertyDescriptor(self, runtimeId);
169
164
  if (descriptor && (descriptor.set || descriptor.configurable === false)) {
170
165
  throw new Error(
@@ -1266,15 +1261,13 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1266
1261
  case "style":
1267
1262
  styleAttr(el, value2);
1268
1263
  break;
1269
- case "content": {
1270
- break;
1271
- }
1272
1264
  default: {
1273
1265
  if (isEventHandler(name)) {
1274
1266
  (events ||= scope["EventAttributes:" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2;
1275
- } else if (!skip?.test(name)) {
1267
+ } else if (!(skip?.test(name) || name === "content" && el.tagName !== "META")) {
1276
1268
  attr(el, name, value2);
1277
1269
  }
1270
+ break;
1278
1271
  }
1279
1272
  }
1280
1273
  }
@@ -2222,6 +2215,18 @@ function mount(input = {}, reference, position) {
2222
2215
  renderId: DEFAULT_RENDER_ID,
2223
2216
  ...$global
2224
2217
  };
2218
+ if (true) {
2219
+ if (!String($global.runtimeId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2220
+ throw new Error(
2221
+ `Invalid runtimeId: "${$global.runtimeId}". The runtimeId must be a valid JavaScript identifier.`
2222
+ );
2223
+ }
2224
+ if (!String($global.renderId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2225
+ throw new Error(
2226
+ `Invalid renderId: "${$global.renderId}". The renderId must be a valid JavaScript identifier.`
2227
+ );
2228
+ }
2229
+ }
2225
2230
  } else {
2226
2231
  $global = {
2227
2232
  ___nextScopeId: 0,
@@ -2776,11 +2776,8 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
2776
2776
  case "style":
2777
2777
  result += styleAttr(value);
2778
2778
  break;
2779
- case "":
2780
- case "content":
2781
- break;
2782
2779
  default:
2783
- if (!isVoid(value)) {
2780
+ if (name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta")) {
2784
2781
  if (isEventHandler(name)) {
2785
2782
  if (!events) {
2786
2783
  events = {};
@@ -2789,7 +2786,7 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
2789
2786
  });
2790
2787
  }
2791
2788
  events[getEventHandlerName(name)] = value;
2792
- } else if (!skip.test(name)) {
2789
+ } else {
2793
2790
  result += nonVoidAttr(name, value);
2794
2791
  }
2795
2792
  }
@@ -2899,6 +2896,18 @@ function render(input = {}) {
2899
2896
  renderId: DEFAULT_RENDER_ID,
2900
2897
  ...$global2
2901
2898
  };
2899
+ if (true) {
2900
+ if (!String($global2.runtimeId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2901
+ throw new Error(
2902
+ `Invalid runtimeId: "${$global2.runtimeId}". The runtimeId must be a valid JavaScript identifier.`
2903
+ );
2904
+ }
2905
+ if (!String($global2.renderId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2906
+ throw new Error(
2907
+ `Invalid renderId: "${$global2.renderId}". The renderId must be a valid JavaScript identifier.`
2908
+ );
2909
+ }
2910
+ }
2902
2911
  } else {
2903
2912
  $global2 = { runtimeId: DEFAULT_RUNTIME_ID, renderId: DEFAULT_RENDER_ID };
2904
2913
  }
@@ -3243,14 +3252,14 @@ var compat = {
3243
3252
  write,
3244
3253
  writeScript,
3245
3254
  nextScopeId,
3255
+ peekNextScopeId,
3246
3256
  isTagsAPI(fn) {
3247
3257
  return !!fn.___id;
3248
3258
  },
3249
3259
  patchDynamicTag,
3250
- writeSetScopeForComponent(m5c) {
3251
- const scopeId = nextScopeId();
3252
- writeScope(scopeId, { m5c });
3253
- writeEffect(scopeId, SET_SCOPE_REGISTER_ID);
3260
+ writeSetScopeForComponent(branchId, m5c) {
3261
+ writeScope(branchId, { m5c });
3262
+ writeEffect(branchId, SET_SCOPE_REGISTER_ID);
3254
3263
  },
3255
3264
  toJSON() {
3256
3265
  let compatRegistered = COMPAT_REGISTRY.get(this);
@@ -3311,7 +3320,9 @@ var compat = {
3311
3320
  const { scripts, html } = head.consume().flushScript();
3312
3321
  asyncOut.script(scripts);
3313
3322
  asyncOut.write(html);
3314
- asyncOut.end();
3323
+ if (boundary.done) {
3324
+ asyncOut.end();
3325
+ }
3315
3326
  }
3316
3327
  }
3317
3328
  );
@@ -2692,11 +2692,8 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
2692
2692
  case "style":
2693
2693
  result += styleAttr(value);
2694
2694
  break;
2695
- case "":
2696
- case "content":
2697
- break;
2698
2695
  default:
2699
- if (!isVoid(value)) {
2696
+ if (name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta")) {
2700
2697
  if (isEventHandler(name)) {
2701
2698
  if (!events) {
2702
2699
  events = {};
@@ -2705,7 +2702,7 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
2705
2702
  });
2706
2703
  }
2707
2704
  events[getEventHandlerName(name)] = value;
2708
- } else if (!skip.test(name)) {
2705
+ } else {
2709
2706
  result += nonVoidAttr(name, value);
2710
2707
  }
2711
2708
  }
@@ -2815,6 +2812,18 @@ function render(input = {}) {
2815
2812
  renderId: DEFAULT_RENDER_ID,
2816
2813
  ...$global2
2817
2814
  };
2815
+ if (true) {
2816
+ if (!String($global2.runtimeId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2817
+ throw new Error(
2818
+ `Invalid runtimeId: "${$global2.runtimeId}". The runtimeId must be a valid JavaScript identifier.`
2819
+ );
2820
+ }
2821
+ if (!String($global2.renderId).match(/^[_$a-z][_$a-z0-9]*$/i)) {
2822
+ throw new Error(
2823
+ `Invalid renderId: "${$global2.renderId}". The renderId must be a valid JavaScript identifier.`
2824
+ );
2825
+ }
2826
+ }
2818
2827
  } else {
2819
2828
  $global2 = { runtimeId: DEFAULT_RUNTIME_ID, renderId: DEFAULT_RENDER_ID };
2820
2829
  }
@@ -3159,14 +3168,14 @@ var compat = {
3159
3168
  write,
3160
3169
  writeScript,
3161
3170
  nextScopeId,
3171
+ peekNextScopeId,
3162
3172
  isTagsAPI(fn) {
3163
3173
  return !!fn.___id;
3164
3174
  },
3165
3175
  patchDynamicTag,
3166
- writeSetScopeForComponent(m5c) {
3167
- const scopeId = nextScopeId();
3168
- writeScope(scopeId, { m5c });
3169
- writeEffect(scopeId, SET_SCOPE_REGISTER_ID);
3176
+ writeSetScopeForComponent(branchId, m5c) {
3177
+ writeScope(branchId, { m5c });
3178
+ writeEffect(branchId, SET_SCOPE_REGISTER_ID);
3170
3179
  },
3171
3180
  toJSON() {
3172
3181
  let compatRegistered = COMPAT_REGISTRY.get(this);
@@ -3227,7 +3236,9 @@ var compat = {
3227
3236
  const { scripts, html } = head.consume().flushScript();
3228
3237
  asyncOut.script(scripts);
3229
3238
  asyncOut.write(html);
3230
- asyncOut.end();
3239
+ if (boundary.done) {
3240
+ asyncOut.end();
3241
+ }
3231
3242
  }
3232
3243
  }
3233
3244
  );
package/dist/dom.js CHANGED
@@ -915,10 +915,10 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
915
915
  case "style":
916
916
  styleAttr(el, value2);
917
917
  break;
918
- case "content":
918
+ default: {
919
+ isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || name === "content" && el.tagName !== "META" || attr(el, name, value2);
919
920
  break;
920
- default:
921
- isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || attr(el, name, value2);
921
+ }
922
922
  }
923
923
  }
924
924
  }
package/dist/dom.mjs CHANGED
@@ -822,10 +822,10 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
822
822
  case "style":
823
823
  styleAttr(el, value2);
824
824
  break;
825
- case "content":
825
+ default: {
826
+ isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || name === "content" && el.tagName !== "META" || attr(el, name, value2);
826
827
  break;
827
- default:
828
- isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || attr(el, name, value2);
828
+ }
829
829
  }
830
830
  }
831
831
  }
@@ -1,15 +1,16 @@
1
1
  import { patchDynamicTag } from "./dynamic-tag";
2
2
  import { type ServerRenderer } from "./template";
3
- import { $global, fork, nextScopeId, write, writeScript } from "./writer";
3
+ import { $global, fork, nextScopeId, peekNextScopeId, write, writeScript } from "./writer";
4
4
  export declare const compat: {
5
5
  $global: typeof $global;
6
6
  fork: typeof fork;
7
7
  write: typeof write;
8
8
  writeScript: typeof writeScript;
9
9
  nextScopeId: typeof nextScopeId;
10
+ peekNextScopeId: typeof peekNextScopeId;
10
11
  isTagsAPI(fn: any): boolean;
11
12
  patchDynamicTag: typeof patchDynamicTag;
12
- writeSetScopeForComponent(m5c: string): void;
13
+ writeSetScopeForComponent(branchId: number, m5c: string): void;
13
14
  toJSON(this: WeakKey): [registryId: string, scopeId: unknown] | undefined;
14
15
  render(renderer: ServerRenderer, willRerender: boolean, classAPIOut: any, component: any, input: any): void;
15
16
  registerRenderer(renderer: any, id: string): any;
package/dist/html.js CHANGED
@@ -1778,13 +1778,10 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
1778
1778
  case "style":
1779
1779
  result += styleAttr(value);
1780
1780
  break;
1781
- case "":
1782
- case "content":
1783
- break;
1784
1781
  default:
1785
- isVoid(value) || (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
1782
+ name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta") && (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
1786
1783
  ["i" /* EventAttributes */ + nodeAccessor]: events
1787
- })), events[getEventHandlerName(name)] = value) : skip.test(name) || (result += nonVoidAttr(name, value)));
1784
+ })), events[getEventHandlerName(name)] = value) : result += nonVoidAttr(name, value));
1788
1785
  break;
1789
1786
  }
1790
1787
  }
@@ -2088,13 +2085,13 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2088
2085
  write,
2089
2086
  writeScript,
2090
2087
  nextScopeId,
2088
+ peekNextScopeId,
2091
2089
  isTagsAPI(fn) {
2092
2090
  return !!fn.h;
2093
2091
  },
2094
2092
  patchDynamicTag,
2095
- writeSetScopeForComponent(m5c) {
2096
- let scopeId = nextScopeId();
2097
- writeScope(scopeId, { m5c }), writeEffect(scopeId, SET_SCOPE_REGISTER_ID);
2093
+ writeSetScopeForComponent(branchId, m5c) {
2094
+ writeScope(branchId, { m5c }), writeEffect(branchId, SET_SCOPE_REGISTER_ID);
2098
2095
  },
2099
2096
  toJSON() {
2100
2097
  let compatRegistered = COMPAT_REGISTRY.get(this);
@@ -2137,7 +2134,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2137
2134
  asyncOut.error(boundary.signal.reason);
2138
2135
  else if (boundary.done) {
2139
2136
  let { scripts, html } = head.consume().flushScript();
2140
- asyncOut.script(scripts), asyncOut.write(html), asyncOut.end();
2137
+ asyncOut.script(scripts), asyncOut.write(html), boundary.done && asyncOut.end();
2141
2138
  }
2142
2139
  }
2143
2140
  );
package/dist/html.mjs CHANGED
@@ -1697,13 +1697,10 @@ function attrs(data, nodeAccessor, scopeId, tagName) {
1697
1697
  case "style":
1698
1698
  result += styleAttr(value);
1699
1699
  break;
1700
- case "":
1701
- case "content":
1702
- break;
1703
1700
  default:
1704
- isVoid(value) || (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
1701
+ name && !(isVoid(value) || skip.test(name) || name === "content" && tagName !== "meta") && (isEventHandler(name) ? (events || (events = {}, writeScope(scopeId, {
1705
1702
  ["i" /* EventAttributes */ + nodeAccessor]: events
1706
- })), events[getEventHandlerName(name)] = value) : skip.test(name) || (result += nonVoidAttr(name, value)));
1703
+ })), events[getEventHandlerName(name)] = value) : result += nonVoidAttr(name, value));
1707
1704
  break;
1708
1705
  }
1709
1706
  }
@@ -2007,13 +2004,13 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2007
2004
  write,
2008
2005
  writeScript,
2009
2006
  nextScopeId,
2007
+ peekNextScopeId,
2010
2008
  isTagsAPI(fn) {
2011
2009
  return !!fn.h;
2012
2010
  },
2013
2011
  patchDynamicTag,
2014
- writeSetScopeForComponent(m5c) {
2015
- let scopeId = nextScopeId();
2016
- writeScope(scopeId, { m5c }), writeEffect(scopeId, SET_SCOPE_REGISTER_ID);
2012
+ writeSetScopeForComponent(branchId, m5c) {
2013
+ writeScope(branchId, { m5c }), writeEffect(branchId, SET_SCOPE_REGISTER_ID);
2017
2014
  },
2018
2015
  toJSON() {
2019
2016
  let compatRegistered = COMPAT_REGISTRY.get(this);
@@ -2056,7 +2053,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
2056
2053
  asyncOut.error(boundary.signal.reason);
2057
2054
  else if (boundary.done) {
2058
2055
  let { scripts, html } = head.consume().flushScript();
2059
- asyncOut.script(scripts), asyncOut.write(html), asyncOut.end();
2056
+ asyncOut.script(scripts), asyncOut.write(html), boundary.done && asyncOut.end();
2060
2057
  }
2061
2058
  }
2062
2059
  );