marko 4.28.7 → 4.28.9

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 (73) hide show
  1. package/dist/core-tags/core/await/renderer.js +15 -4
  2. package/dist/core-tags/core/await/reorderer-renderer.js +39 -13
  3. package/dist/node_modules/@internal/components-beginComponent/index-browser.js +5 -5
  4. package/dist/node_modules/@internal/components-beginComponent/index.js +12 -12
  5. package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +43 -43
  6. package/dist/node_modules/@internal/components-define-widget-legacy/index.js +3 -3
  7. package/dist/node_modules/@internal/components-endComponent/index.js +3 -3
  8. package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
  9. package/dist/node_modules/@internal/components-entry/index.js +21 -21
  10. package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +6 -6
  11. package/dist/node_modules/@internal/components-entry-legacy/index.js +1 -1
  12. package/dist/node_modules/@internal/components-registry/index-browser.js +40 -40
  13. package/dist/node_modules/@internal/components-registry/index.js +2 -2
  14. package/dist/node_modules/@internal/components-util/index-browser.js +20 -20
  15. package/dist/node_modules/@internal/components-util/index.js +9 -9
  16. package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
  17. package/dist/node_modules/@internal/create-readable/index.js +8 -8
  18. package/dist/node_modules/@internal/init-components-tag/index.js +4 -4
  19. package/dist/node_modules/@internal/preserve-tag/index-browser.js +8 -8
  20. package/dist/node_modules/@internal/preserve-tag/index.js +5 -5
  21. package/dist/node_modules/@internal/set-immediate/index-browser.js +1 -1
  22. package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -2
  23. package/dist/node_modules/@internal/set-immediate/index.js +2 -2
  24. package/dist/runtime/RenderResult.js +13 -13
  25. package/dist/runtime/components/Component.js +144 -144
  26. package/dist/runtime/components/ComponentDef.js +27 -27
  27. package/dist/runtime/components/ComponentsContext.js +19 -19
  28. package/dist/runtime/components/GlobalComponentsContext.js +4 -4
  29. package/dist/runtime/components/KeySequence.js +3 -3
  30. package/dist/runtime/components/ServerComponent.js +13 -13
  31. package/dist/runtime/components/State.js +26 -26
  32. package/dist/runtime/components/attach-detach.js +8 -8
  33. package/dist/runtime/components/defineComponent.js +5 -5
  34. package/dist/runtime/components/dom-data.js +4 -4
  35. package/dist/runtime/components/event-delegation.js +10 -10
  36. package/dist/runtime/components/legacy/defineComponent-legacy.js +1 -1
  37. package/dist/runtime/components/legacy/defineRenderer-legacy.js +16 -16
  38. package/dist/runtime/components/legacy/dependencies/index.js +9 -9
  39. package/dist/runtime/components/legacy/helper-getWidgetFromOut.js +3 -3
  40. package/dist/runtime/components/legacy/renderer-legacy.js +39 -39
  41. package/dist/runtime/components/renderer.js +34 -34
  42. package/dist/runtime/components/update-manager.js +10 -10
  43. package/dist/runtime/createOut.js +1 -1
  44. package/dist/runtime/dom-insert.js +5 -5
  45. package/dist/runtime/helpers/_change-case.js +2 -2
  46. package/dist/runtime/helpers/dynamic-tag.js +13 -13
  47. package/dist/runtime/helpers/style-value.js +1 -1
  48. package/dist/runtime/html/AsyncStream.js +24 -24
  49. package/dist/runtime/html/BufferedWriter.js +2 -2
  50. package/dist/runtime/html/StringWriter.js +1 -1
  51. package/dist/runtime/html/helpers/data-marko.js +2 -2
  52. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  53. package/dist/runtime/html/index.js +1 -1
  54. package/dist/runtime/renderable.js +5 -5
  55. package/dist/runtime/vdom/AsyncVDOMBuilder.js +43 -43
  56. package/dist/runtime/vdom/VComponent.js +2 -2
  57. package/dist/runtime/vdom/VDocumentFragment.js +1 -1
  58. package/dist/runtime/vdom/VElement.js +12 -12
  59. package/dist/runtime/vdom/VFragment.js +4 -4
  60. package/dist/runtime/vdom/VNode.js +2 -2
  61. package/dist/runtime/vdom/index.js +1 -1
  62. package/dist/runtime/vdom/morphdom/fragment.js +2 -2
  63. package/dist/runtime/vdom/morphdom/helpers.js +3 -3
  64. package/dist/runtime/vdom/morphdom/index.js +43 -43
  65. package/package.json +1 -1
  66. package/src/compiler/Normalizer.js +4 -1
  67. package/src/compiler/ast/CustomTag.js +4 -2
  68. package/src/core-tags/components/TransformHelper/convertToComponent.js +1 -1
  69. package/src/core-tags/core/await/renderer.js +18 -4
  70. package/src/core-tags/core/await/reorderer-renderer.js +82 -48
  71. package/src/core-tags/migrate/all-tags/widget-in-attrs.js +9 -7
  72. package/src/runtime/components/legacy/index.js +3 -1
  73. package/src/runtime/helpers/interop-require.js +1 -1
@@ -87,15 +87,20 @@ module.exports = function awaitTag(input, out) {
87
87
  };
88
88
 
89
89
  if (clientReorder) {
90
+ awaitInfo.parent = out;
90
91
  awaitInfo.after = input.showAfter;
91
92
 
92
93
  clientReorderContext = out.global.n_ || (out.global.n_ = {
94
+ handleAwait: undefined,
93
95
  instances: [],
94
96
  nextId: 0
95
97
  });
96
98
 
97
- var id = awaitInfo.id = input.name || clientReorderContext.nextId++;
98
- var placeholderIdAttrValue = "afph" + id;
99
+ /** SHOULD MATCH THE reorder-renderer.js IMPLEMENTATION */
100
+ var reorderFunctionId = out.global.runtimeId !== "M" ? "af" + out.global.runtimeId : "af";
101
+
102
+ var id = awaitInfo.id = input.name || (out.global.componentIdPrefix || 0) + clientReorderContext.nextId++;
103
+ var placeholderIdAttrValue = reorderFunctionId + "ph" + id;
99
104
 
100
105
  if (placeholderRenderer) {
101
106
  out.write('<span id="' + placeholderIdAttrValue + '">');
@@ -129,7 +134,9 @@ module.exports = function awaitTag(input, out) {
129
134
  oldEmit.apply(asyncOut, arguments);
130
135
  };
131
136
 
132
- if (clientReorderContext.instances) {
137
+ if (clientReorderContext.handleAwait) {
138
+ clientReorderContext.handleAwait(awaitInfo);
139
+ } else {
133
140
  clientReorderContext.instances.push(awaitInfo);
134
141
  }
135
142
 
@@ -199,7 +206,11 @@ function renderContents(err, data, input, out) {
199
206
  if (err) {
200
207
  if (input.catch) {
201
208
  if (errorRenderer) {
202
- errorRenderer(out, err);
209
+ try {
210
+ errorRenderer(out, err);
211
+ } catch (err2) {
212
+ out.error(err2);
213
+ }
203
214
  }
204
215
  } else {
205
216
  out.error(err);
@@ -23,6 +23,9 @@ module.exports = function (input, out) {
23
23
  out.flush();
24
24
  }
25
25
 
26
+ /** SHOULD MATCH THE renderer.js IMPLEMENTATION */
27
+ var reorderFunctionId = out.global.runtimeId !== "M" ? "af" + out.global.runtimeId : "af";
28
+
26
29
  var asyncOut = out.beginAsync({
27
30
  last: true,
28
31
  timeout: -1,
@@ -41,20 +44,46 @@ module.exports = function (input, out) {
41
44
  }
42
45
 
43
46
  function handleAwait(awaitInfo) {
44
- awaitInfo.out.on("p_", out.emit.bind(out, "p_")).on("finish", function (result) {
47
+ let flushedScript = false;
48
+ let flushedContent = false;
49
+ let flushedPlaceholder = awaitInfo.parent._state.finished;
50
+ if (flushedPlaceholder) {
51
+ if (awaitInfo.out._state.finished) {
52
+ writeResult(awaitInfo.out.p_());
53
+ return;
54
+ }
55
+ } else {
56
+ awaitInfo.parent.on("q_", () => {
57
+ flushedPlaceholder = true;
58
+ if (!flushedScript && flushedContent) {
59
+ flushedScript = true;
60
+ asyncOut.script(`$${reorderFunctionId}(` + (typeof awaitInfo.id === "number" ? awaitInfo.id : '"' + awaitInfo.id + '"') + (awaitInfo.after ? ',"' + awaitInfo.after + '"' : "") + ")");
61
+ }
62
+ });
63
+ }
64
+
65
+ awaitInfo.out.on("q_", out.emit.bind(out, "q_")).on("finish", writeResult).on("error", function (err) {
66
+ asyncOut.error(err);
67
+ });
68
+
69
+ function writeResult(result) {
70
+ flushedContent = true;
45
71
  if (!global._afRuntime) {
46
72
  // Minified version of ./client-reorder-runtime.js
47
- asyncOut.script(`function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}}`);
73
+ asyncOut.script(`function $${reorderFunctionId}(d,a,e,l,g,h,k,b,f,c){c=$${reorderFunctionId};if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("${reorderFunctionId}"+d);g=e.getElementById("${reorderFunctionId}ph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}}`);
48
74
  global._afRuntime = true;
49
75
  }
50
76
 
51
77
  if (global.cspNonce) {
52
- asyncOut.write('<style nonce="' + escapeDoubleQuotes(global.cspNonce) + '">' + "#af" + awaitInfo.id + "{display:none;}" + "</style>" + '<div id="af' + awaitInfo.id + '">' + result.toString() + "</div>");
78
+ asyncOut.write('<style nonce="' + escapeDoubleQuotes(global.cspNonce) + '">' + `#${reorderFunctionId}` + awaitInfo.id + "{display:none;}" + "</style>" + `<div id="${reorderFunctionId}` + awaitInfo.id + '">' + result.toString() + "</div>");
53
79
  } else {
54
- asyncOut.write('<div id="af' + awaitInfo.id + '" style="display:none">' + result.toString() + "</div>");
80
+ asyncOut.write(`<div id="${reorderFunctionId}` + awaitInfo.id + '" style="display:none">' + result.toString() + "</div>");
55
81
  }
56
82
 
57
- asyncOut.script("$af(" + (typeof awaitInfo.id === "number" ? awaitInfo.id : '"' + awaitInfo.id + '"') + (awaitInfo.after ? ',"' + awaitInfo.after + '"' : "") + ")");
83
+ if (!flushedScript && flushedPlaceholder) {
84
+ flushedScript = true;
85
+ asyncOut.script(`$${reorderFunctionId}(` + (typeof awaitInfo.id === "number" ? awaitInfo.id : '"' + awaitInfo.id + '"') + (awaitInfo.after ? ',"' + awaitInfo.after + '"' : "") + ")");
86
+ }
58
87
 
59
88
  awaitInfo.out.writer = asyncOut.writer;
60
89
 
@@ -66,20 +95,17 @@ module.exports = function (input, out) {
66
95
  asyncOut.end();
67
96
  next();
68
97
  }
69
- }).on("error", function (err) {
70
- asyncOut.error(err);
71
- });
98
+ }
72
99
  }
73
100
 
74
101
  awaitContext.instances.forEach(handleAwait);
75
-
76
- out.on("await:clientReorder", function (awaitInfo) {
102
+ awaitContext.handleAwait = function (awaitInfo) {
77
103
  remaining++;
78
104
  handleAwait(awaitInfo);
79
- });
105
+ };
80
106
 
81
107
  // Now that we have a listener attached, we want to receive any additional
82
- // out-of-sync instances via an event
83
- delete awaitContext.instances;
108
+ // out-of-sync instances via the method
109
+ awaitContext.instances = undefined;
84
110
  });
85
111
  };
@@ -2,11 +2,11 @@ var ComponentDef = require("../../../runtime/components/ComponentDef");
2
2
 
3
3
  module.exports = function beginComponent(componentsContext, component, key, ownerComponentDef) {
4
4
  var componentId = component.id;
5
- var componentDef = componentsContext.q_ = new ComponentDef(component, componentId, componentsContext);
6
- componentsContext.r_.s_[componentId] = true;
7
- componentsContext.t_.push(componentDef);
5
+ var componentDef = componentsContext.r_ = new ComponentDef(component, componentId, componentsContext);
6
+ componentsContext.s_.t_[componentId] = true;
7
+ componentsContext.u_.push(componentDef);
8
8
 
9
- var out = componentsContext.u_;
10
- out.bc(component, key, ownerComponentDef && ownerComponentDef.v_);
9
+ var out = componentsContext.v_;
10
+ out.bc(component, key, ownerComponentDef && ownerComponentDef.w_);
11
11
  return componentDef;
12
12
  };
@@ -11,13 +11,13 @@ module.exports = function beginComponent(componentsContext, component, key, owne
11
11
 
12
12
  // existingComponentDef is only here to allow binding a conditional
13
13
  // widget. It should be removed when the legacy compat layer is removed.
14
- var componentDef = existingComponentDef || (componentsContext.q_ = new ComponentDef(component, componentId, componentsContext));
14
+ var componentDef = existingComponentDef || (componentsContext.r_ = new ComponentDef(component, componentId, componentsContext));
15
15
 
16
- var ownerIsRenderBoundary = ownerComponentDef && ownerComponentDef.w_;
17
- var ownerWillRerender = ownerComponentDef && ownerComponentDef.x_ & FLAG_WILL_RERENDER_IN_BROWSER;
16
+ var ownerIsRenderBoundary = ownerComponentDef && ownerComponentDef.x_;
17
+ var ownerWillRerender = ownerComponentDef && ownerComponentDef.y_ & FLAG_WILL_RERENDER_IN_BROWSER;
18
18
  // On the server
19
- if (!componentsContext.y_ && ownerWillRerender) {
20
- componentDef.x_ |= FLAG_WILL_RERENDER_IN_BROWSER;
19
+ if (!componentsContext.z_ && ownerWillRerender) {
20
+ componentDef.y_ |= FLAG_WILL_RERENDER_IN_BROWSER;
21
21
  componentDef._wrr = true;
22
22
  return componentDef;
23
23
  }
@@ -29,22 +29,22 @@ module.exports = function beginComponent(componentsContext, component, key, owne
29
29
  return componentDef;
30
30
  }
31
31
 
32
- componentsContext.t_.push(componentDef);
32
+ componentsContext.u_.push(componentDef);
33
33
 
34
- let out = componentsContext.u_;
34
+ let out = componentsContext.v_;
35
35
  let runtimeId = out.global.runtimeId;
36
36
 
37
- componentDef.w_ = true;
38
- componentDef.z_ = componentsContext.y_;
37
+ componentDef.x_ = true;
38
+ componentDef.A_ = componentsContext.z_;
39
39
 
40
40
  if (isSplitComponent === false && out.global.noBrowserRerender !== true) {
41
- componentDef.x_ |= FLAG_WILL_RERENDER_IN_BROWSER;
41
+ componentDef.y_ |= FLAG_WILL_RERENDER_IN_BROWSER;
42
42
  componentDef._wrr = true;
43
- componentsContext.y_ = false;
43
+ componentsContext.z_ = false;
44
44
  }
45
45
 
46
46
  if (out.global.oldHydrateNoCreate === true) {
47
- componentDef.x_ |= FLAG_OLD_HYDRATE_NO_CREATE;
47
+ componentDef.y_ |= FLAG_OLD_HYDRATE_NO_CREATE;
48
48
  }
49
49
 
50
50
  if ((ownerIsRenderBoundary || ownerWillRerender) && key != null) {
@@ -19,7 +19,7 @@ function noop() {}
19
19
  module.exports = function defineWidget(def, renderer) {
20
20
  def = def.Widget || def;
21
21
 
22
- if (def.A_) {
22
+ if (def.B_) {
23
23
  return def;
24
24
  }
25
25
 
@@ -49,7 +49,7 @@ module.exports = function defineWidget(def, renderer) {
49
49
  BaseComponent.call(this, id, doc);
50
50
  }
51
51
 
52
- if (!proto.A_) {
52
+ if (!proto.B_) {
53
53
  // Inherit from Component if they didn't already
54
54
  ComponentClass.prototype = Object.create(BaseComponent.prototype);
55
55
  for (var propName in proto) {
@@ -62,16 +62,16 @@ module.exports = function defineWidget(def, renderer) {
62
62
  // The same prototype will be used by our constructor after
63
63
  // we he have set up the prototype chain using the inherit function
64
64
  proto = Component.prototype = ComponentClass.prototype;
65
- proto.B_ = true;
65
+ proto.C_ = true;
66
66
 
67
67
  proto.constructor = def.constructor = Component;
68
68
 
69
69
  Object.defineProperty(proto, "state", {
70
70
  get: function () {
71
- var raw = this.C_ && this.C_.D_;
71
+ var raw = this.D_ && this.D_.E_;
72
72
 
73
73
  if (raw && !raw.toJSON) {
74
- Object.defineProperty(this.C_.D_, "toJSON", stateToJSONDef);
74
+ Object.defineProperty(this.D_.E_, "toJSON", stateToJSONDef);
75
75
  }
76
76
 
77
77
  return raw;
@@ -84,43 +84,43 @@ module.exports = function defineWidget(def, renderer) {
84
84
 
85
85
  Object.defineProperty(proto, "__document", {
86
86
  get: function () {
87
- return this.E_;
87
+ return this.F_;
88
88
  }
89
89
  });
90
90
 
91
91
  Object.defineProperty(proto, "el", {
92
92
  get: function () {
93
- return this.F_;
93
+ return this.G_;
94
94
  }
95
95
  });
96
96
 
97
97
  // get legacy methods
98
98
 
99
- proto.G_ = proto.onRender;
99
+ proto.H_ = proto.onRender;
100
100
  Object.defineProperty(proto, "onRender", {
101
101
  get: noop,
102
102
  set: function (v) {
103
- proto.G_ = v;
103
+ proto.H_ = v;
104
104
  }
105
105
  });
106
106
 
107
- proto.H_ = proto.onUpdate;
107
+ proto.I_ = proto.onUpdate;
108
108
  Object.defineProperty(proto, "onUpdate", {
109
109
  get: function () {
110
110
  return modernMountOrUpdate;
111
111
  },
112
112
  set: function (v) {
113
- proto.H_ = v;
113
+ proto.I_ = v;
114
114
  }
115
115
  });
116
116
 
117
- proto.I_ = proto.onDestroy;
117
+ proto.J_ = proto.onDestroy;
118
118
  Object.defineProperty(proto, "onDestroy", {
119
119
  get: function () {
120
120
  return modernOnDestory;
121
121
  },
122
122
  set: function (v) {
123
- proto.I_ = v;
123
+ proto.J_ = v;
124
124
  }
125
125
  });
126
126
 
@@ -129,89 +129,89 @@ module.exports = function defineWidget(def, renderer) {
129
129
  proto.onMount = modernMountOrUpdate;
130
130
 
131
131
  if (legacyInit) {
132
- proto.J_ = legacyInit;
132
+ proto.K_ = legacyInit;
133
133
  }
134
134
 
135
135
  // convert legacy to modern
136
- proto.K_ = proto.update;
136
+ proto.L_ = proto.update;
137
137
  proto.update = function () {
138
- if (this.L_) {
138
+ if (this.M_) {
139
139
 
140
140
  this.destroy = modernOnDestory;
141
141
  // eslint-disable-next-line no-constant-condition
142
142
 
143
- this.L_ = false;
143
+ this.M_ = false;
144
144
  }
145
- this.M_ = true;
146
- if (this.F_) {
145
+ this.N_ = true;
146
+ if (this.G_) {
147
147
  this.onBeforeUpdate && this.onBeforeUpdate();
148
148
  }
149
149
 
150
- this.K_();
151
- this.M_ = false;
150
+ this.L_();
151
+ this.N_ = false;
152
152
  };
153
153
 
154
154
  function modernMountOrUpdate() {
155
155
  var self = this;
156
- var el = this.N_["@_wbind"];
157
- var prevEl = this.F_;
156
+ var el = this.O_["@_wbind"];
157
+ var prevEl = this.G_;
158
158
 
159
159
  if (prevEl !== el) {
160
- this.F_ = el;
160
+ this.G_ = el;
161
161
 
162
162
  if (prevEl) {
163
163
  this.onBeforeDestroy && this.onBeforeDestroy();
164
- this.I_ && this.I_();
165
- this.O_ = undefined;
164
+ this.J_ && this.J_();
165
+ this.P_ = undefined;
166
166
  this.removeAllListeners();
167
167
  }
168
168
 
169
169
  if (el) {
170
- this.J_ && this.J_(this.widgetConfig || {});
171
- this.G_ && this.G_({ firstRender: true });
172
- this.O_ = legacyRender;
170
+ this.K_ && this.K_(this.widgetConfig || {});
171
+ this.H_ && this.H_({ firstRender: true });
172
+ this.P_ = legacyRender;
173
173
  el.__widget = this;
174
174
  }
175
175
  } else if (el) {
176
176
  if (prevEl) {
177
- this.H_ && this.H_();
177
+ this.I_ && this.I_();
178
178
  }
179
179
 
180
- if (this.P_) {
181
- this.G_ && this.G_({ firstRender: false });
180
+ if (this.Q_) {
181
+ this.H_ && this.H_({ firstRender: false });
182
182
  }
183
183
  }
184
184
 
185
- this.Q_ = this.R_;
186
- this.R_ = null;
187
- this.P_ = false;
185
+ this.R_ = this.S_;
186
+ this.S_ = null;
187
+ this.Q_ = false;
188
188
  }
189
189
 
190
190
  function legacyRender() {
191
- if (!this.M_) {
191
+ if (!this.N_) {
192
192
  this.onBeforeUpdate && this.onBeforeUpdate();
193
193
  }
194
194
 
195
- this.P_ = true;
195
+ this.Q_ = true;
196
196
  }
197
197
 
198
198
  function modernOnDestory() {
199
- if (this.F_) {
199
+ if (this.G_) {
200
200
  this.onBeforeDestroy && this.onBeforeDestroy();
201
- this.I_ && this.I_();
202
- this.F_ = null;
201
+ this.J_ && this.J_();
202
+ this.G_ = null;
203
203
  }
204
204
  }
205
205
 
206
206
  // Set a flag on the constructor function to make it clear this is
207
207
  // a component so that we can short-circuit this work later
208
- Component.A_ = true;
208
+ Component.B_ = true;
209
209
 
210
210
  function State() {
211
211
  BaseState.apply(this, arguments);
212
212
  }
213
213
  inherit(State, BaseState);
214
- proto.S_ = State;
214
+ proto.T_ = State;
215
215
 
216
216
  jQuery.patchComponent(window.$, proto, true /* don't throw error until used if `$` is missing*/
217
217
  );
@@ -243,7 +243,7 @@ module.exports = function defineWidget(def, renderer) {
243
243
  if (renderer) {
244
244
  // Add the rendering related methods as statics on the
245
245
  // new component constructor function
246
- Component.renderer = proto.T_ = renderer;
246
+ Component.renderer = proto.U_ = renderer;
247
247
  Component.render = renderer.render;
248
248
  Component.renderSync = renderer.renderSync;
249
249
  }
@@ -1,11 +1,11 @@
1
1
  module.exports = function defineWidget(def, renderer) {
2
- if (def.A_) {
2
+ if (def.B_) {
3
3
  return def;
4
4
  }
5
5
 
6
6
  if (renderer) {
7
7
  return {
8
- A_: true,
8
+ B_: true,
9
9
  _isWidget: true,
10
10
  renderer: renderer,
11
11
  render: renderer.render,
@@ -13,6 +13,6 @@ module.exports = function defineWidget(def, renderer) {
13
13
  template: renderer.template
14
14
  };
15
15
  } else {
16
- return { A_: true, _isWidget: true };
16
+ return { B_: true, _isWidget: true };
17
17
  }
18
18
  };
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var ComponentsContext = require("../../../runtime/components/ComponentsContext");
4
- var getComponentsContext = ComponentsContext.U_;
4
+ var getComponentsContext = ComponentsContext.V_;
5
5
 
6
6
  module.exports = function endComponent(out, componentDef) {
7
- if (componentDef.w_) {
7
+ if (componentDef.x_) {
8
8
  out.w("<!--" + out.global.runtimeId + "/-->");
9
- getComponentsContext(out).y_ = componentDef.z_;
9
+ getComponentsContext(out).z_ = componentDef.A_;
10
10
  }
11
11
  };
@@ -1,7 +1,7 @@
1
1
  var registry = require("@internal/components-registry");
2
2
 
3
- exports.getComponentForEl = require("@internal/components-util").V_;
4
- exports.init = registry.W_;
3
+ exports.getComponentForEl = require("@internal/components-util").W_;
4
+ exports.init = registry.X_;
5
5
  exports.register = function (id, component) {
6
6
  registry.r(id, function () {
7
7
  return component;
@@ -55,23 +55,23 @@ function getSerializedGlobals($global) {
55
55
  }
56
56
 
57
57
  function addComponentsFromContext(componentsContext, componentsToHydrate) {
58
- var components = componentsContext.t_;
58
+ var components = componentsContext.u_;
59
59
 
60
60
  var len = components.length;
61
61
 
62
62
  for (var i = 0; i < len; i++) {
63
63
  var componentDef = components[i];
64
64
  var id = componentDef.id;
65
- var component = componentDef.v_;
66
- var flags = componentDef.x_;
67
- var isLegacy = componentDef.B_;
65
+ var component = componentDef.w_;
66
+ var flags = componentDef.y_;
67
+ var isLegacy = componentDef.C_;
68
68
 
69
69
  var state = component.state;
70
70
  var input = component.input || 0;
71
71
  var typeName = component.typeName;
72
- var customEvents = component.X_;
73
- var scope = component.Y_;
74
- var bubblingDomEvents = component.Z_;
72
+ var customEvents = component.Y_;
73
+ var scope = component.Z_;
74
+ var bubblingDomEvents = component.___;
75
75
 
76
76
  var needsState;
77
77
  var serializedProps;
@@ -79,7 +79,7 @@ function addComponentsFromContext(componentsContext, componentsToHydrate) {
79
79
 
80
80
  if (isLegacy) {
81
81
  flags |= FLAG_IS_LEGACY;
82
- renderBody = component.___;
82
+ renderBody = component._a_;
83
83
 
84
84
  if (component.widgetConfig && isNotEmpty(component.widgetConfig)) {
85
85
  serializedProps = component.widgetConfig;
@@ -93,16 +93,16 @@ function addComponentsFromContext(componentsContext, componentsToHydrate) {
93
93
  }
94
94
 
95
95
  if (!(flags & FLAG_WILL_RERENDER_IN_BROWSER) || flags & FLAG_OLD_HYDRATE_NO_CREATE) {
96
- component.C_ = undefined; // We don't use `delete` to avoid V8 deoptimization
97
- component.R_ = undefined; // We don't use `delete` to avoid V8 deoptimization
96
+ component.D_ = undefined; // We don't use `delete` to avoid V8 deoptimization
97
+ component.S_ = undefined; // We don't use `delete` to avoid V8 deoptimization
98
98
  component.typeName = undefined;
99
99
  component.id = undefined;
100
- component.X_ = undefined;
101
100
  component.Y_ = undefined;
102
101
  component.Z_ = undefined;
103
- component._a_ = undefined;
102
+ component.___ = undefined;
104
103
  component._b_ = undefined;
105
104
  component._c_ = undefined;
105
+ component._d_ = undefined;
106
106
 
107
107
  needsState = true;
108
108
 
@@ -139,7 +139,7 @@ function addComponentsFromContext(componentsContext, componentsToHydrate) {
139
139
 
140
140
  var extra = {
141
141
  b: bubblingDomEvents,
142
- d: componentDef._d_,
142
+ d: componentDef._e_,
143
143
  e: customEvents,
144
144
  f: flags || undefined,
145
145
  p: customEvents && scope, // Only serialize scope if we need to attach custom events
@@ -168,7 +168,7 @@ function addComponentsFromContext(componentsContext, componentsToHydrate) {
168
168
  components.length = 0;
169
169
 
170
170
  // Also add any components from nested contexts
171
- var nestedContexts = componentsContext._e_;
171
+ var nestedContexts = componentsContext._f_;
172
172
  if (nestedContexts !== undefined) {
173
173
  nestedContexts.forEach(function (nestedContext) {
174
174
  addComponentsFromContext(nestedContext, componentsToHydrate);
@@ -180,7 +180,7 @@ function getInitComponentsData(out, componentDefs) {
180
180
  const len = componentDefs.length;
181
181
  const $global = out.global;
182
182
  const isLast = $global.f_;
183
- const didSerializeComponents = $global._f_;
183
+ const didSerializeComponents = $global._g_;
184
184
  const prefix = $global.componentIdPrefix || $global.widgetIdPrefix;
185
185
 
186
186
  if (len === 0) {
@@ -192,7 +192,7 @@ function getInitComponentsData(out, componentDefs) {
192
192
  }
193
193
 
194
194
  const TYPE_INDEX = 1;
195
- const typesLookup = $global._g_ || ($global._g_ = new Map());
195
+ const typesLookup = $global._h_ || ($global._h_ = new Map());
196
196
  let newTypes;
197
197
 
198
198
  for (let i = 0; i < len; i++) {
@@ -217,7 +217,7 @@ function getInitComponentsData(out, componentDefs) {
217
217
  let serializedGlobals;
218
218
 
219
219
  if (!didSerializeComponents) {
220
- $global._f_ = true;
220
+ $global._g_ = true;
221
221
  serializedGlobals = getSerializedGlobals($global);
222
222
  }
223
223
 
@@ -231,7 +231,7 @@ function getInitComponentsData(out, componentDefs) {
231
231
  }
232
232
 
233
233
  function getInitComponentsDataFromOut(out) {
234
- const componentsContext = out.t_;
234
+ const componentsContext = out.u_;
235
235
 
236
236
  if (componentsContext === null) {
237
237
  return;
@@ -254,10 +254,10 @@ function getInitComponentsDataFromOut(out) {
254
254
  }
255
255
 
256
256
  function writeInitComponentsCode(out) {
257
- out.script(exports._h_(out));
257
+ out.script(exports._i_(out));
258
258
  }
259
259
 
260
- exports._h_ = function getInitComponentsCode(out, componentDefs) {
260
+ exports._i_ = function getInitComponentsCode(out, componentDefs) {
261
261
  const initComponentsData = arguments.length === 2 ? getInitComponentsData(out, componentDefs) : getInitComponentsDataFromOut(out);
262
262
 
263
263
  if (initComponentsData === undefined) {
@@ -270,7 +270,7 @@ exports._h_ = function getInitComponentsCode(out, componentDefs) {
270
270
  return `$${componentGlobalKey}=(window.$${componentGlobalKey}||[]).concat(${safeStringify(initComponentsData)})`;
271
271
  };
272
272
 
273
- exports._i_ = addComponentsFromContext;
273
+ exports._j_ = addComponentsFromContext;
274
274
  exports.writeInitComponentsCode = writeInitComponentsCode;
275
275
 
276
276
  /**
@@ -1,9 +1,9 @@
1
1
  var Component = require("../../../runtime/components/Component");
2
2
  var loader = require("@internal/loader");
3
- var getComponentForEl = require("@internal/components-util").V_;
3
+ var getComponentForEl = require("@internal/components-util").W_;
4
4
 
5
5
  // expose legacy
6
- require("@internal/components-registry")._j_ = exports;
6
+ require("@internal/components-registry")._k_ = exports;
7
7
  exports.load = function (typeName) {
8
8
  return exports.defineWidget(loader(typeName));
9
9
  };
@@ -29,14 +29,14 @@ exports.getWidgetForEl = exports.get = function (elOrId) {
29
29
 
30
30
  return getComponentForEl(el);
31
31
  };
32
- exports.initWidgets = require("@internal/components-registry").W_;
32
+ exports.initWidgets = require("@internal/components-registry").X_;
33
33
 
34
34
  // monkey patch Widget
35
35
  if (Widget) {
36
36
  var WidgetProto = Widget.prototype;
37
37
  WidgetProto.setProps = function (newInput) {
38
- this._k_ = true;
39
- this._l_(newInput);
38
+ this._l_ = true;
39
+ this._m_(newInput);
40
40
  };
41
41
  WidgetProto.rerender = function (newInput) {
42
42
  if (newInput) {
@@ -55,6 +55,6 @@ RenderResult.prototype.getWidget = function () {
55
55
  };
56
56
  RenderResult.prototype.getWidgets = function () {
57
57
  return RenderResult.prototype.getComponents.apply(this, arguments).filter(function (component) {
58
- return component.B_;
58
+ return component.C_;
59
59
  });
60
60
  };
@@ -10,5 +10,5 @@ exports.makeRenderable = exports.renderable = require("../../../runtime/renderab
10
10
  exports.writeInitWidgetsCode = modernMarko.writeInitComponentsCode;
11
11
  exports.getRenderedWidgets = exports.getRenderedWidgetIds = modernMarko.getRenderedComponents;
12
12
  exports.getInitWidgetsCode = function (out) {
13
- return modernMarko._h_(out);
13
+ return modernMarko._i_(out);
14
14
  };