-
Notifications
You must be signed in to change notification settings - Fork 133
Conversation
…on't litter code with regexps.
…l modules include the relative path to the module from the bundle entrypoint.
…ing PR feedback. Made the bundle type key off the presence of a subbundle URL in entrypoints list.
… deps-index file.
…orts instead of nesting them under namespace keys.
…and rollup of bundles.
…ently applied to all es6-module bundles via same analysis.
… function constructors.
…as found in HtmlBundler.
- Renamed `_inlineScripts` to `_inlineNonModuleScripts` - Renamed `_rollupInlineScripts` to `_inlineModuleScripts` - Moved responsibility for re-analyzing AST inside `_inlineModuleScripts` since that is implementation detail of that algorithm needing a `document.getFeatures` call. - Moved `rewriteNode` from `babel-utils` to `overwriteObject` in `utils.ts` since it is now used in two places.
…cessary key deletes. - PR feedback #637 (comment)
…el-utils.ts - PR feedback #637 (comment)
- PR feedback #637 (comment) - PR feedback #637 (comment)
…trypointSubBundles
…ing change in an array of file contents, but order was not important. Fixed a test.
@justinfagnani PTAL; feedback addressed. Also, has been brought up to date with master. |
still LGTM |
src/babel-utils.ts
Outdated
* delegate only to Analyzer. | ||
* https://github.com/Polymer/polymer-bundler/issues/646 | ||
*/ | ||
export function parseModuleFile(url: string, code: string): babel.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.
Add issue to remove this parse and use Analyzer.
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.
Removed parseModuleFile and using Analyzer :)
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.
Which also meant I could remove babylon
and @types/babylon
src/babel-utils.ts
Outdated
* Within the `root` of the babel AST, find and returns a NodePath of the | ||
* given `node`. Returns `undefined` if node not found within `root`. | ||
*/ | ||
export function getNodePath(root: babel.Node, node: babel.Node): NodePath| |
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.
Let's check if this file is a good candidate to move into Analyzer
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.
Removed function completely - see next comment.
src/babel-utils.ts
Outdated
undefined { | ||
let nodepath; | ||
traverse(root, { | ||
noScope: true, |
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.
Can't we traverse up path.parentPath
? That would turn O(size_of_subtree) to O(length_of_path)
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 just pass in the NodePath now so I don't need to use getNodePath to find it. So fixed!
…t place I needed it.
🎉 Nice work @usergenic 👍 |
This PR adds ES6 Module Bundling to Bundler.