6 Commits

Author SHA1 Message Date
parkerziegler
09cc396e4f Upgrade to inspectpack 4; add regression tests. 2018-11-24 15:49:51 -08:00
Ryan Roemer
8a32cd19ff
[Major] Integrate inspectpack3 - faster, better, and more colorful! (#249)
This is a major update to `webpack-dashboard` with breaking changes. And a lot of speed and coolness.

## Breaking changes

- Requires node6+.
- Use the webpack internal stats object instead of real bundles. This is faster and with less futzing / parsing on the dashboard's end. Should permanently fix the `no code sections` found errors.
- We've removed command flags / plugin options that no longer apply like `--root`, etc.

### Modules

- Removed `min` and `min+gz` estimated file sizes from modules outputs. This dramatically speeds up the dashboard and reduces CPU usage.

### Versions

- Version skews should be detected more accurately and much faster thanks to dramatically improved heuristics from `inspectpack`.

### Duplicates

- Duplicates now reports on duplicate files that are (1) completely identical, and (2) the same package name and file path but with different sources. The first are low hanging fruit for optimizations in your build -- you've literally got the same thing multiple times. The latter needs to be coalesced at the package dependency level -- something the versions output can help with.

## Issues

- Upgrade hooks to work in webpack1-4 with abstraction. Fixes #240

## Refactoring

- Switch from `chalk` to using Blessed's built-in tags for coloring. This is definitely the way to go as things like table spacing don't work with chalk strings and work like a charm with Blessed tags.
- Update dependencies and remove lots of unused things (like `lodash`, `chalk`, `bluebird` and a whole lot of `babel*` that apparently wasn't used anyways).
    - New `inspectpack` is way slimmer and faster, with no more binary dependencies!
- Switch to yarn-only workflow in dev.
- Bump Travis node versions.
2018-05-24 13:12:52 -07:00
Ryan Roemer
5135858040 Add more project root inference for versions (aka Unable to find project root package.json issue) (#194)
We have a bug opened in `inspectpack` repo that is really a `webpack-dashboard` issue. Fixes https://github.com/FormidableLabs/inspectpack/issues/45

The `inspectpack` `versions` action detects versions skews in installed packages within a webpack bundle by actually traversing the `node_modules` installed from the "project root" which is basically the directory that contains the operating `package.json`.

Some bespoke webpack configurations change `bundle.context` to something _other_ than a directory that is our "project root". This causes `inspectpack` to rightfully bomb out with a `Error: Unable to find project root package.json` error -- because if you're running `versions` you need to have this accessible.

In `webpack-dashboard`-land, it pays to be a little more permissive, because folks might not mind missing `versions` for getting all the _other_ cool dashboard stuff. So, accordingly, here's how the dashboard now deals with the problem:

1. If the `DashboardPlugin` specifies a `root` option to the root project directory, we use that. **Note**: We don't _check_ it's valid -- if it's invalid and manually specified you **will** get this same error.
2. If no `root` is specified, try to see if `bundle.context` has a `package.json`, use that.
3. If `bundle.context` isn't workable, try `process.cwd()`.
4. If `process.cwd()` isn't usable, then just _disable_ the `versions` action for the dashboard.
2017-09-21 10:43:01 -07:00
Tyler Thompson
9d4549230d Revert "Use prettier"
This reverts commit bf0f0f99834130b881fbc063da7e744148fc7780.
2017-09-10 20:58:26 -07:00
Tyler Thompson
bf0f0f9983 Use prettier 2017-09-10 20:56:21 -07:00
Tyler Thompson
b6903ea03a Move inspectpack daemon to the plugin and add problem pane support 2017-04-13 17:15:55 -07:00