UNPKG

64.5 kBMarkdownView Raw
1# Changelog
2
3# 4.x
4
5## 4.18.x
6
7### 4.18.6
8
9- Migration does not add `id:scoped` when migrating a repeated `w-id` [#1377](https://github.com/marko-js/marko/pull/1377)
10- Fixes an issue diffing the selected option within an optgroup [#1376](https://github.com/marko-js/marko/pull/1376)
11- Fixes component tracking for client-reorder [#1375](https://github.com/marko-js/marko/pull/1375)
12- Improve the migration for legacy `<for>` syntax [#1374](https://github.com/marko-js/marko/pull/1374)
13- Add migration for named classes in the template [#1372](https://github.com/marko-js/marko/pull/1372)
14
15### 4.18.5
16
17- Fix issue with invoke tag migration when a inline control flow is used [#1366](https://github.com/marko-js/marko/pull/1366)
18
19### 4.18.4
20
21- Lazily evaluate attributes for dynamic tags [#1365](https://github.com/marko-js/marko/pull/1365)
22
23### 4.18.3
24
25- Fix `registerTaglib`: use correct function call [#1363](https://github.com/marko-js/marko/pull/1363)
26- Fix tryonline: correct paths and no `taglibImports` [#1360](https://github.com/marko-js/marko/pull/1360)
27- Migration fix: [#1364](https://github.com/marko-js/marko/pull/1364)
28- Migration improvement: deprecation warnings that are automatically migratable now have a `MIGRATION` heading [#1364](https://github.com/marko-js/marko/pull/1364) (also included test improvements)
29- Migration improvement: remove empty `<layout-put>` tags [#1355](https://github.com/marko-js/marko/pull/1355)
30
31### 4.18.2
32
33- Fixes an issue where fragments could remove nodes from their siblings [#1359](https://github.com/marko-js/marko/pull/1359)
34
35### 4.18.1
36
37- Fixes a regression with `body-only-if` and a legacy control flow attribute [#1356](https://github.com/marko-js/marko/pull/1356)
38
39### 4.18.0
40
41- Added dynamic tags to act like body-only-if. If dynamic tags are null then the outer tag will not be rendered. However, the body will be rendered. Deprecated body-only-if [#1332](https://github.com/marko-js/marko/pull/1332)
42
43### 4.17.5
44
45- Fix issue where setting the `value` attribute of a textarea to `false` caused the string `"false"` to be used in the vdom. [#1348](https://github.com/marko-js/marko/issues/1348)
46
47### 4.17.4
48
49- Updates htmljs-parser to fix an issue with comments inside inline scriptlets.
50- Fix some issues with for loop auto keying. [#1346](https://github.com/marko-js/marko/issues/1346)
51- Fix error when using a non string as a key (now logs a deprecation). [#1344](https://github.com/marko-js/marko/issues/1344)
52
53### 4.17.3
54
55- Fix issue were `getEls` would not work with repeated keys for split components. [#1343](https://github.com/marko-js/marko/issues/1343)
56
57### 4.17.2
58
59- Fix regression with namespaces in nested fragments. [#1340](https://github.com/marko-js/marko/issues/1340)
60
61### 4.17.1
62
63- Allow emitting events while the parent is mounting. [#1336](https://github.com/marko-js/marko/issues/1336)
64- Fix issue where `component.el` and `component.getEl` could return a marker node. [#1339](https://github.com/marko-js/marko/issues/1339)
65
66### 4.17.0
67
68- Element namespaces are now calculated at runtime, fixes some edge cases with the dynamic tag. [#1333](https://github.com/marko-js/marko/issues/1333)
69
70### 4.16.15
71
72- Fix an issue where nodes may be preserved if another node with the same key was rendered as preserved. [#1334](https://github.com/marko-js/marko/issues/1334)
73- Improve the `ignoreUnrecognizedTags` compiler option to ignored nested `@tags` on unrecognized tags (removes the need for the `escapeAtTags` option). [#1335](https://github.com/marko-js/marko/issues/1335)
74
75### 4.16.14
76
77- Prevent treating macro usage with parameters as a component. [#1326](https://github.com/marko-js/marko/issues/1326)
78
79### 4.16.13
80
81- Fixes a regression with printing nested unary expressions (eg typeof). [#1323](https://github.com/marko-js/marko/issues/1323)
82
83### 4.16.12
84
85- fix destorying a component that has already removed some top-level nodes [#1321](https://github.com/marko-js/marko/issues/1321)
86- fix components runtime path after refactor released in 4.16.11 [#1322](https://github.com/marko-js/marko/issues/1322)
87
88### 4.16.11
89
90- Fixes a regression (syntax) in IE 11 introduced in 4.16.10
91
92### 4.16.10
93
94- Hydrating components now consistently render from the top down. [#1317](https://github.com/marko-js/marko/issues/1317)
95
96### 4.16.9
97
98- Fixes an issue where legacy widgets could loose a reference to their parent components. [#1311](https://github.com/marko-js/marko/issues/1311)
99
100### 4.16.8
101
102- Fixes an issue with hot-reload. [#1282](https://github.com/marko-js/marko/issues/1282)
103- If the require hook is enabled, all templates loaded by marko will now use the require hook, including hot-reloaded templates and tags loaded from compiled templates. [#1310](https://github.com/marko-js/marko/pull/1310)
104
105### 4.16.7
106
107- Improve parsing of tag arguments (allows for `<${input.renderBody}(...spread)/>`). [#1308](https://github.com/marko-js/marko/pull/1308)
108
109### 4.16.6
110
111- Fix issue with hydrating legacy Marko 3 widgets from the server. [#1306](https://github.com/marko-js/marko/pull/1306)
112
113### 4.16.5
114
115- Fix regression with legacy dynamic attributes when a string without whitespace is used. [#1304](https://github.com/marko-js/marko/pull/1304)
116- The `disabled` property on buttons is now properly synced with the template. [#1303](https://github.com/marko-js/marko/pull/1303)
117
118### 4.16.4
119
120- Fix regression with migrating legacy `<macro>` syntax with a magic `renderBody` variable. [#1300](https://github.com/marko-js/marko/pull/1300)
121
122### 4.16.3
123
124- Fix issue with migrating `<var>` and `<assign>` with `widget` properties. [#1298](https://github.com/marko-js/marko/pull/1298)
125
126### 4.16.2
127
128- Fix issue with nested fragments (often as dynamic tags) that were adjacent in the DOM not hydrating properly. [#1294](https://github.com/marko-js/marko/pull/1294)
129- Remove redundant portion of keys for `<macro>` tags within `<for>` loops. [#1295](https://github.com/marko-js/marko/pull/1295)
130
131### 4.16.1
132
133- Fix regression for `:no-update` on dynamic tag html attributes. [#1292](https://github.com/marko-js/marko/pull/1292)
134
135### 4.16.0
136
137- Add `<marko deprecated-no-create-or-input-for-top-level-hydrate />` option to revert to pre `4.9.0` hydrate behavior. [#1289](https://github.com/marko-js/marko/pull/1289)
138
139## 4.15.x
140
141### 4.15.6
142
143- Fix regression in older browsers caused by using `string.startsWith` in the runtime code.
144
145### 4.15.5
146
147- Allow syntax that Marko does not understand (but esprima does) to pass through in the arguments syntax. [#1286](https://github.com/marko-js/marko/pull/1286)
148- Fix issue with `<title>` inside of an `<svg>` using the wrong namespace. [#1284](https://github.com/marko-js/marko/pull/1284)
149
150### 4.15.4
151
152- Forward errors from `<await client-reorder>` to the parent out to prevent potential unhandled rejections. [#1275](https://github.com/marko-js/marko/pull/1275)
153
154### 4.15.3
155
156- Fix false positive deprecation message for legacy nested tag syntax. [#1271](https://github.com/marko-js/marko/pull/1271)
157
158### 4.15.2
159
160- Improve the webpack server-bundling experience by guarding a legacy (lasso-specific) api that uses a dynamic require and causes a warning to be emitted. [#1267](https://github.com/marko-js/marko/pull/1267)
161
162### 4.15.1
163
164- Improve support for using raw functions as event handlers by not outputing `data-marko` content for components that will rerender in the browser. [#1262](https://github.com/marko-js/marko/pull/1262)
165
166### 4.15.0
167
168The most notable change here is to the `<for>`, `<macro>` and `<await>` core tags. These tags previously each relied on custom syntax to implement an API that was not possible to do in userland when they were introduced. Generic solutions for these problems has arrived in the form of [attribute tags](https://markojs.com/docs/syntax#attribute-tag) and [tag parameters](https://markojs.com/docs/syntax#parameters).
169
170With these new features in place and currently available in userland we set out to normalize these existing tags, hopefully making the learning process for Marko a little easier, and also promoting the use of these new features. We've also spent time formalizing some best practices, and highlighting this new syntax in the documentation on the [markojs.com](https://markojs.com) website.
171
172The existing syntax will continue to be supported until Marko 5 and will currently log a deprecation warning. For these deprecations and most others you can automatically migrate existing code using the [marko migrate](https://github.com/marko-js/cli/blob/master/packages/migrate/README.md) cli tool.
173
174- Updated documentation with guides and changes to syntax/core tags. [#1260](https://github.com/marko-js/marko/pull/1260)
175- Modernize the [`<for>` tag](https://markojs.com/docs/core-tags#for). [#1238](https://github.com/marko-js/marko/pull/1238)
176- Modernize the [`<await>` tag](https://markojs.com/docs/core-tags#await). [#1244](https://github.com/marko-js/marko/pull/1244)
177- Modernize the [`<macro>` tag](https://markojs.com/docs/core-tags#macro). [#1227](https://github.com/marko-js/marko/pull/1227)
178- Deprecated legacy top level imports (jquery/ready) and compiler option tags (recommended to use marko.json instead). [#1258](https://github.com/marko-js/marko/pull/1258)
179- Modern arguments support for the dynamic tag. [#1259](https://github.com/marko-js/marko/pull/1259)
180- Improves parsing inside of the `<html-comment>` tag to support the same style of content as actual html comments. [#1261](https://github.com/marko-js/marko/pull/1261)
181- Ignore only whitespace content inside of concise mode tags (including `class` and `style`) which would previously error. [#1256](https://github.com/marko-js/marko/pull/1256)
182- Fixes a regression with passing a string literal as a `${dynamic}` attribute and add a deprecation warning. [#1257](https://github.com/marko-js/marko/pull/1257)
183
184## 4.14.x
185
186### 4.14.25
187
188- Fix regression with non standard template literals (`"stuff ${placeholder}"`) that have escaped content such as newlines [#1254](https://github.com/marko-js/marko/pull/1254)
189
190### 4.14.24
191
192- Fix regression in `<await>` that caused flushing to not occur in all cases [#1252](https://github.com/marko-js/marko/pull/1252)
193
194### 4.14.23
195
196- Fix warning that `"marko"` was using deprecated features. [#1250](https://github.com/marko-js/marko/pull/1250)
197- Improve code optimization for conditional `@nested` tags. [#1249](https://github.com/marko-js/marko/pull/1249)
198
199### 4.14.22
200
201- Fix issue with `no-update` not moving preserved items [#1247](https://github.com/marko-js/marko/pull/1247).
202- Fix regression with include tag migration where `<include(data())>` has side effects. [#1246](https://github.com/marko-js/marko/pull/1246)
203- Treat importing tags the same as using them in the template (uses `load` api instead of `require` when configured). [#1245](https://github.com/marko-js/marko/pull/1245)
204- Gracefully handle async client-reorder when nodes are missing during hydrate. [#1243](https://github.com/marko-js/marko/pull/1243)
205
206### 4.14.21
207
208- Update `htmljs-parser` to improve parsing regexes [htmljs-parser #61](https://github.com/marko-js/htmljs-parser/pull/61)
209
210### 4.14.20
211
212- Add new `<tag|params|>` support and migrator for old syntax/flag [#1236](https://github.com/marko-js/marko/pull/1236)
213- Remove unneeded deprecation warning when using `component` within a template [#1235](https://github.com/marko-js/marko/pull/1235)
214
215### 4.14.19
216
217- Fixes walking into some AST nodes which was causing some migrations to not be as effective [#1233](https://github.com/marko-js/marko/pull/1233)
218
219### 4.14.18
220
221- Fixes [#1230](https://github.com/marko-js/marko/issues/1230) - regression with include tag migration outputing invalid identifiers [#1231](https://github.com/marko-js/marko/pull/1231)
222- Add migration for legacy nested tag syntax [#1129](https://github.com/marko-js/marko/pull/1129)
223
224### 4.14.17
225
226- Fixes [#1219](https://github.com/marko-js/marko/issues/1219) - transitive widget getEl and events [#1225](https://github.com/marko-js/marko/pull/1225)
227- Importing a marko template adds it to tags meta (fixes regression with `<include>` tag) [#1226](https://github.com/marko-js/marko/pull/1226)
228
229### 4.14.16
230
231- Add migration for non-standard template literals. [#1224](https://github.com/marko-js/marko/pull/1224)
232- Fix regression with dynamic attribute migration. [#1223](https://github.com/marko-js/marko/pull/1223)
233
234### 4.14.15
235
236- Improve migrating `widget` references to `component` in attributes. [#1220](https://github.com/marko-js/marko/pull/1220)
237
238### 4.14.14
239
240- Fix regression with `eval`ing class names in debug mode. [#1218](https://github.com/marko-js/marko/pull/1218)
241
242### 4.14.13
243
244- Support file name migrations with Marko migrate. [#1216](https://github.com/marko-js/marko/pull/1216)
245- Skip `id:scoped` when migrating w-id for custom tags. [#1217](https://github.com/marko-js/marko/pull/1217)
246
247### 4.14.12
248
249- Add migrator for `w-config` attribute. [#1214](https://github.com/marko-js/marko/pull/1214)
250- Add migrator for and deprecate `unless` tag/directive. [#1210](https://github.com/marko-js/marko/pull/1210)
251
252### 4.14.11
253
254- Fix regression with `w-body` tag. [#1213](https://github.com/marko-js/marko/pull/1213)
255
256### 4.14.10
257
258- Add migrator for `ref` attribute. [#1207](https://github.com/marko-js/marko/pull/1207)
259- Fix regression with `var` tag and `w-body/include` tags. [#1212](https://github.com/marko-js/marko/pull/1212)
260
261### 4.14.9
262
263- Add migrator for layout tags and include tag/directive. [#1206](https://github.com/marko-js/marko/pull/1206) & [#1204](https://github.com/marko-js/marko/pull/1204)
264- Add migrator for `<script template-helpers>` and `<script marko-init>`. [#1209](https://github.com/marko-js/marko/pull/1209)
265
266### 4.14.8
267
268- Add migrator from w-body to dynamic tag. [#1199](https://github.com/marko-js/marko/pull/1199)
269- Add migrator from dynamic attributes to spread attributes. [#1202](https://github.com/marko-js/marko/pull/1202)
270
271### 4.14.7
272
273- Fix regression for `widget.elId` migration. [#1198](https://github.com/marko-js/marko/pull/1198)
274
275### 4.14.6
276
277- Add a whitelist of files to publish to NPM. [#1197](https://github.com/marko-js/marko/pull/1197)
278
279### 4.14.5
280
281- Add `getTemplateData` migrator. [#1195](https://github.com/marko-js/marko/pull/1195)
282- Add migrators for most of the `w-*` attributes. [#1190](https://github.com/marko-js/marko/pull/1190)
283- Add basic legacy widget migration. [#1192](https://github.com/marko-js/marko/pull/1192)
284
285### 4.14.4
286
287- Fix regression with `setProps` on legacy compatibility layer. [#1193](https://github.com/marko-js/marko/pull/1193)
288
289### 4.14.3
290
291- Move `w-on` compatibility to the migrate stage. [#1186](https://github.com/marko-js/marko/pull/1186)
292- Legacy compatibility (v3) improvements. [#1189](https://github.com/marko-js/marko/pull/1189)
293- Specially handle template literals in templates. [#1188](https://github.com/marko-js/marko/pull/1188)
294
295### 4.14.2
296
297- Convert the `<async-fragment>` transformer into a migrator. [#1185](https://github.com/marko-js/marko/pull/1185)
298
299### 4.14.1
300
301- Fix regression causing some parsed javascript nodes to be omitted from output. [#1184](https://github.com/marko-js/marko/pull/1184)
302
303### 4.14.0
304
305- Add migration stage, deprecate rendering with `out`, deprecate control-flow directive as attributes. [#1180](https://github.com/marko-js/marko/pull/1180)
306- parse = parseRaw + normalize [#1179](https://github.com/marko-js/marko/pull/1179)
307- parse nonstandard string with placeholder to TemplateLiteral node, transpile template literals. [#1179](https://github.com/marko-js/marko/pull/1179)
308- add new parse api
309
310## 4.13.x
311
312### 4.13.13
313
314- Fix regression: parsing of `if` statements without braces (in scriptlets & otherwise). [#1175](https://github.com/marko-js/marko/pull/1175)
315- Fix regression: `<var>` and `<assign>` tags with non-standard placeholders in normal string attributes. [#1176](https://github.com/marko-js/marko/pull/1176)
316
317### 4.13.12
318
319- `<invoke>` tag translates to modern Marko scriptlet (or dynamic tag). [#1165](https://github.com/marko-js/marko/pull/1165)
320- `<assign>` tag translates to modern Marko scriptlet. [#1158](https://github.com/marko-js/marko/pull/1158)
321- Imperative rendering in scriptlets translates to modern Marko dynamic tag. [#1174](https://github.com/marko-js/marko/pull/1174)
322
323### 4.13.11
324
325- Add spread attribute optimization, fix issue with spreading non objects. [#1171](https://github.com/marko-js/marko/pull/1171)
326- Move `#` to the start of `:scoped` attributes (allows for `href:scoped="#name"`). [#1172](https://github.com/marko-js/marko/pull/1172)
327
328### 4.13.10
329
330- Adds a hidden api used to make [@marko-tags/context](https://github.com/marko-js/tags/tree/master/tags/context) possible. [#1168](https://github.com/marko-js/marko/pull/1168)
331
332### 4.13.9
333
334- Improve support for [arc]() by normalizing file system names with square brackets. [#1166](https://github.com/marko-js/marko/pull/1166)
335
336### 4.13.8
337
338- Quick patch for `4.13.7` that removes a `let` assignment. [#1153](https://github.com/marko-js/marko/pull/1153)
339
340### 4.13.7
341
342- Prevent treating components with tag params being treated as implicit components. [#1149](https://github.com/marko-js/marko/pull/1149)
343
344### 4.13.6
345
346- Prevent mutating component input when using a single spread attribute with repeated @tags. [#1142](https://github.com/marko-js/marko/pull/1142)
347- Fix for include tag hydration when transcluded. [#1143](https://github.com/marko-js/marko/pull/1143)
348
349### 4.13.5
350
351- Add additional reference to fragment nodes which resolves an issue with IE. [#1130](https://github.com/marko-js/marko/pull/1130)
352
353### 4.13.4
354
355- Remove Object.assign calls in the browser. [#1120](https://github.com/marko-js/marko/pull/1120)
356
357### 4.13.3
358
359- Propagate errors to express automatically with the `res.marko` api. [#1119](https://github.com/marko-js/marko/pull/1119)
360- Support multi line import statments. [#1118](https://github.com/marko-js/marko/pull/1118)
361
362### 4.13.2
363
364- Allow discovering tags where the template name matches the directory name [#1117](https://github.com/marko-js/marko/pull/1117):
365
366```
367components/
368 tag-name/
369 tag-name.marko
370 tag-name.style.css
371```
372
373### 4.13.1
374
375- Remove es2015 features from runtime. [#1115](https://github.com/marko-js/marko/pull/1115)
376
377### 4.13.0
378
379#### PR #1094
380
381**Introducing HTMLFragment**
382
383- Updates the diffing algorithm to use an HTMLFragment node as an abstraction rather than keeping track of startNode and endNode all throughout the diffing algorithm.
384- Uses the HTMLFragment for the `<${dynamic}>` tag and `<include>` tags to preserve server-rendered content for which the `renderBody` is not available in the browser.
385
386**Changes to keys**
387
388- Component ids are based on the resulting parent tree (not the owner tree). This means we cannot rely on the ids in the global lookup, so component key/refs are now also stored on the component instance.
389- Autokeyed elements are now stored on the parent rather than the owner. User assigned key/refs are still stored on the owner component. Because of this, user assigned keys are now prefixed to differentiate them from autokeys. This also has the benefit that assigning numeric keys can no longer conflict with the autokeys.
390- Static node trees are now only auto assigned a key for the top-level node (instead of all nodes). This is because:
391 - When updating, only the top-level node is considered.
392 - When static nodes are hoisted out of the render method, they are not associated with the owner component
393
394**Changes to Hydration**
395
396- Server comment starting markers now have the component's key serialized so the component can be attached to its owner
397- Server comment markers no longer have the id on the closing marker, it is stack based.
398- Normalize differences between hydration and client-rendering, so post mount the DOM looks the same regardless of whether a component was server or client rendered.
399
400## 4.12.x
401
402### 4.12.4
403
404- Don't render invalid attribute names on the server [#1103](https://github.com/marko-js/marko/pull/1103)
405
406### 4.12.3
407
408- Removes extra parentheses in output javascript for expressions that Marko does not understand.
409
410### 4.12.2
411
412- Fixes automatic keying of elements/components in `for()` attribute loops
413
414### 4.12.1
415
416- Fix #1022 - transcluded keys don't match, stateful component not preserved [#1086](https://github.com/marko-js/marko/pull/1086)
417
418### 4.12.0
419
420- Tag params [#1076](https://github.com/marko-js/marko/pull/1076)
421- Style arrays [#1082](https://github.com/marko-js/marko/pull/1082)
422- Fix #1075 - cannot compile dynamic tag at root with user key [#1081](https://github.com/marko-js/marko/pull/1081)
423- Fix #1078 - mutating spread attributes [#1080](https://github.com/marko-js/marko/pull/1080)
424
425## 4.11.x
426
427### 4.11.5
428
429- Add fallback location for compile-time deprecation warnings
430
431### 4.11.4
432
433- Fixes an issue with scoped attributes automatically setting keys in a problematic way [#1069](https://github.com/marko-js/marko/pull/1069)
434- Fixes #1059 and #1052 - `Cannot read property 'nextSibling' of null`
435
436### 4.11.3
437
438- Fixes #952
439- Fixes automatic keying of elements/components in `<for>` loops
440
441### 4.11.2
442
443- Fixes another regression in the `<${dynamic}>` tag where `dashed-case` attributes were being converted to `camelCase` when rendering html elements.
444
445### 4.11.1
446
447- Fixes a regression in `<${dynamic}>` tags for object/array class/style attributes:
448 ```marko
449 $ const style = { color:'blue' };
450 <${tagName} style=style/>
451 ```
452- Allows dynamic attributes defined using `...spread` to include object/array class/style [#933](https://github.com/marko-js/marko/pull/933):
453 ```marko
454 $ const attrs = { style:{ color:'blue' } };
455 <tag ...attrs/>
456 ```
457- Fixes issue where object/array class/style attributes could not be used with `...spread` [#1007](https://github.com/marko-js/marko/pull/1007):
458 ```marko
459 $ const attrs = {};
460 <tag class=["oops"] ...attrs/>
461 ```
462
463### 4.11.0
464
465- Implement #880: `<${dynamic}>` tag
466- `<include>` should be considered deprecated. Formal deprecation warning to come.
467
468## 4.10.x
469
470### 4.10.1
471
472- Fix issue with calling `require('marko/components').init(components)` multiple times.
473
474### 4.10.0
475
476- Fix #1049 Fix documentation urls on the website.
477
478## 4.9.x
479
480### 4.9.7
481
482- Fix #1038 Legacy compatibility dirty check returning false positives.
483
484### 4.9.6
485
486- Fix #1008 Spread attribute now supports functions (`..attrs()`) [#1029](https://github.com/marko-js/marko/pull/1029)
487
488### 4.9.5
489
490- Fix `onBeforeUpdate` timing for legacy component layer [#1027](https://github.com/marko-js/marko/pull/1027)
491
492### 4.9.4
493
494- Fix breaking older browsers with es6 object shorthand notation [bc0e91d5](https://github.com/marko-js/marko/commit/bc0e91d517d7b8de484c745a5734f15347ed0d26)
495
496### 4.9.3
497
498- Fix import-var compilation when there are no explicit attributes [#1002](https://github.com/marko-js/marko/pull/1002)
499
500### 4.9.2
501
502- Fixes collisions with multiple Marko runtimes on the same page. [#1019](https://github.com/marko-js/marko/pull/1019)
503- Switch to using prettier and eslint. [#1016](https://github.com/marko-js/marko/pull/1016)
504
505### 4.9.1
506
507- Fixes an issue with keyed elements not getting properly removed. [#1013](https://github.com/marko-js/marko/pull/1013)
508
509### 4.9.0
510
511- Fixes related to hydration, split components, and the legacy compatibility layer [#1010](https://github.com/marko-js/marko/pull/1010)
512
513- Fix paths for vdom dependencies [#1011](https://github.com/marko-js/marko/pull/1011)
514
515## 4.8.x
516
517### 4.8.0
518
519- Add `once-[event]` directive [#990](https://github.com/marko-js/marko/pull/990)
520
521- Improve testing setup [#989](https://github.com/marko-js/marko/pull/989)
522
523## 4.7.x
524
525### 4.7.5
526
527- Update docs for advanced attribute definition [#968](https://github.com/marko-js/marko/pull/968)
528
529- Improve error message for async rendering [#958](https://github.com/marko-js/marko/pull/958)
530
531### 4.7.4
532
533- Make jQuery optional for legacy components [#951](https://github.com/marko-js/marko/pull/951)
534
535### 4.7.3
536
537- Prevent onRender running on the server for legacy widgets
538
539### 4.7.2
540
541- Fixes [#946](https://github.com/marko-js/marko/issues/946) - don't put legacy init code in a separate lasso bundle
542
543- Fixes allowing conditionally binding to different roots in a legacy widget [#944](https://github.com/marko-js/marko/pull/944)
544
545### 4.7.1
546
547- Fix issue with multiple top level elements being removed twice. [#940](https://github.com/marko-js/marko/pull/940)
548
549### 4.7.0
550
551- Add jQuery legacy compatibility layer support [#937](https://github.com/marko-js/marko/pull/937)
552
553- Reorganize Marko tests [#934](https://github.com/marko-js/marko/pull/934)
554
555- Switch to using jsdom in test suite [#935](https://github.com/marko-js/marko/pull/935)
556
557- Decouple component hydration from Lasso [#929](https://github.com/marko-js/marko/pull/929)
558
559## 4.6.x
560
561### 4.6.0
562
563- Fixes [#914](https://github.com/marko-js/marko/issues/914) and [#920](https://github.com/marko-js/marko/issues/920) -
564 Resolves top-level component bugs
565
566- Setup `marko.load()` to prefer precompiled templates from [marko-cli](https://github.com/marko-js/marko-cli)
567
568- Various compiler changes to improve [marko-migrate](https://github.com/marko-js/marko-migrate)
569
570- Fixes [#916](https://github.com/marko-js/marko/pull/916) - Add Marko debug mode.
571 Adds babel plugin to remove and statically evaluate 'MARKO_DEBUG' literals for
572 adding deprecation warnings and hints for the runtime without a performance
573 penalty for production builds.
574
575## 4.5.x
576
577### 4.5.6
578
579- Fixes [#909](https://github.com/marko-js/marko/issues/909) - Fix condition preventing bubbling DOM events from properly being attached to a component.
580
581### 4.5.5
582
583- Add 10 Awesome Marko Features article to documentation
584
585### 4.5.4
586
587- Fixes [#904](https://github.com/marko-js/marko/issues/904) - The loop status variable is not compiling when the equal sign is padded in spacing
588
589### 4.5.3
590
591- Fixes [#903](https://github.com/marko-js/marko/issues/903) - Special unicode chars (\u2028 and \u2029) need to be escaped if within script tag
592
593### 4.5.2
594
595- Fixes [#899](https://github.com/marko-js/marko/issues/899) - Keyed element could be incorrectly removed after DOM diffing/patching in case of HTML element mismatch for elements with the same key. [PR #900](https://github.com/marko-js/marko/pull/900)
596
597### 4.5.1
598
599- Fixes [#893](https://github.com/marko-js/marko/issues/893) - Keyed element could be incorrectly removed after DOM diffing/patching in case of HTML element mismatch for elements with the same key. [PR #894](https://github.com/marko-js/marko/pull/894) by [@westtrade](https://github.com/westtrade)
600
601### 4.5.0
602
603Summary of changes across all beta releases for the `4.5.0` release:
604
605- Fixes [#886](https://github.com/marko-js/marko/issues/886) - Write component initialization code when async out and all of its nested async outs finish
606- Fixes [#854](https://github.com/marko-js/marko/issues/854) - Make every .marko file a UI component ([PR #855](https://github.com/marko-js/marko/pull/855))
607- Added support for the `:scoped` modifier on attributes and deprecated `:key`:
608
609```marko
610<label for:scoped="name">Name</label>
611<input id:scoped="name" value="Frank"/>
612```
613
614- Fixes [#817](https://github.com/marko-js/marko/issues/817) - Support dynamic root elements
615- Marko no longer attaches `id` attributes to elements for purposes of keyed matching
616 - Keyed elements are maintained in an internal, per-component lookup
617- Keys are now assigned to all custom tags and HTML elements at compile-time to improve reliability and performance of DOM diffing
618- Optimized internal bookkeeping required during rendering a UI component tree (no more UI component stack)
619- DOM diffing/patching changes:
620 - Significant performance improvements
621 - morphdom is now UI component-aware
622
623### 4.5.0-beta.3
624
625- Fixes [#854](https://github.com/marko-js/marko/issues/854) - Make every .marko file a UI component ([PR #855](https://github.com/marko-js/marko/pull/855))
626
627### 4.5.0-beta.2
628
629- Add ids for any key when component.elId/getElId is used as an attribute value
630- Use indexOf instead of includes to support Node 4
631- [docs] Fixes [#841](https://github.com/marko-js/marko/issues/841) - `docs/components.md` refers to deprecated "data" variable [#842](https://github.com/marko-js/marko/pull/842)
632
633### 4.5.0-beta.1
634
635- Add back (legacy) support for component.elId + key in template
636- Fixes [#837](https://github.com/marko-js/marko/issues/837) - Update esprima to the latest to support async/await and ES2017 inside of components. ([PR #839](https://github.com/marko-js/marko/pull/839))
637- Fixes key/scope for attributes that have dashes in the name
638
639### 4.5.0-beta.0
640
641- Fixes [#817](https://github.com/marko-js/marko/issues/817) - Support dynamic root elements
642- Marko no longer attaches `id` attributes to elements for purposes of keyed matching
643 - Keyed elements are maintained in an internal, per-component lookup
644- Keys are now assigned to all custom tags and HTML elements at compile-time to improve reliability and performance of DOM diffing
645- Optimized internal bookkeeping required during rendering a UI component tree (no more UI component stack)
646- DOM diffing/patching changes:
647 - Significant performance improvements
648 - morphdom is now UI component-aware
649
650## 4.4.x
651
652### 4.4.28
653
654- fix undefined reference error in Component.js
655- Increase mocha timeout to avoid CI build's failing [#821](https://github.com/marko-js/marko/pull/821)
656
657### 4.4.27
658
659- Add ability to update globals by setting new input.
660- [docs] Remove unneeded command from installation docs
661- [docs] Update installing.md
662
663### 4.4.26
664
665- Add better interop for importing modules with default exports [#803](https://github.com/marko-js/marko/pull/803)
666
667### 4.4.25
668
669- Fixes #778 - Fix Marko compiler generating incorrect path for requires on Windows.
670
671### 4.4.24
672
673- [docs] Update installing.md
674
675### 4.4.23
676
677- Fixes #796 - Fix events for event targets that are SVGElementInstance types in IE11.
678- Used shortcut for escapeAtTags;
679- Added `escapeAtTags` options in order to render `<@tags>` as they are;
680- simplify a condition judgement in components-jquery
681- Fixes #790 - Class tag should not allow nested body content.
682- Update `compile/index.js` test description
683- Update handleRootNodes.js [#747](https://github.com/marko-js/marko/pull/747)
684- [docs] Fix reference to lifecycle section in docs.
685
686### 4.4.22
687
688- Fixes #784 - Fix compiled preserve-attrs path.
689- [testing] Fix express tests [#779](https://github.com/marko-js/marko/pull/779)
690- [docs] Update webpack.md
691
692### 4.4.21
693
694- Updated description in `package.json`
695
696### 4.4.20
697
698- update bindComponentVar to use dynamic location
699- updating location of bindComponent helper
700
701### 4.4.19
702
703- [testing] Fix key suffix test assertions.
704- Address key suffix feedback. Additional tests.
705- [morphdom] Removed bad and unhelpful optimization to avoid infinite loops
706- [morphdom] Ensure `onBeforeNodeDiscarded` is only called once by looking to see if the node is still attached.
707- [morphdom] Infinite loop fix in morphdom
708- Fixes #761 - component.elId() does not work on the server
709- Fixes #755 - Allow diffing of HTML, head, and body. [#756](https://github.com/marko-js/marko/pull/756)
710- [docs] Updated component docs
711- [docs] Use relative link for image
712- [testing] User default npm version for each Node.js version
713
714### 4.4.18
715
716- Fixes #749 #690 - Do not rely on root node having an ID on rerender and properly handle style root nodes.
717
718### 4.4.17
719
720- Put package (`browser.json`) deps before others and parent deps before child deps [#750](https://github.com/marko-js/marko/pull/750)
721- [docs] Fix typo in redux.md
722- [docs] Add redux document to structure.json
723- [docs] Add doc describing how to use Redux with Marko.
724
725### 4.4.16
726
727- Fix duplicate body variable
728
729### 4.4.15
730
731- Fixes #739 - Should not attempt to check instanceof of type Map if it does not exist in the browser.
732- Added build scripts
733
734### 4.4.14
735
736- Fixes issue with renderToString not rendering text nodes
737
738### 4.4.13
739
740- Fixes #721 - Add a Code of Conduct
741- Fixes #655 - Implement renderToString in the browser.
742
743### 4.4.12
744
745- Fixes #695 - Always ignore unrecognized tags for XML files when using the compiler.
746- Fixes #705 - Throw error when the root HTML element is a component and has a dynamic id attribute.
747- [testing] Additional test for root node with dynamic id of a component with a component.js file.
748
749### 4.4.11
750
751- Fixes #728 - Do not use module keyword because webpack compiles it to a custom object.
752- Fixes #719 - Support Express 4 and Express 5.
753- fixes #658 by removing empty style blocks [#715](https://github.com/marko-js/marko/pull/715)
754- fixes #688 - add reference to browser.json in meta dependencies
755- [docs] Fix broken link
756- [docs] Fix Marko syntax in docs causing compilation errors on the website.
757- [docs] Change pixels to percent in doc images.
758- [testing] Purge express cache so that express tests both use correct module versions.
759
760### 4.4.9
761
762- Revert "Fixes #705 - Throw error when the root HTML element has a dynamic id …"
763- [testing] Only run Node 4, 6, & 8 in travis
764
765### 4.4.8
766
767- [docs] Clean up why-is-marko-fast.md
768- [docs] Clean up marko-vs-react.md
769
770### 4.4.7
771
772- Add silent option to browser-refresh and hot-reload
773- Check id attribute for Literal. Update error message to include error page.
774- Fixes #705 - Throw error when the root HTML element has a dynamic id attribute.
775- [docs] Clean up components.md
776- [docs] Fix typo in webpack.md
777- [testing] give extra time for test timing out in travis
778- [testing] run tests on node 8
779- [testing] ignore test-dist from coverage
780
781### 4.4.6
782
783- Fixes #693 - [SSR] Improved handling of top-level UI components with renderBody func
784- Switching to using `prepublish` with npm@5
785
786### 4.4.3
787
788- Use parent module to require express patch [#701](https://github.com/marko-js/marko/pull/701)
789- [docs] Reference app should point to "marko-lasso" because "ui-components-playground" does not contain lasso
790- [docs] Add articles section to docs.
791
792### 4.4.2
793
794- Build fixes related to compiler
795
796### 4.4.0
797
798- Improve no-update-if condition check
799- Compatibility improvements for Try Online
800- Code size reduction
801- Introduced src/ and dist/ folders for optimized production builds
802- Fixes #695 - Default to ignoring unrecognized tags for XML files.
803
804## 4.3.x
805
806### 4.3.1
807
808- Add basic test for ensuring that res.marko returns a promise.
809- enable res.marko can catch a error safe
810
811### 4.3.0
812
813- [compiler] Added more control over how attributes are targeted to props
814- Don't add root markers to tags that don't produce output
815- [docs] Added docs for Marko + Huncwot integration
816- [AST] Added `node.removeChildren()`
817- Extend marko globals with defaults
818
819### 4.3.0-beta.4
820
821- Fixes #673 - Circular dependency is causing problems with Webpack
822
823### 4.3.0-beta.3
824
825- Changes related to #670 - Globals must be serialized earlier to allow early mount of UI components in
826- [docs] Improved docs for SSR
827
828### 4.3.0-beta.2
829
830- Fixes for #670 - Add support for serialized globals and retain globals on re-render
831
832## 4.2.x
833
834### 4.2.8
835
836- Bug: Fixes [#661](https://github.com/marko-js/marko/issues/661) - Component initialization code may end up in the wrong place
837- Bug: Fixes [#668](https://github.com/marko-js/marko/issues/668) - Declarative event listeners are now allowed on the `<include>` tag
838
839### 4.2.7
840
841- Bug: Fixes [#650](https://github.com/marko-js/marko/issues/650) - The tag "await" does not support attribute "unless"
842- Improvements to legacy state
843
844### 4.2.6
845
846- Bug: Fixes [#654](https://github.com/marko-js/marko/issues/654) - Bug: components implementing a `key` attribute break in Marko v4
847- Improvements to legacy compatibility layer
848
849### 4.2.5
850
851- Improved support for UI components implemented using native JavaScript class in a separate file
852- Improved how legacy layout tags are handled by Marko v4
853
854### 4.2.4
855
856- Bug: Fixes [#653](https://github.com/marko-js/marko/issues/653) - Event handlers are no longer bound in edge case
857
858### 4.2.3
859
860- Bug: Fixes [#649](https://github.com/marko-js/marko/issues/649) - New line always added to `textarea` and other elements for single line/delimited HTML blocks
861
862### 4.2.2
863
864- Bug: Fixes [#648](https://github.com/marko-js/marko/issues/648) - Style attribute object and lengths not handled properly
865
866### 4.2.1
867
868- Bug: Fixed [#644](https://github.com/marko-js/marko/issues/644) - Attribute not rendered by Marko is not preserved if component first rendered on the server
869- [Performance] Escaping is not needed for the `data-marko` attribute
870
871### 4.2.0
872
873- Bug: Fixed [#629](https://github.com/marko-js/marko/issues/629) - VDOM: Rendering unescaped HTML produces non-functioning HTML input controls
874- Bug: Fixed [#634](https://github.com/marko-js/marko/issues/634) - writeInitComponentsCode is not a function
875- Enhancement: Added support to allow improved precompiling of templates
876- Enhancement: Fixed [#636](https://github.com/marko-js/marko/issues/636) - Add error when macro with duplicate name is found
877- Performance: Optimized diffing/patching to avoid indexing entire tree to find keyed elements
878- Performance: Optimized how event handlers are attached to VDOM nodes (separated from attributes)
879
880## 4.1.x
881
882### 4.1.3
883
884- Bug: Fixed losing cursor position in Edge (see [morphdom PR #100](https://github.com/patrick-steele-idem/morphdom/pull/100) by [@zastavnitskiy](https://github.com/zastavnitskiy))
885- Bug: Ignore `xmlns` attributes when virtualizing real DOM nodes (needed when inserting an HTML string when rendering to a VDOM)
886
887### 4.1.2
888
889- Bug: Fixed [#623](https://github.com/marko-js/marko/issues/623) - Uncaught TypeError: `toEl.$__hasAttribute` is not a function
890- Bug: Fixed [#619](https://github.com/marko-js/marko/issues/619) - Deprecated `constructor()` for UI component classes
891
892### 4.1.1
893
894- Added `"use strict";` to restore Node.js compatibility for Node.js v4 and v5
895
896### 4.1.0
897
898- Bug: Fixes [#611](https://github.com/marko-js/marko/issues/611) - Component IDs are not being assigned correctly when intermediate non-component is rendered
899- Performance: SVG namespaced elements are now resolved determined at compile-time
900- Performance: Merged in `morphdom` and optimized for Marko
901- Performance: Optimized diffing/patching of elements with only simple attributes in the following set: `class`, `id` and `style`
902
903## 4.0.x
904
905### 4.0.1
906
907- Bug: Fixes [#612](https://github.com/marko-js/marko/issues/612) - Compile error when class method has empty `return`
908- Bug: Fixes [#604](https://github.com/marko-js/marko/issues/604) - `no-update` attributes error when first rendered on the server
909- Bug: Fixes [#608](https://github.com/marko-js/marko/issues/608) - Component losing `renderBody` input on a particular redraw
910- Enhancement: Fixes [#606](https://github.com/marko-js/marko/issues/606) - named single-file component doesn't work
911
912### 4.0.0
913
914- Marko v4! [Release Announcement](https://medium.com/@mlrawlings/marko-4-0-is-here-837884c5f60d)
915
916# 3.x
917
918## 3.13.x
919
920### 3.13.2
921
922- Fixed [#478](TagLookup fails when merging taglibs) - TagLookup fails when merging taglibs
923
924### 3.13.1
925
926- Fixes [#465](https://github.com/marko-js/marko/issues/465)
927
928### 3.13.0
929
930## 3.12.x
931
932### 3.12.0
933
934- Added warnings for using render methods when you want string output ([Pull Request #450](https://github.com/marko-js/marko/pull/450) by [@mlrawlings](https://github.com/mlrawlings))
935
936## 3.11.x
937
938### 3.11.8
939
940- Fixes [#382](https://github.com/marko-js/marko/issues/382) - Local variable for tag should have prefix or suffix to avoid conflict
941
942### 3.11.7
943
944- Fixes [#381](https://github.com/marko-js/marko/issues/381) - `$global` broken when using `template.stream()`
945
946### 3.11.6
947
948- Internal change: `AsyncWriter``AsyncStream`
949
950### 3.11.5
951
952- (no changes)
953
954### 3.11.4
955
956- Update to `async-writer@2`
957
958### 3.11.3
959
960- Silently ignore errors when parsing tag definition code inlined in JavaScript
961
962### 3.11.2
963
964- Fixed [#318](https://github.com/marko-js/marko/issues/318) - Use compiler options passed to require hook to configure marko globally
965
966```javascript
967require("marko/node-require").install({
968 compilerOptions: {
969 writeToDisk: false
970 }
971});
972```
973
974### 3.11.1
975
976- Fixed [#370](https://github.com/marko-js/marko/issues/370) - HTML characters in loop separator string should not be escaped
977
978### 3.11.0
979
980- Introduced the `<include-html(path)>` tag for including static HTML:
981
982```xml
983<include-html('./foo.html')>
984```
985
986## 3.10.x
987
988### 3.10.1
989
990- Fixed [#44](https://github.com/marko-js/marko/issues/44) - Webpack compatibility fixes. Also see [marko-loader](https://github.com/marko-js/marko-loader) (A marko loader for webpack)
991
992### 3.10.0
993
994- Fixed [#357](https://github.com/marko-js/marko/issues/357) - Deprecate `empty`/`notEmpty` in Marko v3
995
996## 3.9.x
997
998### 3.9.4
999
1000- Fixed [#355](https://github.com/marko-js/marko/issues/355) - `status-var`/`separator` options not handled when looping over properties
1001- Fixed [#354](https://github.com/marko-js/marko/issues/354) - regular expressions used in attribute values are not being handled correctly
1002- Fixed [#353](https://github.com/marko-js/marko/issues/353) - `body-only-if` attribute does not work with custom tags (only HTML tags)
1003
1004### 3.9.3
1005
1006- Upgraded to `raptor-util@^2`
1007
1008### 3.9.2
1009
1010- Fixed [#327](https://github.com/marko-js/marko/issues/327) - alt attribute with empty string should be allowed ([Pull Request #350](https://github.com/marko-js/marko/pull/350) by [@mlrawlings](https://github.com/mlrawlings))
1011
1012### 3.9.1
1013
1014- Fixed [#348](https://github.com/marko-js/marko/issues/348) - exclude all `*.orig` and other files from published npm package
1015
1016### 3.9.0
1017
1018- Fixed [#231](https://github.com/marko-js/marko/issues/231) - Allow <assign count++>
1019- Fixed [#345](https://github.com/marko-js/marko/issues/345) - Whitespace preservation now applies to all deeply nested text nodes
1020- Fixed [#344](https://github.com/marko-js/marko/issues/344) - Introduced [defineRenderer](./docs/javascript-api.md#requiremarkodefinerenderer) for Marko
1021- Docs: Added docs for excluding directories from taglib discovery ([@mlrawlings](https://github.com/mlrawlings))
1022- Docs: Added docs for component autodiscovery ([@mlrawlings](https://github.com/mlrawlings))
1023- Docs: Added docs for passing a data object to a custom tag
1024
1025## 3.8.x
1026
1027### 3.8.1
1028
1029- Fixed [#342](https://github.com/marko-js/marko/issues/342) - `await:finish` event not emitted for async fragments with client reorder and that complete synchronously
1030
1031### 3.8.0
1032
1033- Fixed [#329](https://github.com/marko-js/marko/issues/329) - Add autodiscover of components/ directory ([Pull Request #338](https://github.com/marko-js/marko/pull/338) by [@mlrawlings](https://github.com/mlrawlings))
1034
1035## 3.7.x
1036
1037### 3.7.4
1038
1039- Fixed [#339](https://github.com/marko-js/marko/issues/339) - Tag transformers are not being applied to tags with a dynamic tag name (fixes [#146](https://github.com/marko-js/marko-components/issues/146) for Marko Components)
1040
1041### 3.7.3
1042
1043- Fixed [#332](https://github.com/marko-js/marko/issues/332) and [#333](https://github.com/marko-js/marko/issues/333) - Correct values for `literalUndefined` and `literalFalse` in the Builder API [@bkuri](https://github.com/bkuri)
1044- Fixed [#336](https://github.com/marko-js/marko/issues/336) - Upgraded to latest version of `minimatch`
1045
1046### 3.7.2
1047
1048- Fixed [#328](https://github.com/marko-js/marko/issues/328) - Improve error reporting when taglib/tag definition fails to load
1049- Additional change to disable escaping for dynamic `Text` nodes added to body of `<script>` tag to fix [issue #326](https://github.com/marko-js/marko/issues/326)
1050
1051### 3.7.1
1052
1053- Improved escaping within the `<script>` tag to fix [issue #322](https://github.com/marko-js/marko/issues/322). Special HTML characters will no longer be escaped within the context of the `<script>` tag since browsers do not decode HTML entities within the `<script>` tag. Instead, only the ending `</script>` tag sequence is escaped using JavaScript string escaping sequences.
1054
1055### 3.7.0
1056
1057- Made change to make configuration a true singleton shared across all instances of `marko` loaded at runtime ([commit](https://github.com/marko-js/marko/commit/cd797322adf80f2890015de7b8f62301c2921a0a))
1058
1059## 3.6.x
1060
1061### 3.6.2
1062
1063- Improved support for hot reloading by automatically disabling `assumeUpToDate` if hot reload is enabled. ([Pull Request #320](https://github.com/marko-js/marko/pull/320) by [@ianvonholt](https://github.com/ianvonholt))
1064
1065### 3.6.1
1066
1067- Fixed a bug that was causing transforms to be run on detached nodes. This was manifesting itself in the `<async-fragment>` to `<await>` transform if an `if()` attribute was present (or other core attributes that end up wrapping the tag it is defined on).
1068
1069### 3.6.0
1070
1071- Introduced a new and simpler `<await>` tag that should be used instead of the now deprecated `<async-fragment>` tag (see deprecation details below) ([Pull Request #312](https://github.com/marko-js/marko/pull/312) by [@mlrawlings](https://github.com/mlrawlings))
1072
1073#### Deprecations
1074
1075- Deprecated the `<async-fragment var="<var>" data-provider=<data-provider>>` tag in favor of the `<await(<var> from <data-provider>)>` tag:
1076
1077OLD:
1078
1079```xml
1080<async-fragment var="userInfo" data-provider=data.userInfoPromise>
1081 Hello ${userInfo.name}!
1082</async-fragment>
1083```
1084
1085NEW:
1086
1087```xml
1088<await(userInfo from data.userInfoPromise)>
1089 Hello ${userInfo.name}!
1090</await>
1091```
1092
1093The `<await>` tag supports all of the attributes of the previous `<async-fragment>` tag except for `var` and `data-provider`:
1094
1095```xml
1096<await(userInfo from data.userInfoPromise) name="userInfo" timeout=10000 client-reorder>
1097 Hello ${userInfo.name}!
1098</await>
1099```
1100
1101Finally, the nested tags for providing content for the placeholder, error and timeout messages have been renamed accordingly:
1102
1103```xml
1104<await(userInfo from data.userInfoPromise) client-reorder>
1105 <await-placeholder>
1106 This is alternate content while the async fragment is loading.
1107 </await-placeholder>
1108 <await-timeout>
1109 A timeout has occurred!
1110 </await-timeout>
1111 <await-error>
1112 A error has occurred!
1113 </await-error>
1114
1115 Hello ${userInfo.name}!
1116</await>
1117```
1118
1119## 3.5.x
1120
1121### 3.5.1
1122
1123- Fixes #316 - Autocomplete for tags is not updated when tag files updated despite clearing cache. This improves the [autocomplete-marko](https://github.com/marko-js/atom-autocomplete-marko) plugin for Atom.
1124- Fixes #314 - Remove hyphens from include props
1125- Deprecated:
1126 - Properties passed in using the `<include>` tag should not be access using hyphens.
1127
1128For example, given the following template:
1129
1130```xml
1131<include("./include-target.marko") first-name='Jane'/>
1132```
1133
1134The `first-name` data should be accessed using the `firstName` property:
1135
1136```javascript
1137var firstName = input.firstName;
1138// NOT: var firstName = input['first-name'];
1139```
1140
1141### 3.5.0
1142
1143- Added functionality to exclude specific directory or package from taglib finder ([Pull Request #309](https://github.com/marko-js/marko/pull/309) by [@oxala](https://github.com/oxala))
1144
1145## 3.4.x
1146
1147### 3.4.9
1148
1149- Fixed [https://github.com/marko-js/marko/issues/307] - Marko concise syntax, with multiple class names ([Pull Request #308](https://github.com/marko-js/marko/pull/308) by [@mlrawlings](https://github.com/mlrawlings))
1150
1151### 3.4.8
1152
1153- Added support for an "enum" attribute value
1154
1155### 3.4.7
1156
1157- Async fragment improvements ([Pull Request #305](https://github.com/marko-js/marko/pull/305) by [@mlrawlings](https://github.com/mlrawlings))
1158 - Adds additional event info (finished/timedout) to the data emitted from <async-fragment> tags.
1159 - Ensures that renderBody() is not called again if the fragment has already finished (timed out).
1160 - Fixes `npm run test-async`
1161 - Removes a redundant `async-fragment` timeout related test
1162
1163### 3.4.6
1164
1165- Updated autocomplete information
1166
1167### 3.4.5
1168
1169- Fixes #304 - async-fragment-tag-transformer.js being loaded by PhantomJS
1170- Updated taglibs with additional information to support tooling
1171- Added [Michael Rawlings](https://github.com/mlrawlings) as a maintainer
1172
1173### 3.4.4
1174
1175- Fixes #303 - `addStaticVar` is not generating unique variable names correctly
1176
1177### 3.4.3
1178
1179- Improved validation for macros ([@mlrawlings](https://github.com/mlrawlings), [PR #300](https://github.com/marko-js/marko/pull/300))
1180- Added code coverage reporting ([@mlrawlings](https://github.com/mlrawlings), [PR #301](https://github.com/marko-js/marko/pull/301))
1181
1182### 3.4.2
1183
1184- Improved error reporting in cases when code generation fails ([@mlrawlings](https://github.com/mlrawlings))
1185
1186### 3.4.1
1187
1188- Additional tweaks for #298 - Always emit correct events for async fragments
1189
1190### 3.4.0
1191
1192- Fixes #298 - Always emit correct events for async fragments
1193- Updated docs
1194
1195## 3.3.x
1196
1197### 3.3.0
1198
1199- Include async fragment name in the `asyncFragmentFinish` events ([@kprakasam](https://github.com/kprakasam))
1200
1201## 3.2.x
1202
1203### 3.2.0
1204
1205- Fixes #286 - Add res.marko(templateData) for use with Express ([@mlrawlings](https://github.com/mlrawlings))
1206
1207## 3.1.x
1208
1209### 3.1.9
1210
1211- Fixes #288 - Provide API for discovering custom tags and attributes for autocomplete/tooling purposes
1212- Documentation improvements
1213
1214### 3.1.8
1215
1216- Fixes #280 - Switch from jsonminify to strip-json-comments
1217- Updated docs for Koa and Hapi
1218- Additional tests for Node.js v6
1219
1220### 3.1.7
1221
1222- Fixes #274 - marko-compiler-options tag is not properly ended when using raw parsing (for prettyprint)
1223
1224### 3.1.6
1225
1226- Fixes #268 - this.write is not a function for empty ArrayExpression
1227
1228### 3.1.5
1229
1230- Fixes #262 - node-require module removes `.marko` extension from filenames in compiled code
1231
1232### 3.1.4
1233
1234- Fixes #267 - Shorthand CSS class name cannot be combined with object/array class names
1235
1236### 3.1.3
1237
1238- Fixed #266 - Hot reloading fails if original template is deleted
1239
1240### 3.1.2
1241
1242- Fixed error reporting when using `compiler.parseRaw()`
1243- Added test for #262
1244
1245### 3.1.1
1246
1247- Improved whitespace removal for text nodes directly below the root
1248
1249### 3.1.0
1250
1251- Fixes #254 - Allow preserve whitespace to be enabled at the global level
1252
1253## 3.0.x
1254
1255### 3.0.7
1256
1257- Fixes #240 - Always trim start and end of template (even if preserveWhitespace is true)
1258- Fixes #260 - Circular custom tags causes infinite recursion when writeToDisk is set to false
1259- Minor internal cleanup
1260
1261### 3.0.6
1262
1263- Don't wrap exception in `parseJavaScript` if error object was not created by Esprima
1264
1265### 3.0.5
1266
1267- Fixes #257 - Placeholders don't render for out-of-order async fragments
1268
1269### 3.0.4
1270
1271- Fixes #256 - Convert attributes to title case if no attributes are declared for a custom tag
1272- Use `<noscript>` for out-of-order async fragment placeholders
1273
1274### 3.0.3
1275
1276- Make renderSync behave if no context was supplied ([PR #250](https://github.com/marko-js/marko/pull/250) by [@jsumners](https://github.com/jsumners))
1277
1278### 3.0.2
1279
1280- Store `tagDef` with `HtmlElement` node (needed for pretty printing)
1281
1282### 3.0.1
1283
1284- Docs: Fixed minor issues in docs
1285- Reintroduced support for the `MARKO_CLEAN` environment variable: `MARK_CLEAN=true node server.js`
1286
1287### 3.0.0
1288
1289- See: [What's New in Marko v3](http://markojs.com/docs/marko/what-is-new-marko-v3/)
1290
1291# 2.x
1292
1293## 2.8.x
1294
1295### 2.8.4
1296
1297- Fixes circular dependency issue between runtime/index.js and hot-reload/index.js
1298
1299### 2.8.3
1300
1301- Fixes circular dependency issue between runtime/index.js and hot-reload/index.js
1302
1303### 2.8.2
1304
1305- Fixes #203 - Incorrect behavior when attrs is used on a standard HTML tag with a tag def
1306
1307### 2.8.1
1308
1309- Fixes #202 - Pass along options to compiler when loading a template
1310
1311### 2.8.0
1312
1313- Added support for automatically discovering taglibs from installed packages that are scoped. ([PR #183](https://github.com/marko-js/marko/pull/183) by [@tropperstyle](https://github.com/tropperstyle))
1314
1315### 2.8.3
1316
1317- Fixes circular dependency issue between `hot-reload/index.js` and `runtime/index.js`
1318
1319## 2.7.x
1320
1321### 2.7.31
1322
1323- Fixes #167 - Nested tags only work one level deep
1324
1325### 2.7.30
1326
1327- docs: don't exclude docs in .npmignore
1328
1329### 2.7.29
1330
1331- Fixes #161 - Nested tags with no body content are not handled correctly
1332
1333### 2.7.28
1334
1335- Fixes #140 - Also de-dupe cached taglibs in finder
1336
1337### 2.7.27
1338
1339- Make loading template from String template source easier:
1340
1341```javascript
1342var template = marko.load(templatePath, "Hello $!{data.name}!");
1343```
1344
1345_NOTE: Loading directly from source only works on the server_
1346
1347See [Pull Request #153](https://github.com/marko-js/marko/pull/153)
1348
1349### 2.7.26
1350
1351- Use shorter relative paths in error messages
1352
1353### 2.7.25
1354
1355- Fixes #150 - Provide option to prevent writing compiled templates to disk. Example usage:
1356
1357```javascript
1358require("marko/compiler").defaultOptions.writeToDisk = false;
1359```
1360
1361NOTE: If you disable writing compiled templates to disk then it will be a little harder to debug errors in templates on the server since the stack trace will refer to a file that has not been written to disk.
1362
1363For a more complete list of compiler options please see: http://markojs.com/docs/marko/javascript-api/#defaultoptions
1364
1365### 2.7.24
1366
1367- Fixes #140 - De-dupe taglibs by module name
1368- Documentation: Miscellaneous changes
1369
1370### 2.7.23
1371
1372- Fixed a typo for `rendererFunc` `in helpers.js` (commit: 0205a47f04911f34ca4d458970d710f81a143987)
1373
1374### 2.7.22
1375
1376- New language feature: [`unless` support added](http://markojs.com/docs/marko/language-guide/#unlesselse-ifelse)
1377
1378### 2.7.21
1379
1380- Automatically enable hot-reload and browser-refresh if launched using [browser-refresh](https://github.com/patrick-steele-idem/browser-refresh)
1381
1382### 2.7.20
1383
1384- Documentation: Miscellaneous changes
1385
1386### 2.7.19
1387
1388- Fixes #137 - adds support for dynamic HTML tag names
1389
1390### 2.7.18
1391
1392- Improvement: Better resolving of tag renderer
1393- Compiler: Fix to make compiler work in the browser
1394
1395### 2.7.17
1396
1397- Fixes #135 Allow "attrs" attribute on custom tags
1398
1399### 2.7.16
1400
1401- Improved handling of imports
1402- Better handling of loading taglibs with circular dependencies
1403
1404### 2.7.15
1405
1406- Handle circular taglib imports
1407
1408### 2.7.14
1409
1410- Fixes #131 - Recursively handle taglib imports
1411
1412### 2.7.13
1413
1414- Added a `.npmignore` file
1415- Fixed licensing header in source
1416- Documentation: improved docs for input.renderBody()
1417- Documentation: Miscellaneous changes
1418
1419### 2.7.12
1420
1421- Fixes #122 Don't allow invalid attributes when using shorthand
1422- Fixes #122 Typo in hasAttributes
1423- Fixes #127 - Make sure all possible input files are accounted for when checking if a compiled template is up-to-date
1424- Use `browser.json` files instead of `optimizer.json` files
1425- Documentation: Improved docs for async taglib
1426- Documentation: Added empty() and notEmpty() helpers to the readme
1427- Added Martin Aberer as a maintainer
1428- Documentation: Miscellaneous changes
1429
1430### 2.7.11
1431
1432- New logo!
1433
1434### 2.7.10
1435
1436- Fixes #118 Better error when parsing JSON file for tag
1437- Testing: More test cases related to empty attributes
1438- Documentation: Clarification for the Node.js require extension
1439- Documentation: doc reference for `getLength()` of loop `status-var`
1440- Documentation: Added reference to [sublime-marko](https://github.com/merwan7/sublime-marko) under the tools section.
1441
1442### 2.7.9
1443
1444- Fixes #109 - Allow `compiler.createNode('div')`
1445- Fixes #108 - Improve how the `MARKO_CLEAN` env variable is handled
1446
1447### 2.7.8
1448
1449- Minor documentation changes
1450
1451### 2.7.7
1452
1453- Allow `.html` extension for layouts (Fix for https://github.com/raptorjs/marko-layout/issues/2)
1454
1455### 2.7.6
1456
1457- Make require('marko/node-require').install() a noop in the browser
1458
1459### 2.7.5
1460
1461- Improvement: Allow `template-data` to be combined with other attributes on the `<include>` tag
1462- Documentation: Fixes #98 - docs for `<include template-data="...">`
1463
1464### 2.7.4
1465
1466- Fixes #96 - Allow relative, dynamic include paths
1467
1468### 2.7.3
1469
1470- Internal change: Additional test cases added for using promises with async fragments
1471
1472### 2.7.2
1473
1474- Fixes #73 - Prevent same taglib from being loaded multiple times
1475
1476### 2.7.1
1477
1478- Fixes #88 - Assign global data to the correct out
1479
1480### 2.7.0
1481
1482- Fixes [#27](https://github.com/raptorjs/marko/issues/27) - IE conditional comments (e.g., `<!--[if lt IE 9]><div><![endif]-->`) are automatically preserved. Previously, all HTML comments were stripped out when loading a template. For example:
1483- Added support for `<compiler-options comments="preserve"/>` to enable comments to preserved in a template. For example:
1484
1485```xml
1486<compiler-options comments="preserve"/>
1487Hello
1488<!--This comment should be preserved-->
1489World
1490```
1491
1492Output:
1493
1494```xml
1495Hello
1496<!--This comment should be preserved-->
1497World
1498```
1499
1500## 2.6.x
1501
1502### 2.6.0
1503
1504- Performance improvements
1505 - `'use strict';`
1506 - Optimized render code paths
1507- Code cleanup
1508- Compatibility fixes for Node.js 0.12
1509 - Bad: `fs.readFile(path, 'utf8')`
1510 - Good: `fs.readFile(path, {encoding: 'utf8'})`
1511
1512## 2.5.x
1513
1514### 2.5.0
1515
1516- Fixes #78 - Custom Node.js require extension for Marko template files. Example usage:
1517
1518```javascript
1519// Install the Node.js require extension in your application's main script (server-side only)
1520require("marko/node-require").install();
1521
1522// Now you can require `*.marko` files just like any other JavaScript module
1523var template = require("./hello.marko");
1524var html = template.renderSync({ name: "Frank" });
1525```
1526
1527- Compiled templates now export a loaded Template instance. In the previous version of marko, compiled templates exported a function that could be used to create a loaded Template instance.
1528
1529## 2.4.x
1530
1531### 2.4.3
1532
1533- Fixes edge case: More precise regular expression for decoding HTML entities
1534
1535### 2.4.2
1536
1537- Internal: Fixes #75 Always assign the tag property to custom tag nodes
1538
1539### 2.4.1
1540
1541- Improvement to allow taglibs to be imported from other taglibs ([commit](https://github.com/raptorjs/marko/commit/73e9a3420a1bac3e2c201d4dcadf21c0701b5222))
1542
1543### 2.4.0
1544
1545- Added support for short-hand tags and attributes
1546
1547Old `marko-taglib.json`:
1548
1549```json
1550{
1551 "tags": {
1552 "my-hello": {
1553 "renderer": "./hello-renderer",
1554 "attributes": {
1555 "name": "string"
1556 }
1557 }
1558 }
1559}
1560```
1561
1562Short-hand `marko-taglib.json`:
1563
1564```json
1565{
1566 "<my-hello>": {
1567 "renderer": "./hello-renderer",
1568 "@name": "string"
1569 }
1570}
1571```
1572
1573- Fixes #61 Simplify parent/child relationships
1574
1575Marko now supports custom tags in the following format: `<parent_tag.nested_tag>`
1576
1577Example usage:
1578
1579```html
1580<ui-tabs orientation="horizontal">
1581 <ui-tabs.tab title="Home"> Content for Home </ui-tabs.tab>
1582 <ui-tabs.tab title="Profile"> Content for Profile </ui-tabs.tab>
1583 <ui-tabs.tab title="Messages"> Content for Messages </ui-tabs.tab>
1584</ui-tabs>
1585```
1586
1587**_ui-tabs/marko-tag.json_**
1588
1589```json
1590{
1591 "@orientation": "string",
1592 "@tabs <tab>[]": {
1593 "@title": "string"
1594 }
1595}
1596```
1597
1598**_ui-tabs/renderer.js_**
1599
1600```javascript
1601var template = require("marko").load(require.resolve("./template.marko"));
1602
1603exports.renderer = function(input, out) {
1604 var tabs = input.tabs;
1605
1606 // Tabs will be in the following form:
1607 // [
1608 // {
1609 // title: 'Home',
1610 // renderBody: function(out) { ... }
1611 // },
1612 // {
1613 // title: 'Profile',
1614 // renderBody: function(out) { ... }
1615 // },
1616 // {
1617 // title: 'Messages',
1618 // renderBody: function(out) { ... }
1619 // }
1620 // ]
1621 console.log(tabs.length); // Output: 3
1622
1623 template.render(
1624 {
1625 tabs: tabs
1626 },
1627 out
1628 );
1629};
1630```
1631
1632**_ui-tabs/template.marko_**
1633
1634```html
1635<div class="tabs">
1636 <ul class="nav nav-tabs">
1637 <li class="tab" for="tab in data.tabs">
1638 <a href="#${tab.title}"> ${tab.title} </a>
1639 </li>
1640 </ul>
1641 <div class="tab-content">
1642 <div class="tab-pane" for="tab in data.tabs">
1643 <invoke function="tab.renderBody(out)" />
1644 </div>
1645 </div>
1646</div>
1647```
1648
1649## 2.3.x
1650
1651### 2.3.2
1652
1653Fixes #66 - Allow circular dependencies when loading templates
1654
1655### 2.3.1
1656
1657- Testing framework changes
1658- Fixes #65 - Generated variable name is an empty string in some cases
1659
1660### 2.3.0
1661
1662- Fixes #53 Merge c-input with attr props
1663
1664## 2.2.x
1665
1666### 2.2.2
1667
1668Fixes #60 Don't replace special operators for body functions
1669
1670### 2.2.1
1671
1672- Fixes #58 Added support for MARKO_CLEAN env variable (force recompile of all loaded templates). Example usage:
1673
1674```bash
1675MARKO_CLEAN=true node run.js
1676```
1677
1678- Code formatting: add spaces in var code
1679
1680### 2.2.0
1681
1682- Fixes #51 Allow body content to be mapped to a String input property
1683- Fixes #52 Remove JavaScript comments from JSON taglib files before parsing
1684
1685## 2.1.x
1686
1687### 2.1.6
1688
1689- Fixes #50 Initialize the loader after the runtime is fully initialized
1690
1691### 2.1.5
1692
1693- Fixes #50 Ensure that all instances of marko have hot-reload and browser-refresh enabled
1694
1695### 2.1.4
1696
1697- Allowing complex var names (i.e. LHS) for the `<assign>` tag.
1698
1699### 2.1.3
1700
1701- Minor change: Slight improvement to code to resolve tag handler
1702
1703### 2.1.2
1704
1705- Minor change: Improve how renderer is resolved
1706
1707### 2.1.1
1708
1709- Fixes #48 name in marko-tag.json should override default name given during discovery
1710
1711### 2.1.0
1712
1713- Fixes #47 - Added support for "taglib-imports"
1714
1715## 2.0.x
1716
1717### 2.0.12
1718
1719- Fixes #31 - Add support for providing prefix when scanning for tags
1720- Allow "code" to be a function that lazily evaluates to a code string during code generation
1721
1722### 2.0.11
1723
1724- Added method for custom node compilers to get access to the `escapeXml` function at runtime
1725
1726### 2.0.10
1727
1728- Fixes #39 - Added missing return when using hot-reload
1729
1730### 2.0.9
1731
1732- Fixed bad publish
1733
1734### 2.0.8
1735
1736- Better merging of tags when loading and merging taglibs
1737
1738### 2.0.7
1739
1740- Changes to avoid problems associated with the same taglib being found multiple times in the search path
1741
1742### 2.0.6
1743
1744- `renderBody` function is only added if tag has children
1745
1746### 2.0.5
1747
1748- Fixed #36 - Don't use `invokeBody()` in the cache taglib
1749
1750### 2.0.4
1751
1752- :exclamation: Fixed #36 - Deprecated - When using `<include>` with body content, nested body content is now passed in as `String` property named `body`. Old behavior: nested content would be passed in as a `Function` property named `invokeBody` that would return the `String` value of the nested content. `invokeBody()` has been deprecated.
1753
1754### 2.0.3
1755
1756- Fixed #36 - Don't use `invokeBody()` in test code and the HTML comments tag
1757
1758### 2.0.2
1759
1760- :exclamation: Fixed #36 - Deprecated `input.invokeBody()` in favor of `input.renderBody(out)`
1761- Fixed #37 - Duplicate input property for custom tag renderers
1762
1763### 2.0.1
1764
1765- Fixed #35 - Added support for `<compiler-options>`. Example:
1766
1767```html
1768<compiler-options whitespace="preserve" /> A B C
1769```
1770
1771### 2.0.0
1772
1773- Dynamic attributes for scanned tags without a tag will have dashes removed by default.
1774 - :exclamation: When using `tags-dir` to discover tags that do not have a `marko-tag.json`, the previous behavior was to allow all attributes and to use the actual attribute name as the input property name. For example, when using `<hello first-name="John">`, first name would need to be read in as `input['first-name']`. This was changed such that the first name property should now be read in as `input.firstName` (dashes removed and converted to camel case)
1775- Changes to allow UI component to be put into a single JS file:
1776 - Updated taglib directory scanner to use `index.js` if found. New search order:
1777 1. `renderer.js` (use `renderer.js` if it exists)
1778 2. `index.js` (use `index.js` if it exists and assume it exports a `renderer` or `render` property)
1779 3. `template.marko` (use the template as the renderer if no `renderer.js` or `index.js`)
1780 - :exclamation: Changes to the taglib directory scanner could break existing code. Specifically, if a UI component directory had an `index.js` file and a `template.marko` file then in in `marko@<2` the `template.marko` file would have been selected as the renderer. In `marko@2.x`, the `index.js` will be selected as the tag renderer.
1781- :exclamation: Removed support for mapping a tag renderer to a module with a `process` method
1782- Removed sub-module `marko/renderer` that exports [raptor-renderer](https://github.com/raptorjs/raptor-renderer)
1783
1784# 1.x
1785
1786## 1.6.x
1787
1788### 1.6.1
1789
1790- Added back code to allow the new marko runtime to load templates compiled by an earlier compiler that used `module.exports`
1791
1792### 1.6.0
1793
1794- Fixed #32. Switched from `module.exports = function create(__helpers) { ... }` to `exports.create = function(__helpers) { ... }` to avoid circular dependency problems
1795
1796## 1.5.x
1797
1798### 1.5.8
1799
1800- Added support for adding "static" code to the top of a compiled template (helpful for initializing variables or running code once).
1801
1802### 1.5.7
1803
1804- Added sub-module `marko/renderer` that exports [raptor-renderer](https://github.com/raptorjs/raptor-renderer)
1805
1806### 1.5.6
1807
1808- Changes to avoid unoptimized code in V8
1809
1810### 1.5.5
1811
1812- Handle case where template was loaded before hot-reload was enabled
1813
1814## 1.5.4
1815
1816- Added support for `$global` in `renderSync`