Skip to content

Split bundle parsing to new package - #143

Merged
valscion merged 9 commits into
version-3from
split-bundle-parser
Feb 4, 2018
Merged

valscion merged 9 commits into
version-3from
split-bundle-parser

Conversation

@valscion

@valscion valscion commented Jan 13, 2018 •

Copy link
Copy Markdown
Collaborator

Part of Version 3 upgrade #97, this PR aims to split the bundle parsing logic out of the plugin code to own package.

This new package could be useful outside of webpack-bundle-analyzer itself. Other tools who would like to access the parsed output would be able to do it and do whatever they want with the data.

TODO:

  • Split src/analyzer.js and related code to the new package

@valscion
valscion force-pushed the split-bundle-parser branch from c8f025d to 3e60ed1 Compare February 4, 2018 11:26
@valscion valscion closed this Feb 4, 2018
@valscion valscion reopened this Feb 4, 2018
@valscion

valscion commented Feb 4, 2018 •

Copy link
Copy Markdown
Collaborator Author

What's up with TravisCI not running tests for this branch?! 😩

EDIT: Oh, Travis only wanted to run tests when PR was to be ran against master branch, not version-3. Glad I got that figured out now :)

@valscion
valscion force-pushed the split-bundle-parser branch from f00cce6 to fdc0463 Compare February 4, 2018 11:37
@valscion
valscion force-pushed the split-bundle-parser branch from fdc0463 to cddc615 Compare February 4, 2018 11:45
The "toContainSubset" assertion is terrible when the error is in values
missing from the target object. I wasted so much time in deciphering a
build failure because of that...
@valscion
valscion force-pushed the split-bundle-parser branch from bda1bc4 to 3041c68 Compare February 4, 2018 12:30
I'm beginning to really despise these lines of code in
plugin/src/analyzer.js:

    try {
      bundleInfo = parseBundle(assetFile);
    } catch (err) {
      bundleInfo = null;
    }

The `catch (err)` really catches everything. Like this bug, for example.
I had to add a `console.error(err)` in the catch block to find out
`parseBundle` wasn't a function but that I had messed up the
`module.exports`.
Now all parsing related functions are in the same package
@valscion
valscion merged commit faf24a3 into version-3 Feb 4, 2018
@valscion
valscion deleted the split-bundle-parser branch February 4, 2018 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant