Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split bundle parsing to new package #143

Merged
merged 9 commits into from
Feb 4, 2018
Merged

Conversation

valscion
Copy link
Member

@valscion valscion commented Jan 13, 2018

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
Copy link
Member Author

valscion commented Feb 4, 2018

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 :)

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...
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