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.

403 lines
18 KiB

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