21.3 kBMarkdownView Raw
1# Change Log
3All notable changes to this project will be documented in this file.
5The format is based on [Keep a Changelog](http://keepachangelog.com/)
6and this project adheres to [Semantic Versioning](http://semver.org/).
8<!-- ## Unreleased -->
9<!-- Add new, unreleased changes here. -->
11## [3.1.4] - 2019-04-26
12* Fixed an issue where bare specifiers were not rewritten for dynamic imports after transforming them to AMD require statements.
14## [3.1.3] - 2019-04-02
15* Disabled `babel-plugin-minify-builtins` and `babel-plugin-minify-remove-undefined` due to errors in `babel-preset-minify`.
17## [3.1.2] - 2019-03-01
18* Added support for `treeshake` option to remove dead JavaScript code when bundling.
20## [3.1.1] - 2018-11-12
21* Fix issue with deadcode removal in babel-minify, by turning it off, as it can be error prone and result in removal of code which should not be removed and cause hard to debug errors. https://github.com/Polymer/tools/issues/724
23## [3.1.0] - 2018-10-15
24* Added `wct-mocha` to the set of recognized WCT client-side packages in `htmlTransform` when using [@polymer/esm-amd-loader](https://github.com/Polymer/tools/tree/master/packages/esm-amd-loader).
26## [3.0.4] - 2018-06-28
27* Fix NPM audit warnings.
29## [3.0.3] - 2018-06-25
30* Service Worker generation uses a consistent spacing for anonymous
31 functions (i.e. space between keyword and parentheses `function ()`)
32 ensuring Node 8 and 10 output are identical.
34## [3.0.2] - 2018-06-19
35* Fix incorrect relative paths to the component directory in push manifests.
36* Fix push manifest generation crash with ES module projects.
38## [3.0.1] - 2018-05-14
39* Pin dependency babel-plugin-minify-guarded-expressions of
40 babel-preset-minify to known working version 0.4.1.
42## [3.0.0] - 2018-05-08
43* Updated dependencies.
45## [3.0.0-pre.17] - 2018-05-03
46* The transform for `import.meta` now uses the special `"meta"` dependency
47 provided by
48 [@polymer/esm-amd-loader](https://github.com/Polymer/tools/tree/master/packages/esm-amd-loader),
49 instead of injecting a static path. As a result, it is now always coupled with
50 the AMD transform, and cannot be enabled independently.
51* The [regenerator runtime](https://github.com/facebook/regenerator) can now
52 be injected either inline each time it is used by `jsTransform`, or inline
53 into the HTML document by `htmlTransform`.
54* Added es5, es2015, es2016, es2017, and es2018 compile targets to `jsTransform`
55 to allow fine grained control over what features to compile.
57## [3.0.0-pre.16] - 2018-05-01
58* Disable the `simplify` babel plugin when minifying javascript. See
59 https://github.com/babel/minify/issues/824
60* Disable the `mangle` babel plugin as well. See
61 https://github.com/Polymer/tools/issues/261
62* Add "webcomponents-bundle.js" to the heuristic used to determine when to
63 inject the Custom Elements ES5 Adapter.
64* Dropped support for node v6. This is a soft break, as we aren't
65 making any changes that are known to break node v6, but we're no longer testing against it. See our [node version support policy](https://www.polymer-project.org/2.0/docs/tools/node-support)
66 for details.
67* Replaced RequireJS AMD loader with
68 [@polymer/esm-amd-loader](https://github.com/Polymer/tools/tree/master/packages/esm-amd-loader),
69 which is smaller and better emulates the behavior of ES modules.
71## [3.0.0-pre.15] - 2018-04-25
72* `@babel/preset-es2015` has been replaced with a manually-created version so that `@babel/plugin-transform-classes` can be pinned to v7.0.0-beta.35 to avoid a bug where the polyfilled HTMLElement constructor is not called. (https://github.com/babel/babel/issues/7506)
74## [3.0.0-pre.14] - 2018-04-23
75* Disable Babel `minify-constant-folding` plugin when minifying. This plugin has a bug that breaks when a constant is exported from a module (https://github.com/babel/minify/issues/820).
77## [3.0.0-pre.13] - 2018-04-18
78* Fix node module resolution for the case where the root package is served from
79 the components/ directory and imports a module from its own package using a
80 path.
82## [3.0.0-pre.12] - 2018-04-17
83* The Babel helpers script now includes all Babel helpers that could be used by the ES5 compilation and AMD transforms.
84* The `jsTransform` function's `injectBabelHelpers` option now has 3 possible values: `none` (default), `full`, and `amd`.
85* Inline JavaScript will now only be transformed to AMD modules if they have type=module.
86* External JavaScript files will now only be transformed to AMD modules if they contain module import/export syntax.
88## [3.0.0-pre.11] - 2018-04-11
89* Fix AMD transform bug where if an HTML document had multiple type=module scripts, and any of them (apart from the first) had any kind of import, then that import was not accessible (because it was mapped to the wrong module callback function argument).
91## [3.0.0-pre.10] - 2018-04-09
92* [breaking] The `jsTransform` function will now inline any required Babel helper functions by default. Previously they were always omitted. Added `externalHelpers` option to disable inlining. Note that the behavior of the build transformers from `getOptimizeStreams` continue to never inline the Babel helpers.
94## [3.0.0-pre.9] - 2018-04-05
95* Fix bug with node module resolution where specifiers in dynamic import() were rewritten.
96* Fix bug with dynamic import rewriting where imported require function could not be called.
98## [3.0.0-pre.8] - 2018-04-04
99* Fix bug where not all percent-encoded characters in URIs would be decoded (in particular, `%40` -> `@` which is important for scoped NPM packages).
101## [3.0.0-pre.7] - 2018-04-03
102* [breaking] Rename `jsTransform` and `getOptimizeStreams` option from `transformEsModuleToAmd` to `transformModuleToAmd`.
103* [breaking] The `transformModulesToAmd` option in `jsTransform` now automatically implies `transformImportMeta`, and throws if `transformImportMeta` is set to false.
104* [breaking] The `JsTransform` class now takes a full `OptimizeOptions` instead of just a `JsOptimizeOptions`.
106## [3.0.0-pre.6] - 2018-04-02
107* Add an `import.meta` transform to `jsTransform` with the `transformImportMeta` option.
108* Add a dynamic import() transform to AMD require()
110## [3.0.0-pre.5] - 2018-03-28
111* AMD loader will now only be injected into an HTML document if it contains at least one `type=module` script.
112* Added `softSyntaxError` option to `jsTransform`. If set, Babel parse errors will no longer throw. Instead, a console error will be logged, and the original JS returned.
113* Expose `htmlTransform` from main package index.
115## [3.0.0-pre.4] - 2018-03-28
116* ES to AMD module transformation is now supported by `getOptimizeStreams` and `htmlTransform`. Additionally:
117 * Will now inject an inline minified RequireJS AMD loader, and the Babel helpers.
118 * Phantom `<html>`, `<head>`, and `<body>` tags injected by parse5 are now removed.
120## [3.0.0-pre.3] - 2018-03-28
121* Upgraded to `polymer-bundler@4.0.0-pre.3` which brings ES6 module bundling to the build pipeline! Upgraded to `polymer-analyzer@3.0.0-pre.18`.
123## [3.0.0-pre.2] - 2018-03-26
124* Add `htmlTransform` function, factored out of the Polyserve `compile-middleware` module.
125* Add ordered execution to the ES to AMD module transformation in `htmlTransform`.
126* Node module specifier rewriter will now resolve paths according to the node module resolution algorithm, not just bare specifiers (e.g. "./foo" resolves to "./foo.js").
128## [3.0.0-pre.1] - 2018-03-21
129* Upgraded to `polymer-analyzer@3.0.0-pre.17` and `polymer-bundler@4.0.0-pre.2`.
130* Converted from `PackageUrlResolver` to `FsUrlResolver` as more appropriate to application build context.
131* Ignore `not-loadable` warnings, as polymer-build should not load remote
132 resources.
134## [2.5.0] - 2018-03-21
135* Add `packageName` option to `jsTransform()` function. Option is required when
136 `isComponentRequest` option is true.
138## [2.4.1] - 2018-03-20
139* Fix import specifier rewriting when importing a dependency from a top-level module.
141## [2.4.0] - 2018-03-19
142* Fix dependency specification for `babel-core`
143* Add `jsTransform` function, factored out of `optimize-streams` module (so that it can be shared with Polyserve).
144* Renamed `jsTransform` option from `compile` to `compileToEs5` to clarify its behavior.
145* Added `transformEsModulesToAmd` option to `jsTransform` and JS stream transformer.
146* Add exponentiation, async/await, and async generator syntax/transform support to `jsTransform`.
148## [2.3.3] - 2018-03-14
149* Don't run Babel at all if there are no meaningful changes to make.
151## [2.3.2] - 2018-03-13
152* Fix bug where JS compilation/minification would ignore the "excludes" field.
154## [2.3.1] - 2018-03-12
155* Restore ES5 template literal uniquifying feature from https://github.com/Polymer/polymer-cli/pull/962 that was missed in earlier code migration.
156* Allow "none" moduleResolution option in JS compile transform.
158## [2.3.0] - 2018-03-12
159* JS compile and other "optimize streams" build transformers have been moved from polyer-cli into this package.
160* JS compile build transformer wil now rewrite bare module specifiers to paths.
161* Module bare specifier rewriting Babel plugin has been moved from polyserve into this package.
162* Module bare specifier rewriting Babel plugin now works on Windows, does not rewrite fully qualified URLs, and will follow the "module" or "jsnext:main" fields when a package.json uses them instead of "main".
164## [2.2.0] - 2018-02-23
165* Fixed issue where the build silently fails when several source dependencies are missing
166* If the ProjectConfig given to BuildAnalyzer has a `componentDir`, pass a PackageUrlResolver using that `componentDir` to the underlying Analyzer.
167* Warnings indicated in the `lint.warningsToIgnore` ProjectConfig option are now ignored.
169## [2.1.1] - 2017-10-23
170* Updated `polymer-bundler` to 3.1.1, to fix an issue with deprecated CSS imports being inlined into the wrong templates.
172## [2.1.0] - 2017-10-02
173* Updated `polymer-bundler` to 3.1.0, which inlines external stylesheet links in templates.
175## [2.0.0] - 2017-07-18
176* [Breaking] Upgraded `polymer-bundler` to 3.x, which includes new default behavior around the `rewriteUrlsInTemplates` option in support of Polymer 2.x defaults. Polymer 1.x project developers should set the option `rewriteUrlsInTemplates: true`. See [using polymer-bundler programmatically](https://github.com/polymer/polymer-bundler#using-polymer-bundler-programmatically) for more information.
178## [1.6.0] - 2017-06-29
179* Automatically recognize any lazy-imports encountered as fragments when generating push-manifest.
180* The `addPushManifest` feature now honors the laziness of html-imports and excludes them from the set of their importers' pushed assets.
181* Upgraded Polymer Bundler to 2.2.0, which updated the shell strategy so that the shell is no longer linked to from other bundles. See [Bundler issue #471](https://github.com/Polymer/polymer-bundler/issues/471) for more details.
183## [1.5.1] - 2017-06-02
184* Prefetch links are now only added for transitive dependencies.
186## [1.5.0] - 2017-05-23
187* Service Worker generator now generates relative URLs for pre-cached assets instead of absolute. This makes it possible to cache assets when the app is served from a non-root path without re-mapping all URLs. Since server workers fetch relative to their own URL, there is no effective change for service workers served from the root path.
188* Service Worker generator now better caches the entrypoint by setting navigateFallback and related options.
190## [1.4.2] - 2017-05-19
191* Updated the AddPrefetchLinks transform to not insert html root element tags like `<html>`, `<head>` or `<body>`.
193## [1.4.1] - 2017-05-18
194* Updated dependency on `polymer-bundler` to use official 2.0.0 release and enable unmediated semver upgrades.
195* Fixed issue with push manifest URLs being a mix of relative and absolute URLs (now always relative), and a double-delimiter issue when using basePath.
197## [1.4.0] - 2017-05-18
199* Added `PolymerProject.addPrefetchLinks()` transform.
200* Added `PolymerProject.addBabelHelpersInEntrypoint()` transform.
202## [1.3.1] - 2017-05-16
204* Updated polymer-project-config dependency.
206## [1.3.0] - 2017-05-15
208* A prefix can now be passed to `addPushManifest()`, which will be prepended to all push manifest resource paths.
209* A basePath can now be passed to the service worker generator, where it will be used as the sw-precache replacePrefix.
210* Upgrade to Polymer Analyzer that changes many errors to warnings for more robust builds.
212## [1.2.5] - 2017-05-15
214* Updated `polymer-analyzer` dependency to `^2.0.0` now that it is out of alpha.
216## [1.2.4] - 2017-05-11
218* Simplify addCustomElementsEs5Adapter() adapter injection method.
219* Bundler stream no longer emits any CSS or Javascript files which have been inlined into bundles.
221## [1.2.3] - 2017-05-10
223* Dependency updates. Fixes issue with `polymer-bundler`'s handling of `lazy-import` links in `dom-modules`.
225## [1.2.2] - 2017-05-09
227* Dependency updates. Update to `sw-precache@5` to prevent "corrupted data" errors on Firefox 52 and Chrome 59 when using `addServiceWorker()`. Upgraded `polymer-bundler` and `polymer-analyzer` to address `lazy-import` bugs.
229## [1.2.1] - 2017-05-03
231* Dependency updates. Upgraded to new `polymer-bundler`. Most important update is a fix to bug whereby `lazy-import` links were being moved out of their `<dom-module>` containers.
233## [1.2.0] - 2017-05-02
235* Dependency updates. Upgraded to new `polymer-bundler`, `polymer-analyzer` and `dom5` versions.
236* Fixed bug where `<html>`, `<head>` and `<body>` were added to documents mutated by `HtmlSplitter` and the `CustomElementsES5AdapterInjector`.
237* Print build-time warnings and errors with full location information, and precise underlines of the place where the problem was identified.
238* Fixed issue where two copies of entrypoint files with same name are emitted by bundler stream: an un-bundled one, followed by bundled one.
239* Fixed issue where html imports were emitted by bundler as individual files even though they were bundled.
240* Added an options argument to `PolymerProject#bundler()` to support users configuring the bundler. Options include all `Bundler#constructor` options, `analyzer`, `excludes`, `inlineCss`, `inlineScripts`, `rewriteUrlsInTemplates`, `sourcemaps`, `stripComments`, as well as `strategy` and `urlMapper` which are used on call to `Bundler#generateManifest`.
242## [1.1.0] - 2017-04-14
244* Add `addCustomElementsEs5Adapter()` method to PolymerProject. Provides an adapter needed when serving ES5 to browsers that support the native Custom Elements API.
246## [1.0.0] - 2017-04-11
248* [Breaking] Remove Node v4 support: Node v4 is no longer in Active LTS, so as per the [Polymer Tools Node.js Support Policy](https://www.polymer-project.org/2.0/docs/tools/node-support) polymer-build will not support Node v4. Please update to Node v6 or later to continue using the latest verisons of Polymer tooling.
249* New Feature: add automatic [HTTP/2 push manifest](https://github.com/GoogleChrome/http2-push-manifest) generation for HTTP/2 Push-enabled servers.
251## [0.9.1] - 2017-03-20
253* Fixed issue with Service Worker generation in Windows environment where full paths were put into its precacheConfig instead of relative paths.
254* Bundled files always use canonical platform separators in their paths now. Previously, files might have either back-slashes or forward-slashes on Windows, depending on how they arrived at the Bundler and this caused the Analyzer to treat files as missing when mapping them by path.
256## [0.9.0] - 2017-03-15
258* [breaking] PolymerProject's `bundler` property is now a `bundler()` method, returning a new BuildBundler stream on each call. This is to support parallel pipelines using bundler.
260## [0.8.4] - 2017-03-04
262* Build now delegates authority to the Analyzer for what urls are package external instead of local heuristics.
263* Bundling now processes files coming in from streams, to support things like js-minification before bundling.
265## [0.8.3] - 2017-03-03
267* Dependency updates.
269## [0.8.2] - 2017-02-24
271* Dependency updates
273## [0.8.1] - 2017-02-17
275* Update the version of `polymer-bundler` to fix several bugs:
276 * Fix regressions in url attribute updating (src, href, assetpath).
277 * Added support for `<base>` href and target attribute emulation on bundled output.
278 * Whitespace-agnostic license comment deduplication.
279 * Server-side includes no longer stripped as comments.
281## [0.8.0] - 2017-02-14
283* `project.splitHtml()` & `project.rejoinHtml()` methods have been pulled off of `PolymerProject` so that multiple streams can split/rejoin in parallel. See [the new README section on `HTMLSplitter`](https://github.com/Polymer/polymer-build#handling-inlined-cssjs) for updated instructions on how to split/rejoin inline scripts and styles in your build stream.
284* Completed the migration away from `hydrolysis` to `polymer-analyzer` and `vulcanize` to `polymer-bundler`.
285* Do a better job of only listing warnings for code in the package being built.
287## [0.7.1] - 2017-02-03
289* Fix issue where larger projects would cause the sources stream to hang.
291## [0.7.0] - 2017-01-31
293* `BuildAnalyzer.sources` & `BuildAnalyzer.dependencies` are now `BuildAnalyzer.sources()` & `BuildAnalyzer.dependencies()`, respectively. This change only affects uses who are importing and/or using the `BuildAnalyzer` class directly.
294* Fix issue where files were being loaded immediately, before the build stream was started.
297## [0.6.0] - 2017-01-04
299* Fix issue where missing source files were causing silent stream failures.
300* **Interface Update!** `PolymerProject.analyzer` is no longer a required step in your build pipeline. Instead, analysis happens automatically while it fills the `project.sources()` and `project.dependencies()` streams with your project files. See [the README](/README.md) for updated examples of what build streams look like without the analyzer.
301* **[`merge-stream`](https://www.npmjs.com/package/merge-stream) users:** Update to v1.0.1 or later if you are using `merge-stream` with `polymer-build`. Stream errors do not propagate properly in previous versions of the library, and your build task may silently fail as a result.
302* `StreamAnalyzer` is now `BuildAnalyzer` (since it is no longer a stream). This change only affects uses who are importing and/or using `StreamAnalyzer` directly from the `polymer-build` module.
303* Fix issue where behaviors were not being analyzed properly.
304* Update the version of polymer-analyzer we use, fixing a number of errors.
307 <summary><strong>v0.6.0 Pre-Release Changelog</strong></summary><p>
309### [0.6.0-alpha.3] - 2016-12-19
311* Actually update the version of polymer-analyzer we use, fixing a number of errors. (alpha.2 was accidentally a noop release).
313### [0.6.0-alpha.2] - 2016-12-19
315* Update the version of polymer-analyzer we use, fixing a number of errors.
317### [0.6.0-alpha.1] - 2016-12-13
319* **Interface Update!** `PolymerProject.analyzer` is no longer a required step in your build pipeline. Instead, analysis happens automatically while it fills the `project.sources()` and `project.dependencies()` streams with your project files. See [the README](/README.md) for updated examples of what build streams look like without the analyzer.
320* **[`merge-stream`](https://www.npmjs.com/package/merge-stream) users:** Update to v1.0.1 or later if you are using `merge-stream` with `polymer-build`. Stream errors do not propagate properly in previous versions of the library, and your build task may silently fail as a result.
321* `StreamAnalyzer` is now `BuildAnalyzer` (since it is no longer a stream). This change only affects uses who are importing and/or using `StreamAnalyzer` directly from the `polymer-build` module.
322* Fix issue where behaviors were not being analyzed properly.
326## [0.5.1] - 2016-12-02
328* Updated polymer-analyzer to `2.0.0-alpha.18`
330## [0.5.0] - 2016-11-01
332* **New Analyzer!** Should fix most reported bugs that were caused by bad analysis, but may introduce new ones. Be sure to test your build after upgrading to confirm that your build is still functioning. See [`polymer-analyzer`](https://github.com/Polymer/polymer-analyzer) for more information.
333 * Fixed silent failures during build analysis.
334 * Added warning printing during build analysis (#54).
335* Added support for relative `root` paths.
336* Renamed two `AddServiceWorkerOptions` properties:
337 * `serviceWorkerPath` was renamed to `path`.
338 * `swConfig` was renamed to `swPrecacheConfig`.
339 * Old names are deprecated, and support for them will be removed in future versions.
340* polymer.json configuration now managed by [`polymer-project-config`](https://github.com/Polymer/polymer-project-config)
341* Upgrade outdated dependencies:
342 * `sw-precache@4.2.0` generates a new kind of service-worker that will require all users to repopulate their cache. Otherwise it continues to behave the same as before.
344## [0.4.1] - 2016-08-24
346### Fixed
347* No longer modifies the object passed to `generateServiceWorker()` – https://github.com/Polymer/polymer-build/pull/27
349## [0.4.0] - 2016-08-05
351### Fixed
352* Don't halt building when encountering imports of absolute URLs (i.e. https://example.com/font.css).
354### Added
355* Generate `.d.ts` files for typescript users.