-
Notifications
You must be signed in to change notification settings - Fork 39
Fix issues with inlined files output by BuildBundler stream #170
Conversation
usergenic
commented
Mar 30, 2017
- CHANGELOG.md has been updated
- Fixed https://github.com/Polymer/polymer-build/issues/167 where two copies of entrypoint files with same name are emitted by bundler stream: an un-bundled one, followed by bundled one.
- Fixed https://github.com/Polymer/polymer-build/issues/142 where html imports were emitted by bundler as individual files even though they were bundled.
- This depends on a new release of polymer-bundler following review/merge of Changed the Bundler.bundle method to take a manifest from Bundler.generateManifest polymer-bundler#464
@usergenic can you update to pull in Polymer/polymer-bundler#464 ? |
Updated and ready for review! PTAL. /cc @azakus this is the fix you're looking for wrt duplicates. |
2290aad
to
4b0b0e5
Compare
(just pushed |
@usergenic yep, that's about what I did on my side, so it should fix my issue. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:( that the bundler now blocks stream throughput, but 👍 👍 👍 towards fixing these two major bugs. Good stuff.
@usergenic Do you know which users have complained about this specifically, maybe in that issue? It would be good to get them as beta testers before a greater launch, since bundling is such a crucial piece of build and are tests still aren't entirely complete.
src/bundle.ts
Outdated
}); | ||
this._mapFile(file); | ||
} | ||
for (const filepath of this.files.keys()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just do this instead:
for (const file of myMap.values()) {
this.push(file);
}
or even:
this.files.forEach((file) => this.push(file));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! Done.
_unmapBundledFiles(manifest: BundleManifest) { | ||
for (const bundle of manifest.bundles.values()) { | ||
for (const filename of bundle.files) { | ||
this.files.delete(filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on the this.files
definition above, but please document what this.files
state represents. In all other streams it represents a cache of all files, but now it's contents actually dictate the stream output. This would be useful to explain somewhere for later readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added documentation for property.