polymer-bundler
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -11,2 +11,7 @@ # Change Log | ||
## 2.0.3 - 2017-06-07 | ||
- Fixed issue with lazy-imports impacting bundle inlining logic. https://github.com/Polymer/polymer-bundler/issues/536 | ||
- Fixed issue with hidden div being created inside dom-modules. https://github.com/Polymer/polymer-bundler/issues/535 | ||
- Fixed issue with injected dependencies inside dom-modules in shell when using lazy-imports. https://github.com/Polymer/polymer-bundler/issues/534 | ||
## 2.0.2 - 2017-06-02 | ||
@@ -13,0 +18,0 @@ - In cases such as the shell merge strategy, imports which are not originally |
@@ -138,3 +138,3 @@ "use strict"; | ||
_attachHiddenDiv(ast, hiddenDiv) { | ||
const firstHtmlImport = dom5.query(ast, matchers.htmlImport); | ||
const firstHtmlImport = dom5.query(ast, matchers.eagerHtmlImport); | ||
const body = dom5.query(ast, matchers.body); | ||
@@ -260,6 +260,8 @@ if (body) { | ||
// targets to prepended injected imports to. | ||
const existingImports = [...document.getFeatures({ kind: 'html-import', noLazyImports: true, imported: false })]; | ||
const existingImports = [ | ||
...document.getFeatures({ kind: 'html-import', noLazyImports: true, imported: false }) | ||
].filter((i) => !i.lazy); | ||
const existingImportDependencies = new Map(existingImports.map((existingImport) => [existingImport.document.url, [ | ||
...existingImport.document.getFeatures({ kind: 'html-import', imported: true, noLazyImports: true }) | ||
].map((feature) => feature.document.url)])); | ||
].filter((i) => !i.lazy).map((feature) => feature.document.url)])); | ||
// Every file in the bundle is a candidate for injection into the document. | ||
@@ -266,0 +268,0 @@ for (const importUrl of bundle.bundle.files) { |
@@ -52,10 +52,14 @@ "use strict"; | ||
const importBundle = manifest.getBundleForFile(resolvedImportUrl); | ||
// Don't reprocess the same file again. | ||
if (visitedUrls.has(resolvedImportUrl)) { | ||
astUtils.removeElementAndNewline(linkTag); | ||
return; | ||
// We don't want to process the same eager import again, but we want to | ||
// process every lazy import we see. | ||
if (!isLazy) { | ||
// Don't reprocess the same file again. | ||
if (visitedUrls.has(resolvedImportUrl)) { | ||
astUtils.removeElementAndNewline(linkTag); | ||
return; | ||
} | ||
// We've never seen this import before, so we'll add it to the set to guard | ||
// against inlining it again in the future. | ||
visitedUrls.add(resolvedImportUrl); | ||
} | ||
// We've never seen this import before, so we'll add it to the set to guard | ||
// against processing it again in the future. | ||
visitedUrls.add(resolvedImportUrl); | ||
// If we can't find a bundle for the referenced import, record that we've | ||
@@ -62,0 +66,0 @@ // processed it, but don't remove the import link. Browser will handle it. |
@@ -580,3 +580,3 @@ "use strict"; | ||
const shell = parse5.serialize(result.documents.get('importing-fragments/shell.html').ast); | ||
const fragmentAAt = shell.indexOf('href="fragment-a.html"'); | ||
const fragmentAAt = shell.indexOf('rel="import" href="fragment-a.html"'); | ||
const shellAt = shell.indexOf(`console.log('shell.html')`); | ||
@@ -583,0 +583,0 @@ const sharedUtilAt = shell.indexOf(`console.log('shared-util.html')`); |
{ | ||
"name": "polymer-bundler", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Process Web Components into one output file", | ||
@@ -5,0 +5,0 @@ "main": "lib/bundler.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
367731
4384