marko 5.29.2 → 5.30.0

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 (167) hide show
  1. package/README.md +1 -1
  2. package/bin/markoc.js +18 -18
  3. package/dist/core-tags/core/await/renderer.js +5 -1
  4. package/dist/node_modules/@internal/components-beginComponent/index.js +13 -3
  5. package/dist/node_modules/@internal/components-define-widget-legacy/index-browser.js +331 -0
  6. package/dist/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
  7. package/dist/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
  8. package/dist/node_modules/@internal/components-entry/index-browser.js +2 -2
  9. package/dist/node_modules/@internal/components-entry/index.js +73 -45
  10. package/dist/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
  11. package/dist/node_modules/@internal/components-entry-legacy/index.js +15 -0
  12. package/dist/node_modules/@internal/components-entry-legacy/package.json +11 -0
  13. package/dist/node_modules/@internal/components-registry/index-browser.js +70 -43
  14. package/dist/node_modules/@internal/components-registry/index.js +2 -2
  15. package/dist/node_modules/@internal/components-util/index-browser.js +17 -17
  16. package/dist/node_modules/@internal/components-util/index.js +18 -8
  17. package/dist/node_modules/@internal/create-readable/index-browser.js +1 -1
  18. package/dist/node_modules/@internal/create-readable/index.js +9 -9
  19. package/dist/node_modules/@internal/set-immediate/index-browser.js +1 -1
  20. package/dist/node_modules/@internal/set-immediate/index-worker.js +2 -2
  21. package/dist/node_modules/@internal/set-immediate/index.js +2 -2
  22. package/dist/runtime/RenderResult.js +3 -3
  23. package/dist/runtime/components/Component.js +146 -148
  24. package/dist/runtime/components/ComponentDef.js +41 -27
  25. package/dist/runtime/components/ComponentsContext.js +6 -6
  26. package/dist/runtime/components/GlobalComponentsContext.js +3 -3
  27. package/dist/runtime/components/KeySequence.js +3 -3
  28. package/dist/runtime/components/ServerComponent.js +13 -13
  29. package/dist/runtime/components/State.js +27 -27
  30. package/dist/runtime/components/attach-detach.js +7 -7
  31. package/dist/runtime/components/defineComponent.js +5 -5
  32. package/dist/runtime/components/dom-data.js +6 -6
  33. package/dist/runtime/components/event-delegation.js +10 -10
  34. package/dist/runtime/components/legacy/browser.json +9 -0
  35. package/dist/runtime/components/legacy/defineComponent-legacy.js +32 -0
  36. package/dist/runtime/components/legacy/defineRenderer-legacy.js +171 -0
  37. package/dist/runtime/components/legacy/defineWidget-legacy.js +1 -0
  38. package/dist/runtime/components/legacy/dependencies/html.js +3 -0
  39. package/dist/runtime/components/legacy/dependencies/index.js +178 -0
  40. package/dist/runtime/components/legacy/dependencies/vdom.js +3 -0
  41. package/dist/runtime/components/legacy/index.js +1 -0
  42. package/dist/runtime/components/legacy/jquery.js +51 -0
  43. package/dist/runtime/components/legacy/ready.js +152 -0
  44. package/dist/runtime/components/legacy/renderer-legacy.js +230 -0
  45. package/dist/runtime/components/renderer.js +30 -26
  46. package/dist/runtime/components/update-manager.js +10 -10
  47. package/dist/runtime/createOut.js +1 -1
  48. package/dist/runtime/dom-insert.js +5 -5
  49. package/dist/runtime/helpers/_change-case.js +2 -2
  50. package/dist/runtime/helpers/dynamic-tag.js +7 -9
  51. package/dist/runtime/helpers/style-value.js +7 -2
  52. package/dist/runtime/html/AsyncStream.js +20 -20
  53. package/dist/runtime/html/BufferedWriter.js +2 -2
  54. package/dist/runtime/html/helpers/_dynamic-attr.js +2 -2
  55. package/dist/runtime/html/helpers/attr.js +19 -6
  56. package/dist/runtime/html/helpers/attrs.js +7 -0
  57. package/dist/runtime/html/helpers/data-marko.js +2 -2
  58. package/dist/runtime/html/helpers/escape-quotes.js +1 -1
  59. package/dist/runtime/html/helpers/escape-xml.js +1 -1
  60. package/dist/runtime/html/helpers/merge-attrs.js +38 -7
  61. package/dist/runtime/html/index.js +2 -2
  62. package/dist/runtime/renderable.js +9 -6
  63. package/dist/runtime/vdom/AsyncVDOMBuilder.js +86 -86
  64. package/dist/runtime/vdom/VComponent.js +3 -3
  65. package/dist/runtime/vdom/VDocumentFragment.js +7 -7
  66. package/dist/runtime/vdom/VElement.js +61 -50
  67. package/dist/runtime/vdom/VFragment.js +8 -8
  68. package/dist/runtime/vdom/VNode.js +36 -36
  69. package/dist/runtime/vdom/VText.js +8 -8
  70. package/dist/runtime/vdom/helpers/attrs.js +24 -4
  71. package/dist/runtime/vdom/helpers/merge-attrs.js +16 -0
  72. package/dist/runtime/vdom/helpers/v-element.js +1 -1
  73. package/dist/runtime/vdom/helpers/v-text.js +1 -1
  74. package/dist/runtime/vdom/hot-reload.js +19 -19
  75. package/dist/runtime/vdom/index.js +2 -2
  76. package/dist/runtime/vdom/morphdom/fragment.js +5 -5
  77. package/dist/runtime/vdom/morphdom/helpers.js +5 -5
  78. package/dist/runtime/vdom/morphdom/index.js +56 -56
  79. package/dist/runtime/vdom/morphdom/specialElHandlers.js +7 -7
  80. package/dist/runtime/vdom/preserve-attrs.js +1 -1
  81. package/dist/runtime/vdom/vdom.js +14 -14
  82. package/docs/10-awesome-marko-features.md +1 -1
  83. package/docs/body-content.md +3 -3
  84. package/docs/class-components.md +6 -6
  85. package/docs/cloudflare-workers.md +3 -3
  86. package/docs/compiler.md +5 -5
  87. package/docs/express.md +2 -2
  88. package/docs/http.md +1 -1
  89. package/docs/koa.md +1 -1
  90. package/docs/lasso.md +1 -1
  91. package/docs/marko-vs-react.md +2 -2
  92. package/docs/rendering.md +6 -6
  93. package/docs/rollup.md +30 -30
  94. package/docs/troubleshooting-streaming.md +1 -1
  95. package/docs/typescript.md +1 -1
  96. package/docs/vite.md +3 -3
  97. package/docs/webpack.md +25 -25
  98. package/docs/why-is-marko-fast.md +2 -2
  99. package/index.d.ts +1 -0
  100. package/legacy-components-browser.marko +15 -0
  101. package/legacy-components.js +7 -0
  102. package/package.json +51 -45
  103. package/src/compiler/config.js +1 -1
  104. package/src/compiler/index.js +5 -5
  105. package/src/core-tags/core/__flush_here_and_after__.js +1 -1
  106. package/src/core-tags/core/await/AsyncValue.js +1 -1
  107. package/src/core-tags/core/await/renderer.js +8 -4
  108. package/src/core-tags/core/await/reorderer-renderer.js +1 -1
  109. package/src/node-require/browser-refresh.js +2 -2
  110. package/src/node-require/index.js +2 -2
  111. package/src/node_modules/@internal/components-beginComponent/index.js +16 -6
  112. package/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +331 -0
  113. package/src/node_modules/@internal/components-define-widget-legacy/index.js +18 -0
  114. package/src/node_modules/@internal/components-define-widget-legacy/package.json +11 -0
  115. package/src/node_modules/@internal/components-entry/index.js +65 -37
  116. package/src/node_modules/@internal/components-entry-legacy/index-browser.js +74 -0
  117. package/src/node_modules/@internal/components-entry-legacy/index.js +15 -0
  118. package/src/node_modules/@internal/components-entry-legacy/package.json +11 -0
  119. package/src/node_modules/@internal/components-registry/index-browser.js +33 -6
  120. package/src/node_modules/@internal/components-util/index.js +10 -0
  121. package/src/runtime/RenderResult.js +3 -3
  122. package/src/runtime/components/Component.js +16 -18
  123. package/src/runtime/components/ComponentDef.js +22 -8
  124. package/src/runtime/components/ComponentsContext.js +1 -1
  125. package/src/runtime/components/State.js +2 -2
  126. package/src/runtime/components/attach-detach.js +1 -1
  127. package/src/runtime/components/dom-data.js +1 -1
  128. package/src/runtime/components/legacy/browser.json +9 -0
  129. package/src/runtime/components/legacy/defineComponent-legacy.js +32 -0
  130. package/src/runtime/components/legacy/defineRenderer-legacy.js +171 -0
  131. package/src/runtime/components/legacy/defineWidget-legacy.js +1 -0
  132. package/src/runtime/components/legacy/dependencies/html.js +3 -0
  133. package/src/runtime/components/legacy/dependencies/index.js +178 -0
  134. package/src/runtime/components/legacy/dependencies/vdom.js +3 -0
  135. package/src/runtime/components/legacy/index.js +1 -0
  136. package/src/runtime/components/legacy/jquery.js +51 -0
  137. package/src/runtime/components/legacy/ready.js +152 -0
  138. package/src/runtime/components/legacy/renderer-legacy.js +230 -0
  139. package/src/runtime/components/renderer.js +4 -0
  140. package/src/runtime/components/update-manager.js +1 -1
  141. package/src/runtime/dom-insert.js +1 -1
  142. package/src/runtime/helpers/dynamic-tag.js +2 -4
  143. package/src/runtime/helpers/style-value.js +7 -2
  144. package/src/runtime/html/AsyncStream.js +5 -5
  145. package/src/runtime/html/BufferedWriter.js +1 -1
  146. package/src/runtime/html/StringWriter.js +1 -1
  147. package/src/runtime/html/helpers/attr.js +15 -2
  148. package/src/runtime/html/helpers/attrs.js +7 -0
  149. package/src/runtime/html/helpers/merge-attrs.js +38 -7
  150. package/src/runtime/html/hot-reload.js +1 -1
  151. package/src/runtime/html/index.js +2 -2
  152. package/src/runtime/renderable.js +5 -2
  153. package/src/runtime/vdom/AsyncVDOMBuilder.js +2 -2
  154. package/src/runtime/vdom/VComponent.js +1 -1
  155. package/src/runtime/vdom/VDocumentFragment.js +1 -1
  156. package/src/runtime/vdom/VElement.js +17 -6
  157. package/src/runtime/vdom/VFragment.js +1 -1
  158. package/src/runtime/vdom/VNode.js +1 -1
  159. package/src/runtime/vdom/VText.js +1 -1
  160. package/src/runtime/vdom/helpers/attrs.js +26 -6
  161. package/src/runtime/vdom/helpers/merge-attrs.js +16 -0
  162. package/src/runtime/vdom/hot-reload.js +1 -1
  163. package/src/runtime/vdom/index.js +2 -2
  164. package/src/runtime/vdom/morphdom/fragment.js +1 -1
  165. package/src/runtime/vdom/morphdom/specialElHandlers.js +1 -1
  166. package/src/taglib/index.js +1 -1
  167. package/tags-html.d.ts +9 -0
@@ -2,15 +2,17 @@
2
2
 
3
3
  var w10Noop = require("warp10/constants").NOOP;
4
4
  var componentUtil = require("@internal/components-util");
5
- var attachBubblingEvent = componentUtil._C_;
5
+ var attachBubblingEvent = componentUtil._W_;
6
6
  var addDelegatedEventHandler =
7
- require("./event-delegation").___;
7
+ require("./event-delegation")._u_;
8
8
  var extend = require("raptor-util/extend");
9
9
  var KeySequence = require("./KeySequence");
10
10
  var EMPTY_OBJECT = {};
11
11
 
12
12
  var FLAG_WILL_RERENDER_IN_BROWSER = 1;
13
13
  var FLAG_HAS_RENDER_BODY = 2;
14
+ var FLAG_IS_LEGACY = 4;
15
+ var FLAG_OLD_HYDRATE_NO_CREATE = 8;
14
16
 
15
17
  /**
16
18
  * A ComponentDef is used to hold the metadata collected at runtime for
@@ -18,25 +20,25 @@ var FLAG_HAS_RENDER_BODY = 2;
18
20
  * later (after the rendered HTML has been added to the DOM)
19
21
  */
20
22
  function ComponentDef(component, componentId, componentsContext) {
21
- this.as_ = componentsContext; // The AsyncWriter that this component is associated with
23
+ this.aH_ = componentsContext; // The AsyncWriter that this component is associated with
22
24
  this.i_ = component;
23
25
  this.id = componentId;
24
26
 
25
- this.O_ = undefined; // An array of DOM events that need to be added (in sets of three)
27
+ this._g_ = undefined; // An array of DOM events that need to be added (in sets of three)
26
28
 
27
- this._c_ = false;
29
+ this._w_ = false;
28
30
 
29
31
  this.B_ = false;
30
32
  this.C_ = 0;
31
33
 
32
- this.at_ = 0; // The unique integer to use for the next scoped ID
33
- this.au_ = null;
34
+ this.aI_ = 0; // The unique integer to use for the next scoped ID
35
+ this.aJ_ = null;
34
36
  }
35
37
 
36
38
  ComponentDef.prototype = {
37
- av_: function (key) {
39
+ aK_: function (key) {
38
40
  return (
39
- this.au_ || (this.au_ = new KeySequence())).av_(
41
+ this.aJ_ || (this.aJ_ = new KeySequence())).aK_(
40
42
  key);
41
43
  },
42
44
 
@@ -70,8 +72,8 @@ ComponentDef.prototype = {
70
72
  /**
71
73
  * Returns the next auto generated unique ID for a nested DOM element or nested DOM component
72
74
  */
73
- aw_: function () {
74
- return this.id + "-c" + this.at_++;
75
+ aL_: function () {
76
+ return this.id + "-c" + this.aI_++;
75
77
  },
76
78
 
77
79
  d: function (eventName, handlerMethodName, isOnce, extraArgs) {
@@ -79,33 +81,45 @@ ComponentDef.prototype = {
79
81
  return attachBubblingEvent(this, handlerMethodName, isOnce, extraArgs);
80
82
  },
81
83
 
82
- get Y_() {
83
- return this.i_.Y_;
84
+ get _s_() {
85
+ return this.i_._s_;
84
86
  }
85
87
  };
86
88
 
87
- ComponentDef.prototype.nk = ComponentDef.prototype.av_;
89
+ ComponentDef.prototype.nk = ComponentDef.prototype.aK_;
88
90
 
89
- ComponentDef._l_ = function (o, types, global, registry) {
91
+ ComponentDef._F_ = function (o, types, global, registry) {
90
92
  var id = o[0];
91
93
  var typeName = types[o[1]];
92
94
  var input = o[2] || null;
93
95
  var extra = o[3] || EMPTY_OBJECT;
94
96
 
95
97
  var state = extra.s;
96
- var componentProps = extra.w;
98
+ var componentProps = extra.w || EMPTY_OBJECT;
97
99
  var flags = extra.f;
98
- var component = registry._o_(typeName, id);
100
+ var isLegacy = flags & FLAG_IS_LEGACY;
101
+ var renderBody = flags & FLAG_HAS_RENDER_BODY ? w10Noop : extra.r;
102
+
103
+ var component =
104
+ typeName /* legacy */ &&
105
+ registry._I_(typeName, id, isLegacy);
99
106
 
100
107
  // Prevent newly created component from being queued for update since we area
101
108
  // just building it from the server info
102
- component.N_ = true;
109
+ component._f_ = true;
103
110
 
104
- if (flags & FLAG_HAS_RENDER_BODY) {
105
- (input || (input = {})).renderBody = w10Noop;
111
+ if (isLegacy) {
112
+ component.widgetConfig = componentProps;
113
+ component._c_ = renderBody;
114
+ } else if (renderBody) {
115
+ (input || (input = {})).renderBody = renderBody;
106
116
  }
107
117
 
108
- if (flags & FLAG_WILL_RERENDER_IN_BROWSER) {
118
+ if (
119
+ !isLegacy &&
120
+ flags & FLAG_WILL_RERENDER_IN_BROWSER &&
121
+ !(flags & FLAG_OLD_HYDRATE_NO_CREATE))
122
+ {
109
123
  if (component.onCreate) {
110
124
  component.onCreate(input, { global: global });
111
125
  }
@@ -125,29 +139,29 @@ ComponentDef._l_ = function (o, types, global, registry) {
125
139
  component.state = state;
126
140
  }
127
141
 
128
- if (componentProps) {
142
+ if (!isLegacy && componentProps) {
129
143
  extend(component, componentProps);
130
144
  }
131
145
  }
132
146
 
133
- component.K_ = input;
147
+ component.U_ = input;
134
148
 
135
149
  if (extra.b) {
136
- component.I_ = extra.b;
150
+ component._b_ = extra.b;
137
151
  }
138
152
 
139
153
  var scope = extra.p;
140
154
  var customEvents = extra.e;
141
155
  if (customEvents) {
142
- component.am_(customEvents, scope);
156
+ component.aB_(customEvents, scope);
143
157
  }
144
158
 
145
- component._P_ = global;
159
+ component.ai_ = global;
146
160
 
147
161
  return {
148
162
  id: id,
149
163
  i_: component,
150
- O_: extra.d,
164
+ _g_: extra.d,
151
165
  C_: extra.f || 0
152
166
  };
153
167
  };
@@ -11,9 +11,9 @@ function ComponentsContext(out, parentComponentsContext) {
11
11
 
12
12
  var nestedContextsForParent;
13
13
  if (
14
- !(nestedContextsForParent = parentComponentsContext.P_))
14
+ !(nestedContextsForParent = parentComponentsContext._h_))
15
15
  {
16
- nestedContextsForParent = parentComponentsContext.P_ = [];
16
+ nestedContextsForParent = parentComponentsContext._h_ = [];
17
17
  }
18
18
 
19
19
  nestedContextsForParent.push(this);
@@ -29,18 +29,18 @@ function ComponentsContext(out, parentComponentsContext) {
29
29
  this.b_ = [];
30
30
  this.A_ = out;
31
31
  this.k_ = componentDef;
32
- this.P_ = undefined;
32
+ this._h_ = undefined;
33
33
  this.p_ =
34
34
  parentComponentsContext && parentComponentsContext.p_;
35
35
  }
36
36
 
37
37
  ComponentsContext.prototype = {
38
- _K_: function (host) {
38
+ ad_: function (host) {
39
39
  var componentDefs = this.b_;
40
40
 
41
- ComponentsContext._q_(componentDefs, host);
41
+ ComponentsContext._K_(componentDefs, host);
42
42
 
43
- this.A_.emit("ax_");
43
+ this.A_.emit("aM_");
44
44
 
45
45
  // Reset things stored in global since global is retained for
46
46
  // future renders
@@ -1,10 +1,10 @@
1
1
  "use strict";var nextComponentIdProvider =
2
- require("@internal/components-util")._B_;
2
+ require("@internal/components-util")._V_;
3
3
 
4
4
  function GlobalComponentsContext(out) {
5
5
  this.z_ = {};
6
- this.ah_ = undefined;
7
- this.aw_ = nextComponentIdProvider(out);
6
+ this.ax_ = undefined;
7
+ this.aL_ = nextComponentIdProvider(out);
8
8
  }
9
9
 
10
10
  module.exports = GlobalComponentsContext;
@@ -1,9 +1,9 @@
1
1
  "use strict";function KeySequence() {
2
- this.ay_ = Object.create(null);
2
+ this.aN_ = Object.create(null);
3
3
  }
4
4
 
5
- KeySequence.prototype.av_ = function (key) {
6
- var lookup = this.ay_;
5
+ KeySequence.prototype.aK_ = function (key) {
6
+ var lookup = this.aN_;
7
7
 
8
8
  if (lookup[key]) {
9
9
  return key + "_" + lookup[key]++;
@@ -4,38 +4,38 @@
4
4
  class ServerComponent {
5
5
  constructor(id, input, out, typeName, customEvents, scope) {
6
6
  this.id = id;
7
- this.G_ = customEvents;
8
- this.H_ = scope;
7
+ this.___ = customEvents;
8
+ this._a_ = scope;
9
9
  this.typeName = typeName;
10
- this.I_ = undefined; // Used to keep track of bubbling DOM events for components rendered on the server
11
- this.L_ = 0;
10
+ this._b_ = undefined; // Used to keep track of bubbling DOM events for components rendered on the server
11
+ this._d_ = 0;
12
12
 
13
13
  this.onCreate(input, out);
14
- this.M_ = this.onInput(input, out) || input;
15
- if (this.K_ === undefined) {
16
- this.K_ = this.M_;
14
+ this._e_ = this.onInput(input, out) || input;
15
+ if (this.U_ === undefined) {
16
+ this.U_ = this._e_;
17
17
  }
18
18
  this.onRender(out);
19
19
  }
20
20
 
21
21
  set input(newInput) {
22
- this.K_ = newInput;
22
+ this.U_ = newInput;
23
23
  }
24
24
 
25
25
  get input() {
26
- return this.K_;
26
+ return this.U_;
27
27
  }
28
28
 
29
29
  set state(newState) {
30
- this.J_ = newState;
30
+ this.G_ = newState;
31
31
  }
32
32
 
33
33
  get state() {
34
- return this.J_;
34
+ return this.G_;
35
35
  }
36
36
 
37
- get ak_() {
38
- return this.J_;
37
+ get aA_() {
38
+ return this.G_;
39
39
  }
40
40
 
41
41
  elId(nestedId) {
@@ -5,10 +5,10 @@ function ensure(state, propertyName) {
5
5
  if (!(propertyName in proto)) {
6
6
  Object.defineProperty(proto, propertyName, {
7
7
  get: function () {
8
- return this.al_[propertyName];
8
+ return this.H_[propertyName];
9
9
  },
10
10
  set: function (value) {
11
- this._Y_(propertyName, value, false /* ensure:false */);
11
+ this.ap_(propertyName, value, false /* ensure:false */);
12
12
  }
13
13
  });
14
14
  }
@@ -16,35 +16,35 @@ function ensure(state, propertyName) {
16
16
 
17
17
  function State(component) {
18
18
  this.i_ = component;
19
- this.al_ = {};
19
+ this.H_ = {};
20
20
 
21
- this._R_ = false;
22
- this.ad_ = null;
23
- this.ac_ = null;
24
- this.az_ = null; // An object that we use to keep tracking of state properties that were forced to be dirty
21
+ this.aj_ = false;
22
+ this.au_ = null;
23
+ this.at_ = null;
24
+ this.aO_ = null; // An object that we use to keep tracking of state properties that were forced to be dirty
25
25
 
26
26
  Object.seal(this);
27
27
  }
28
28
 
29
29
  State.prototype = {
30
- _a_: function () {
30
+ _v_: function () {
31
31
  var self = this;
32
32
 
33
- self._R_ = false;
34
- self.ad_ = null;
35
- self.ac_ = null;
36
- self.az_ = null;
33
+ self.aj_ = false;
34
+ self.au_ = null;
35
+ self.at_ = null;
36
+ self.aO_ = null;
37
37
  },
38
38
 
39
- _W_: function (newState) {
39
+ an_: function (newState) {
40
40
  var state = this;
41
41
  var key;
42
42
 
43
- var rawState = this.al_;
43
+ var rawState = this.H_;
44
44
 
45
45
  for (key in rawState) {
46
46
  if (!(key in newState)) {
47
- state._Y_(
47
+ state.ap_(
48
48
  key,
49
49
  undefined,
50
50
  false /* ensure:false */,
@@ -54,7 +54,7 @@ State.prototype = {
54
54
  }
55
55
 
56
56
  for (key in newState) {
57
- state._Y_(
57
+ state.ap_(
58
58
  key,
59
59
  newState[key],
60
60
  true /* ensure:true */,
@@ -62,32 +62,32 @@ State.prototype = {
62
62
 
63
63
  }
64
64
  },
65
- _Y_: function (name, value, shouldEnsure, forceDirty) {
66
- var rawState = this.al_;
65
+ ap_: function (name, value, shouldEnsure, forceDirty) {
66
+ var rawState = this.H_;
67
67
 
68
68
  if (shouldEnsure) {
69
69
  ensure(this, name);
70
70
  }
71
71
 
72
72
  if (forceDirty) {
73
- var forcedDirtyState = this.az_ || (this.az_ = {});
73
+ var forcedDirtyState = this.aO_ || (this.aO_ = {});
74
74
  forcedDirtyState[name] = true;
75
75
  } else if (rawState[name] === value) {
76
76
  return;
77
77
  }
78
78
 
79
- if (!this._R_) {
79
+ if (!this.aj_) {
80
80
  // This is the first time we are modifying the component state
81
81
  // so introduce some properties to do some tracking of
82
82
  // changes to the state
83
- this._R_ = true; // Mark the component state as dirty (i.e. modified)
84
- this.ad_ = rawState;
85
- this.al_ = rawState = extend({}, rawState);
86
- this.ac_ = {};
87
- this.i_._X_();
83
+ this.aj_ = true; // Mark the component state as dirty (i.e. modified)
84
+ this.au_ = rawState;
85
+ this.H_ = rawState = extend({}, rawState);
86
+ this.at_ = {};
87
+ this.i_.ao_();
88
88
  }
89
89
 
90
- this.ac_[name] = value;
90
+ this.at_[name] = value;
91
91
 
92
92
  if (value === undefined) {
93
93
  // Don't store state properties with an undefined or null value
@@ -98,7 +98,7 @@ State.prototype = {
98
98
  }
99
99
  },
100
100
  toJSON: function () {
101
- return this.al_;
101
+ return this.H_;
102
102
  }
103
103
  };
104
104
 
@@ -1,6 +1,6 @@
1
1
  "use strict";var eventDelegation = require("./event-delegation");
2
- var delegateEvent = eventDelegation.aA_;
3
- var getEventFromEl = eventDelegation.aB_;
2
+ var delegateEvent = eventDelegation.aP_;
3
+ var getEventFromEl = eventDelegation.aQ_;
4
4
 
5
5
  // var componentsUtil = require('@internal/components-util');
6
6
  // var destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;
@@ -14,10 +14,10 @@ function handleNodeAttach(node, componentsContext) {
14
14
  var out = componentsContext.A_;
15
15
  var data = out.data;
16
16
 
17
- var attachTargets = data.aC_;
17
+ var attachTargets = data.aR_;
18
18
  if (!attachTargets) {
19
- attachTargets = data.aC_ = [];
20
- out.on("ax_", function () {
19
+ attachTargets = data.aR_ = [];
20
+ out.on("aM_", function () {
21
21
  for (var i = 0; i < attachTargets.length; i += 2) {
22
22
  var node = attachTargets[i];
23
23
  var target = attachTargets[i + 1];
@@ -56,5 +56,5 @@ function handleNodeDetach(node) {
56
56
  }
57
57
  }
58
58
 
59
- eventDelegation.aD_ = handleNodeAttach;
60
- eventDelegation._T_ = handleNodeDetach;
59
+ eventDelegation.aS_ = handleNodeAttach;
60
+ eventDelegation.al_ = handleNodeDetach;
@@ -6,7 +6,7 @@ var BaseComponent = require("./Component");
6
6
  var inherit = require("raptor-util/inherit");
7
7
 
8
8
  module.exports = function defineComponent(def, renderer) {
9
- if (def.X_) {
9
+ if (def.E_) {
10
10
  return def;
11
11
  }
12
12
 
@@ -35,7 +35,7 @@ module.exports = function defineComponent(def, renderer) {
35
35
  BaseComponent.call(this, id);
36
36
  }
37
37
 
38
- if (!proto.X_) {
38
+ if (!proto.E_) {
39
39
  // Inherit from Component if they didn't already
40
40
  inherit(ComponentClass, BaseComponent);
41
41
  }
@@ -48,14 +48,14 @@ module.exports = function defineComponent(def, renderer) {
48
48
 
49
49
  // Set a flag on the constructor function to make it clear this is
50
50
  // a component so that we can short-circuit this work later
51
- Component.X_ = true;
51
+ Component.E_ = true;
52
52
 
53
53
  function State(component) {
54
54
  BaseState.call(this, component);
55
55
  }
56
56
  inherit(State, BaseState);
57
- proto._V_ = State;
58
- proto.af_ = renderer;
57
+ proto.V_ = State;
58
+ proto.W_ = renderer;
59
59
 
60
60
  return Component;
61
61
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";module.exports = {
2
- _u_: new WeakMap(),
3
- _t_: new WeakMap(),
4
- W_: new WeakMap(),
5
- aE_: new WeakMap(),
6
- _s_: new WeakMap(),
7
- V_: {}
2
+ _O_: new WeakMap(),
3
+ _N_: new WeakMap(),
4
+ _r_: new WeakMap(),
5
+ aT_: new WeakMap(),
6
+ _M_: new WeakMap(),
7
+ _q_: {}
8
8
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";var componentsUtil = require("@internal/components-util");
2
- var runtimeId = componentsUtil._y_;
3
- var componentLookup = componentsUtil.T_;
4
- var getMarkoPropsFromEl = componentsUtil.Z_;
2
+ var runtimeId = componentsUtil._S_;
3
+ var componentLookup = componentsUtil._o_;
4
+ var getMarkoPropsFromEl = componentsUtil._t_;
5
5
 
6
6
  var TEXT_NODE = 3;
7
7
 
@@ -54,7 +54,7 @@ function delegateEvent(node, eventName, target, event) {
54
54
 
55
55
  if (extraArgs != null) {
56
56
  if (typeof extraArgs === "number") {
57
- extraArgs = targetComponent.I_[extraArgs];
57
+ extraArgs = targetComponent._b_[extraArgs];
58
58
  }
59
59
  }
60
60
 
@@ -132,12 +132,12 @@ function addDelegatedEventHandlerToHost(eventType, host) {
132
132
 
133
133
  function noop() {}
134
134
 
135
- exports.aD_ = noop;
136
- exports._T_ = noop;
137
- exports.aA_ = delegateEvent;
138
- exports.aB_ = getEventFromEl;
139
- exports.___ = addDelegatedEventHandler;
140
- exports._i_ = function (host) {
135
+ exports.aS_ = noop;
136
+ exports.al_ = noop;
137
+ exports.aP_ = delegateEvent;
138
+ exports.aQ_ = getEventFromEl;
139
+ exports._u_ = addDelegatedEventHandler;
140
+ exports._C_ = function (host) {
141
141
  Object.keys(delegatedEvents).forEach(function (eventType) {
142
142
  addDelegatedEventHandlerToHost(eventType, host);
143
143
  });
@@ -0,0 +1,9 @@
1
+ {
2
+ "dependencies": [
3
+ {
4
+ "type": "require",
5
+ "path": "./index",
6
+ "run": true
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,32 @@
1
+ "use strict"; /**
2
+ * Define a new UI component that includes component and renderer.
3
+ *
4
+ * @param {Object} def The definition of the UI component (component methods, component constructor, rendering methods, etc.)
5
+ * @return {Component} The resulting Component with renderer
6
+ */
7
+ var defineRenderer;
8
+ var defineWidget;
9
+
10
+ module.exports = function defineComponent(def) {
11
+ // eslint-disable-next-line no-constant-condition
12
+
13
+
14
+
15
+
16
+ if (def.E_) {
17
+ return def;
18
+ }
19
+
20
+ var renderer;
21
+
22
+ if (def.template || def.renderer) {
23
+ renderer = defineRenderer(def);
24
+ } else {
25
+ throw new Error('Expected "template" or "renderer"');
26
+ }
27
+
28
+ return defineWidget(def, renderer);
29
+ };
30
+
31
+ defineRenderer = require("./defineRenderer-legacy");
32
+ defineWidget = require("./defineWidget-legacy");