You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

378 lines
17 KiB

5 years ago
  1. # Compiler Changes
  2. ### v4.3.11
  3. - Fix https://github.com/riot/compiler/issues/127
  4. - Fix https://github.com/riot/compiler/issues/126
  5. - Improve the code maintainability refactoring big files into smaller ones
  6. ### v4.3.10
  7. - Fix https://github.com/riot/riot/issues/2753
  8. - Fix https://github.com/riot/riot/issues/2748
  9. - Update acorn to v7.0.0
  10. ### v4.3.9
  11. - Fix https://github.com/riot/compiler/issues/125
  12. - Fix https://github.com/riot/compiler/issues/124
  13. ### v4.3.8
  14. - Fix make sure that the `createExpression` internal function receives always all its arguments
  15. ### v4.3.7
  16. - Fix https://github.com/riot/compiler/issues/121
  17. ### v4.3.6
  18. - Fix https://github.com/riot/compiler/issues/122
  19. - Fix https://github.com/riot/compiler/pull/118
  20. ### v4.3.5
  21. - Fix backslashed unicode css properties
  22. ### v4.3.4
  23. - Fix escape backslashes in css strings https://github.com/riot/riot/issues/2726
  24. ### v4.3.3
  25. - Fix https://github.com/riot/compiler/issues/119
  26. - Fix https://github.com/riot/riot/issues/2726
  27. ### v4.3.2
  28. - Fix void tags will be automatically corrected for example:
  29. ```html
  30. <svg>
  31. <circle></circle>
  32. </svg>
  33. ```
  34. Will be transfromed to
  35. ```html
  36. <svg>
  37. <circle/>
  38. </svg>
  39. ```
  40. ### v4.3.1
  41. - Fix https://github.com/riot/riot/issues/2719
  42. - Fix https://github.com/riot/riot/issues/2723
  43. ### v4.3.0
  44. - Add support for dynamic import
  45. ### v4.2.6
  46. - Fix expression parts issues https://github.com/riot/riot/issues/2701
  47. ### v4.2.5
  48. - Fix https://github.com/riot/riot/issues/2700 replacing the `esprima` parser with `acorn`
  49. ### v4.2.4
  50. - Fix attributes on custom tags having `if` or `each` directives
  51. ### v4.2.3
  52. - Update `@riotjs/dom-bindings` using v4.0.0
  53. - Update npm dependencies
  54. ### v4.2.2
  55. - Fix [riot#2691](https://github.com/riot/riot/issues/2691)
  56. ### v4.2.1
  57. - Fix css generation with `@media` queries
  58. ### v4.2.0
  59. - Add support for `<a {href}/>` shortcut expressions
  60. - Fix spread expressions issue [riot/2679](https://github.com/riot/riot/issues/2679)
  61. ### v4.1.1
  62. - Fix commonjs imports
  63. ### v4.1.0
  64. - Add support for the slot attribute binding
  65. ### v4.0.4
  66. - Fix avoid removing selector attributes twice on custom tags
  67. ### v4.0.3
  68. - Fix attributes handling on custom children nodes [riot#2680](https://github.com/riot/riot/issues/2680)
  69. ### v4.0.2
  70. - Fix spread operator on each directives [riot#2679](https://github.com/riot/riot/issues/2679)
  71. ### v4.0.1
  72. - Fix attributes mixed with expressions [riot#2681](https://github.com/riot/riot/issues/2681)
  73. ### v4.0.0
  74. - Complete rewrite **not backward compatible**
  75. - New output compatible only for Riot.js 4.0.0
  76. - Add better sourcemaps generation
  77. - Add the `@riotjs/parser` fixing odd issues with regex like [#114](https://github.com/riot/compiler/issues/114)
  78. - Improve the code generation strategy preferring AST to regex parsing
  79. - Remove all the preprocessors from the core in favor of `registerPreprocessor` and `registerPostprocessor` instead
  80. ### v4.0.0-beta.5
  81. - Fix https://github.com/riot/riot/issues/2669
  82. ### v4.0.0-beta.3
  83. - Fix https://github.com/riot/compiler/issues/115
  84. ### v4.0.0-beta.2
  85. - Add support for multiple expressions on the same attribute node
  86. ### v4.0.0-beta.1
  87. - Update rename the `tag` property `exports`
  88. ### v4.0.0-alpha.20
  89. - Fix handle escaped chars
  90. ### v4.0.0-alpha.19
  91. - Fix bug in nodes with a single expression
  92. ### v4.0.0-alpha.18
  93. - Add the `name` key to the tag exports
  94. - Fix self-closed tag bindings
  95. ### v4.0.0-alpha.17
  96. - Remove unused dev dependencies
  97. ### v4.0.0-alpha.16
  98. - *Breaking change*: make the compiler API synchronous
  99. ### v4.0.0-alpha.15
  100. - Fix slots root nodes handling
  101. ### v4.0.0-alpha.14
  102. - Add sourcemap tests for babel preprocessor
  103. - Update handling of multiple line text expressions, from template literal to array
  104. - Update output format
  105. ### v4.0.0-alpha.13
  106. - Fix sourcemap for the multiple text expressions
  107. - Check make sure that `slot` tags will not be considered custom tags
  108. ### v4.0.0-alpha.12
  109. - Fix sourcemap `sourcesContent` property
  110. - Update sourcemap filename
  111. ### v4.0.0-alpha.11
  112. - Fix sourcemap generation for the `if` and `each` tag bindings
  113. ### v4.0.0-alpha.10
  114. - Update enhance sourcemaps generation
  115. - Change second arguments for the pre/post processors. The `meta` object will contain info about the current compilation
  116. ### v4.0.0-alpha.9
  117. - Fix move `recast` into the package dependencies
  118. ### v4.0.0-alpha.8
  119. - Enhance the source map generation
  120. - Improve performance
  121. - Update npm dependencies
  122. ### v4.0.0-alpha.7
  123. - Add support for the scoped css
  124. - Update the Tag bindings output to support dynamic tags
  125. ### v4.0.0-alpha.6
  126. - Fix issue with the object expressions scoping
  127. ### v4.0.0-alpha.5
  128. - Update the tag bindings API to get the component implementation via function
  129. ### v4.0.0-alpha.4
  130. - Fix issues related to the member expressions traversal and the scope
  131. ### v4.0.0-alpha.3
  132. - Fix issue with custom tags and no slots
  133. ### v4.0.0-alpha.2
  134. - Add support for the spread attributes `<a {...foo}/>`
  135. - Add the `tagName` to the compiler options in runtime
  136. - Fix the options were not passed to the postprocessor
  137. ### v4.0.0-alpha.1
  138. - New complete rewrite from scratch
  139. - Change npm name from `riot-compiler` to `@riotjs/compiler`
  140. - First alpha release not backward compatible
  141. ### v3.5.2
  142. - Fix es6 dynamic imports https://github.com/riot/riot/issues/2641
  143. ### v3.5.1
  144. - Fix try importing `@babel/core` first and then fallback to `babel-core` for the `es6` parser
  145. ### v3.5.0
  146. - Add support for Babel 7
  147. ### v3.4.0
  148. - Add inline sourcemap support via `sourcemap='inline'` option
  149. ### v3.3.1
  150. - Improve the sourcemap generation adding the `sourceContent` key
  151. ### v3.3.0
  152. - Add initial experimental sourcemaps support via `sourcemap: true` option
  153. ### v3.2.6
  154. - Fix #105
  155. - Fix #104
  156. ### v3.2.5
  157. - Update dependencies and refactor some internal code avoiding bitwise operators
  158. - Fix coffeescript parser require https://github.com/riot/compiler/pull/102
  159. ### v3.2.4
  160. - Fix [riot#2369](https://github.com/riot/riot/issues/2369) : Possible bug involving compilation of tags containing regex.
  161. - Using the `skip-regex` function from npm for sharing bwteen modules (at future).
  162. - Using the `jsSplitter` function for safer replacement of JS code, part of the next compiler.
  163. ### v3.2.3
  164. - Fixes various issues with literal regexes.
  165. ### v3.1.4
  166. - Fix avoid the `filename` option for the babel-standalone parser
  167. ### v3.1.3
  168. - Fix babel in browser runtime parser https://github.com/riot/examples/issues/51
  169. ### v3.1.2
  170. - Fix [riot#2210](https://github.com/riot/riot/issues/2210) : Style tag get stripped from riot tag even if it's in a javascript string.
  171. - Updated devDependencies.
  172. ### v3.1.0
  173. - Adds support for css @apply rule: now ScopedCSS parser can handle it properly
  174. ### v3.0.0
  175. - Deprecate old `babel` support, now the `es6` parser will use Babel 6 by default
  176. - Change css always scoped by default
  177. - Fix all the `value` attributes using expressions will be output as `riot-value` to [riot#1957](https://github.com/riot/riot/issues/1957)
  178. ### v2.5.5
  179. - Fix to erroneous version number in the package.json, v2.5.4 was released before.
  180. - Removed unuseful files from the npm package.
  181. - Updated credits in package.json
  182. - Updated devDependencies, skip ESLint in CI test for node v0.12
  183. - BuGless-hack for [riot#1966](https://github.com/riot/riot/issues/1966) - You can use `<-/>` to signal the end of the html if your html is ending with an expression.
  184. ### v2.5.4
  185. - Fix #68 : SASS inside Pug template gives Invalid CSS.
  186. - Added parser for [bublé](https://buble.surge.sh) as `buble` in the browser. Option `modules` is `false` in all versions.
  187. - Added parser for [bublé](https://buble.surge.sh) as `buble`.
  188. - Added support for es6 `import` statements. Thanks to @kuashe! - Related to [riot#1715](https://github.com/riot/riot/issues/1715), [riot#1784](https://github.com/riot/riot/issues/1784), and [riot#1864](https://github.com/riot/riot/issues/1864).
  189. ### v2.5.3
  190. - Fix #73 : resolveModuleSource must be a function - Option removed from the default Babel options.
  191. - Updated node.js to 4.4 in the Travis environment.
  192. - Downgraded ESLint to 2.x for using with node v0.12.x
  193. ### v2.5.2
  194. - Fix #72: `undefined` is not a function when evaluating `parsers._req`.
  195. - Updated node versions for travis, including v5.x
  196. ### v2.4.1
  197. - Add the `pug` parser (it will replace completely `jade` in the next major release)
  198. - Add the possibility to pass custom parsers options directly via the `compiler.compile` method through the `parserOptions: {js: {}, template: {}, style: {}}` key [more info](https://github.com/riot/compiler/issues/64)
  199. - Fix un-escape parser options in html [more info](https://github.com/riot/compiler/issues/63)
  200. ### v2.3.23
  201. - The parsers are moved to its own directory in the node version. The load is on first use.
  202. - Fix [riot#1325](https://github.com/riot/riot/issues/1325) : Gulp + Browserify + Babelify + type="es6" error.
  203. - Fix [riot#1342](https://github.com/riot/riot/issues/1342), [riot#1636](https://github.com/riot/riot/issues/1636) and request from [dwyl/learn-riot#8](https://github.com/dwyl/learn-riot/issues/8) : Server-Side Rendered Page Fails W3C Check. The new `data-is` attribute is used for scoped styles in addition to `riot-tag` (the later will be removed in compiler v3.x)
  204. - The keyword `defer` in `<script src=file>` avoids that the compiler loads the file, preserving the tag - Requested by [riot#1492](https://github.com/riot/riot/issues/1492) : Stop script tags from being evaluated with serverside `riot.render`. It is removed in client-side compilation because browsers will not load scripts through innerHTML.
  205. - It has changed the character used to hide expressions during the compilation, maybe this fix [riot#1588](https://github.com/riot/riot/issues/1588) : Syntax Error: Invalid character `\0129` (riot+compiler.min).
  206. - The option `debug` inserts newlines between the `riot.tag2` parameters and the call is prefixed with the source filename - Requested by [riot#1646](https://github.com/riot/riot/issues/1646) : Split portions of generated html with newline instead of space
  207. - Removed the unused parameter with the compiled-time brackets from the call to `riot.tag2`.
  208. - Removed support for raw expressions. It is unlikely this feature will be implemented in v2.3.x
  209. - Updated the regex that is used to match tag names, more closer to the HTML5 specs.
  210. - Update devDependencies.
  211. ### v2.3.22
  212. - Fix [riot#1511](https://github.com/riot/riot/issues/1511) : Escape Quotes - They may be some issues to fix.
  213. - Regression of logic to parse style and script tags, due to loss of performance and other issues.
  214. - Removed the "compress" option of the `less` parser, which is deprecated and generates warnings in the console.
  215. - Removed the unuseful CSS parser `stylus` from the browser version.
  216. - Refactorization of all the code, with more comments in preparation for the automatic documentation of the API.
  217. - Various tweaks to increase performance and reduce (~55%) memory consumption.
  218. - Files to preprocess are moved from "lib" to the "src" directory, now "lib" has the required node.js files only.
  219. ### v2.3.21 (unpublished due to errors)
  220. ### v2.3.20
  221. - Fix [riot#1495](https://github.com/riot/riot/issues/1495) : Warning of input tag value - Avoids warnings for date/datetime/time/month/email/color types with expression in its value.
  222. - Fix [riot#1488](https://github.com/riot/riot/issues/1488) : Cannot read property 'replace' of undefined when compiling in Node a tag with an import in its less stylesheet -- Thanks to @jrx-jsj
  223. - Fix [riot#1448](https://github.com/riot/riot/issues/1448) : Riot compiler parses and removes content from string declaration. This is partial fix, you need to write `<\/script>` for closing script tags within quoted strings.
  224. - Revised regex that matches `<pre>` tags.
  225. - `@import` directives of `stylus`, `sass`, `scss`, and `less` can be relative to the file being processed.
  226. - Fixed lint issues with new .eslintrc.yml, almost compatible with [JavaScript Standard Style](http://standardjs.com/)
  227. ### v2.3.19
  228. - Fixing issues with double quotes.
  229. - Removed dependency on riot-tmpl for the node build, now we are using a local version of `brackets`.
  230. ### v2.3.18
  231. - Regression of optimized regexes not working in IE9/10.
  232. - Fix #36 : removed the excluded strings from the ouput.
  233. - Fix: avoid changing the global brackets when the compiler is called with other brackets (requires riot-tmpl v2.3.15).
  234. - A new property `version` (string) is included in the compiler set.
  235. - Fixes to travis CI and the bump routine
  236. ### v2.3.15 (unpublished from npm)
  237. - Preparation for use as ES6 module through [rollup.js](http://rollupjs.org/)
  238. - Update devDependencies, including jspreproc v0.2.5 with an important fix.
  239. - Partial regression of fix [riot#1120](https://github.com/riot/riot/issues/1120), `tmpl` can parse double-quotes within expressions, encoding double-quotes generates issues.
  240. ### v2.3.14
  241. - The prefix `__` for boolean attributes is not used anymore. This IE8 hack and it is not neccessary for current supported versions.
  242. - Option `exclude` for ignore parts of the tag. This is an array with one or more of 'html', 'css', 'attribs', 'js'.
  243. - Removed `inert` from the boolean attributes list, this html5 attribute was dropped from the specs.
  244. - Fixed normalization of root attributes, was not working as expected. Example updated.
  245. ### v2.3.13
  246. - Fixed the `style` option for setting the CSS parser through the `options` object.
  247. - Fixed an issue in preservation of line endings in the generated html markup.
  248. - Fixed tests, coverage is 100% again.
  249. - Updated [doc/guide.md](https://github.com/riot/compiler/blob/master/doc/guide.md) and [doc/attributes.md](https://github.com/riot/compiler/blob/master/doc/attrbutes.md) with the latest features.
  250. ### v2.3.12
  251. - Gets rid of the zero-indentation restriction for custom tags, now you can indent these tags, but the opening and closing tag must have exactly the same indentation (length and type). All the tag will be unindented by this amount.
  252. - Support for `src` and `charset` attributes in `<script>` tags for reading JavaScript sources from the file system - [riot#1116](https://github.com/riot/riot/issues/1116), [riot#507](https://github.com/riot/riot/issues/507)
  253. - The `compile` function can return separate parts by setting the new `entities` option. These parts has unescaped newlines.
  254. - New attribute `options` for `script` and `style` tags will append/overwrite attributes in the default configuration object of the parser at tag level.
  255. - Fix [riot#1261](https://github.com/riot/riot/issues/1261) : `<pre>` tag does not preserve neither `\n` nor `\t`.
  256. Now whitespace within `<pre>` tags is always preserved.
  257. - Fix [riot#1358](https://github.com/riot/riot/issues/1358) : Empty style in tag (scoped) breaks.
  258. ### v2.3.11
  259. - New type="babel" supports babel-core v6.x. You must `npm install babel-preset-es2015` too, for this works.
  260. Use type="es6" for babel and babel-core v5.8.x and bellow - [riot#1039](https://github.com/riot/riot/issues/1039)
  261. - Fix [riot#1306](https://github.com/riot/riot/issues/1306) : Compiler preserves newlines in class objects, causing "Unterminated String Constant" errors.
  262. - Fix [riot#1314](https://github.com/riot/riot/issues/1314) : `settings.brackets` no longer works.
  263. - Fix [riot#1309](https://github.com/riot/riot/issues/1309) : Tag renders js instead of content when no attributes present.
  264. ### v2.3.0
  265. This is a complete rewrite and the first solo version of the compiler.
  266. - Now the compiler generates a call to the new `riot.tag2` function, with the same parameters as `riot.tag` and an
  267. additional one: the brackets used in the compilation. `riot.tag2` requires all parameters except the brackets,
  268. so the compiler generates all but ignores the brackets if there are no generated expressions.
  269. - Unlike previous versions, backslashes are removed from the expressions (before being sent to any parser).
  270. Outside of expressions, all backslashes are preserved.
  271. - Double quotes inside expressions are converted to `&quot;`, to avoid issues with HTML markup.
  272. - Fix [riot#1207](https://github.com/riot/riot/issues/1207) : Riot compiler/parser breaks indentation.
  273. - Fix [riot#1120](https://github.com/riot/riot/issues/1120) : Double quotes break Riot attributes
  274. Enhancements
  275. - The compiler loads the brackets in runtime on each tag, allowing use of different brackets. [riot#1122](https://github.com/riot/riot/issues/1122) related.
  276. - Multiple `<script>` blocks. These can have different types and are merged with the untagged script block, if any.
  277. - More flexible formats in ES6 style method definitions.
  278. - In the JavaScript, trailing whitespace are removed and multiple empty lines are combined into one.
  279. - Better recognition of expressions. Now you can use almost any character, even in unquoted expressions (expressions containing the `>` operator needs to be enclosed in quotes) - [riot#744](https://github.com/riot/riot/issues/744)
  280. - If the first character inside an expression is `^`, the expression is not passed to any parser. This is some sort of type=none at expression level - [riot#543](https://github.com/riot/riot/issues/543), [riot#1090](https://github.com/riot/riot/issues/1090)
  281. - Type es6 now supports babel-core - [riot#1039](https://github.com/riot/riot/issues/1039)
  282. - New logic for scoped style blocks, if a style contains the ":scoped" selector, this is replaced by the name of the root element, if not, the name is prepended - [riot#912](https://github.com/riot/riot/issues/912)
  283. - `type="scoped-css"` for `style` tags is deprecated, use only `scoped` or `scoped="scoped"`