web 3d图形渲染器
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.

394 lines
11 KiB

  1. # magic-string changelog
  2. ## 0.25.7
  3. * fix bundle mappings after remove and move in multiple sources ([#172](https://github.com/Rich-Harris/magic-string/issues/172))
  4. ## 0.25.6
  5. * Use bitwise operators for small performance boost ([#171](https://github.com/Rich-Harris/magic-string/pull/171))
  6. ## 0.25.5
  7. * Use a bitset to reduce memory consumption ([#167](https://github.com/Rich-Harris/magic-string/issues/167))
  8. ## 0.25.4
  9. * Clone `intro` and `outro` ([#162](https://github.com/Rich-Harris/magic-string/issues/162))
  10. ## 0.25.3
  11. * Fix typing of `SourceMap.version`.
  12. ## 0.25.2
  13. * Remove deprecated `new Buffer(...)`
  14. * Handle characters outside Latin1 range when generating a sourcemap in browser ([#154](https://github.com/Rich-Harris/magic-string/issues/154))
  15. ## 0.25.1
  16. * Additional types for index.d.ts ([#148](https://github.com/Rich-Harris/magic-string/pull/148))
  17. ## 0.25.0
  18. * Add `length` method ([#145](https://github.com/Rich-Harris/magic-string/pull/145))
  19. * Fix trimming chunks with intro/outro ([#144](https://github.com/Rich-Harris/magic-string/pull/144))
  20. ## 0.24.1
  21. * Add `lastLine` and `lastChar` methods ([#142](https://github.com/Rich-Harris/magic-string/pull/142))
  22. ## 0.24.0
  23. * Add `isEmpty` methods ([#137](https://github.com/Rich-Harris/magic-string/pull/137))
  24. * Fix a potential race condition ([#136](https://github.com/Rich-Harris/magic-string/pull/136))
  25. * Fix CJS/ES bundles inlining `sourcemap-codec` in 0.23.2.
  26. ## 0.23.2
  27. * Add `generateDecodedMap` methods ([#134](https://github.com/Rich-Harris/magic-string/pull/134))
  28. ## 0.23.1
  29. * Performance ([#132](https://github.com/Rich-Harris/magic-string/pull/132))
  30. ## 0.23.0
  31. * Use `sourcemap-codec` for improved performance ([#133](https://github.com/Rich-Harris/magic-string/pull/133))
  32. ## 0.22.5
  33. * Add TypeScript interfaces used by rollup ([#131](https://github.com/Rich-Harris/magic-string/pull/131))
  34. * Remove src directory from npm package
  35. ## 0.22.4
  36. * `contentOnly` and `storeName` are both optional
  37. ## 0.22.3
  38. * Add `original` to TS definitions
  39. ## 0.22.2
  40. * Avoid `declare module` ([#127](https://github.com/Rich-Harris/magic-string/pull/127))
  41. ## 0.22.1
  42. * Update TypeScript definitions ([#124](https://github.com/Rich-Harris/magic-string/pull/124))
  43. ## 0.22.0
  44. * Prevent `overwrite` state corruption ([#115](https://github.com/Rich-Harris/magic-string/issues/115))
  45. * Various bugfixes ([#126](https://github.com/Rich-Harris/magic-string/pull/126))
  46. ## 0.21.3
  47. * Clone `indentExclusionRanges` correctly ([#122](https://github.com/Rich-Harris/magic-string/pull/122))
  48. * Fix more typings ([#122](https://github.com/Rich-Harris/magic-string/pull/122))
  49. ## 0.21.2
  50. * Add `default` property referencing self in index-legacy.js, to work around TypeScript bug ([#121](https://github.com/Rich-Harris/magic-string/pull/121))
  51. ## 0.21.1
  52. * Add typings file to package
  53. ## 0.21.0
  54. * Add TypeScript bindings ([#119](https://github.com/Rich-Harris/magic-string/pull/119))
  55. ## 0.20.0
  56. * The fourth argument to `overwrite` is a `{storeName, contentOnly}` options object. `storeName: true` is equivalent to `true` before. `contentOnly` will preserve existing appends/prepends to the chunk in question
  57. ## 0.19.1
  58. * Prevent overwrites across a split point (i.e. following a `move`)
  59. * Implement `remove` separately to `overwrite`
  60. ## 0.19.0
  61. * More accurate bundle sourcemaps ([#114](https://github.com/Rich-Harris/magic-string/pull/114))
  62. ## 0.18.0
  63. * Optimisation – remove empty chunks following `overwrite` or `remove` ([#113](https://github.com/Rich-Harris/magic-string/pull/113))
  64. ## 0.17.0
  65. * Add `appendLeft`, `appendRight`, `prependLeft`, `prependRight` methods ([#109](https://github.com/Rich-Harris/magic-string/issues/109))
  66. * `insertLeft` and `insertRight` are deprecated in favour of `appendLeft` and `prependRight` respectively
  67. ## 0.16.0
  68. * Include inserts in range for `overwrite` and `remove` operations ([#89](https://github.com/Rich-Harris/magic-string/pull/89))
  69. * Make options optional for `bundle.generateMap(...)` ([#73](https://github.com/Rich-Harris/magic-string/pull/73))
  70. ## 0.15.2
  71. * Generate correct bundle sourcemap with prepended/appended content
  72. ## 0.15.1
  73. * Minor sourcemap fixes
  74. ## 0.15.0
  75. * Use named export of `Bundle` in ES build, so ES consumers of magic-string can tree-shake it out
  76. ## 0.14.0
  77. * Throw if overwrite of zero-length range is attempted
  78. * Correctly handle redundant move operations
  79. ## 0.13.1
  80. * Fix a bevy of `s.slice()` issues ([#62](https://github.com/Rich-Harris/magic-string/pull/62))
  81. ## 0.13.0
  82. * Breaking: `insertAfter` is now `insertLeft`, `insertBefore` is now `insertRight`
  83. * Breaking: `insert` is no longer available. Use `insertLeft` and `insertRight`
  84. * Significant performance improvements
  85. ## 0.12.1
  86. * Fix sourcemap generation with `insertAfter` and `insertBefore`
  87. ## 0.12.0
  88. * Add `insertAfter` and `insertBefore` methods
  89. ## 0.11.4
  90. * Fix two regression bugs with `trim()`
  91. * More informative error message on illegal removals
  92. ## 0.11.3
  93. * Fix trim methods to ensure correct sourcemaps with trimmed content ([#53](https://github.com/Rich-Harris/magic-string/pull/53))
  94. ## 0.11.2
  95. * Support sourcemaps with moved content
  96. ## 0.11.1
  97. * Use `findIndex` helper for 0.12 support
  98. ## 0.11.0
  99. * Add experimental `move()` method
  100. * Refactor internals to support `move()`
  101. ## 0.10.2
  102. * Do not overwrite inserts at the end of patched ranges ([#35](https://github.com/Rich-Harris/magic-string/pull/35))
  103. ## 0.10.1
  104. * Zero-length inserts are not removed on adjacent overwrites
  105. ## 0.10.0
  106. * Complete rewrite, resulting in ~40x speed increase ([#30](https://github.com/Rich-Harris/magic-string/pull/30))
  107. * Breaking – `magicString.locate` and `locateOrigin` are deprecated
  108. * More forgiving rules about contiguous patches, and which ranges are valid with `magicString.slice(...)`
  109. ## 0.9.1
  110. * Update deps
  111. ## 0.9.0
  112. * Update build process
  113. ## 0.8.0
  114. * Add an ES6 build, change default UMD build to CommonJS (but keeping existing UMD build with bundled dependencies)
  115. * Make properties non-enumerable, for cleaner logging
  116. * Update dependencies
  117. ## 0.7.0
  118. * The `names` array is populated when generating sourcemaps, and mappings include name indices where appropriate ([#16](https://github.com/Rich-Harris/magic-string/issues/16))
  119. * Replaced content is mapped correctly in sourcemaps ([#15](https://github.com/Rich-Harris/magic-string/issues/15))
  120. ## 0.6.6
  121. * Adjust mappings correctly when removing replaced content
  122. * Error correctly when removed characters are used as slice anchors
  123. ## 0.6.5
  124. * Fix `jsnext:main` in package.json
  125. ## 0.6.4
  126. * Fix bug with positive integer coercion
  127. ## 0.6.3
  128. * Intro content is correctly indented
  129. * Content following an intro with trailing newline is correctly indented
  130. ## 0.6.2
  131. * Noop indents are still chainable (fixes bug introduced in 0.6.1)
  132. ## 0.6.1
  133. * Indenting with an empty string is a noop
  134. ## 0.6.0
  135. * Use rollup for bundling, instead of esperanto
  136. ## 0.5.3
  137. * Correct sourcemap generation with bundles containing varied separators
  138. * `s.clone()` clones indent exclusion ranges and sourcemap locations
  139. ## 0.5.2
  140. * `s.slice()` accepts negative numbers, and the second argument can be omitted (means 'original string length'), just like `String.prototype.slice`
  141. * More informative error message when trying to overwrite content illegally
  142. ## 0.5.1
  143. * Allow bundle separator to be the empty string
  144. * Indenting is handled correctly with empty string separator
  145. ## 0.5.0
  146. * `s.replace()` is deprecated in favour of `s.overwrite()` (identical signature)
  147. * `bundle.addSource()` can take a `MagicString` instance as its sole argument, for convenience
  148. * The `options` in `new MagicString(str, options)` can include `filename` and `indentExclusionRanges` options, which will be used when bundling
  149. * New method: `s.snip( start, end )`
  150. ## 0.4.9
  151. * `file` option is optional when generating a bundle sourcemap
  152. ## 0.4.7
  153. * Repeated insertions at position 0 behave the same as other positions ([#10](https://github.com/Rich-Harris/magic-string/pull/10))
  154. ## 0.4.6
  155. * Overlapping ranges can be removed
  156. * Non-string content is rejected ([#9](https://github.com/Rich-Harris/magic-string/pull/9))
  157. ## 0.4.5
  158. * Implement `source.addSourcemapLocation()`
  159. ## 0.4.4
  160. * Another Windows fix, this time for file paths when bundling
  161. ## 0.4.3
  162. * Handle Windows-style CRLF newlines when determining whether a line is empty
  163. ## 0.4.2
  164. * Fix typo in package.json (d'oh again)
  165. * Use only relative paths for internal modules - makes bundling with dependents (i.e. esperanto) possible
  166. ## 0.4.1
  167. * Includes correct files in npm package (d'oh)
  168. ## 0.4.0
  169. * Using experimental Esperanto feature ([esperantojs/esperanto#68](https://github.com/esperantojs/esperanto/issues/68)) to generate version with `vlq` dependency included
  170. ## 0.3.1
  171. * Fixes a bug whereby multiple insertions at the same location would cause text to repeat ([#5](https://github.com/Rich-Harris/magic-string/issues/5))
  172. ## 0.3.0
  173. * Breaking change - `source.indentStr` is `null` if no lines are indented. Use `source.getIndentString()` for the old behaviour (guess, and if no lines are indented, return `\t`)
  174. * `bundle.getIndentString()` ignores sources with no indented lines when guessing indentation ([#3](https://github.com/Rich-Harris/magic-string/issues/3))
  175. ## 0.2.7
  176. * `source.trimLines()` removes empty lines from start/end of source, leaving other whitespace untouched
  177. * Indentation is not added to an empty source
  178. ## 0.2.6
  179. * Performance improvement - adjustments are only made when necessary
  180. ## 0.2.5
  181. * Single spaces are ignored when guessing indentation - experience shows these are more likely to be e.g. JSDoc comments than actual indentation
  182. * `bundle.addSource()` can take an `indentExclusionRanges` option
  183. ## 0.2.4
  184. * Empty lines are not indented
  185. ## 0.2.3
  186. * Fixes edge case with bundle sourcemaps
  187. ## 0.2.2
  188. * Make `sources` paths in sourcemaps relative to `options.file`
  189. ## 0.2.1
  190. * Minor fix for `bundle.indent()`
  191. ## 0.2.0
  192. * Implement `MagicString.Bundle` for concatenating magic strings
  193. ## 0.1.10
  194. * Fix sourcemap encoding
  195. ## 0.1.9
  196. * Better performance when indenting large chunks of code
  197. ## 0.1.8
  198. * Sourcemaps generated with `s.generateMap()` have a `toUrl()` method that generates a DataURI
  199. ## 0.1.7
  200. * Implement `s.insert( index, content )` - roughly equivalent to `s.replace( index, index, content )`
  201. ## 0.1.6
  202. * Version bump for npm's benefit
  203. ## 0.1.5
  204. * `s.indent({ exclude: [ x, y ] })` prevents lines between (original) characters `x` and `y` from being indented. Multiple exclusion ranges are also supported (e.g. `exclude: [[a, b], [c, d]]`)
  205. ## 0.1.4
  206. * `s.locate()` doesn't throw out-of-bound error if index is equal to original string's length
  207. ## 0.1.3
  208. * `s.trim()` returns `this` (i.e. is chainable)
  209. ## 0.1.2
  210. * Implement `s.slice()`
  211. ## 0.1.1
  212. * Implement `s.trim()`
  213. ## 0.1.0
  214. * First release