41 Commits

Author SHA1 Message Date
Ryan Roemer
48025857ba
Bug: TS fixes (#341)
- Move types to `pluing/types.d.ts`
- Update plugin signature to webpack 5 inclusive format
- Add webpack type check to `check-ts`
- Add `yarn dev-ts` TS-based configuration example to our examples...
2022-01-21 10:54:32 -08:00
Ryan Roemer
0a11e7e6ae
Chore: Various plugin refactoring and simplification. (#332)
Refactors the plugin internal logic to be a lot simpler. 

- Chore: Refactor internal stats consumption to perform `inspectpack` analysis in the main thread, without using `main` streams. Originally, the `inspectpack` engine did some really heavy CPU stuff (gzipping lots of files), but now the actions are super fast, so I've removed `most` async observables and just switched to straight promises.
- Chore: Refactor internal handler in plugin to always be a wrapped function so that we can't accidentally have asynchronous code call the handler function after it is removed / nulled.
- Bugfix: Add message counting delayed cleanup in plugin to allow messages to drain in Dashboard. The issue seems to be that we hit socket IO disconnect in the plugin before the dashboard actually processes the messages. Fixes #294.
2021-07-12 12:27:50 -07:00
Ryan Roemer
de3eb44bbb
Bugfix: Ensure status is updated correctly on compilation finishing. (#322)
- Ensure a finished compilation state (failed, error, success) isn't overwritten by the ProgressPlugin. Fixes #321 
- Add error status inferred from webpack stats.
2021-01-29 10:39:06 -08:00
Ryan Roemer
b74c883042
Chore: webpack5 support. (#319)
- Add webpack5 support. Fixes #316 
- Bugfix: Webpack 5 warning message conflict. Fixes #314
- Fix bugs in updated `commander` integration.
2021-01-21 11:17:42 -08:00
Ryan Roemer
bda14ee35c
Chore: Update prod dependencies. (#318)
Update all production dependencies.
2021-01-20 15:23:11 -08:00
Ryan Roemer
95e5ca1cd0
Feature: Include only specified assets in plugin and/or CLI. (#291)
- Add `DashboardPlugin({ includeAssets: [ "stringPrefix", /regexObj/ ] })` Webpack plugin filtering option.
- Add `webpack-dashboard --include-assets stringPrefix1 -a stringPrefix2` CLI filtering option.
- Change `"mode"` SocketIO event to `"options"` as it now passes both `minimal` and `includeAssets` from CLI to the Webpack plugin.
- Fix unit tests that incorrectly relied on `.complete()` for `most` observables.
- Add additional `examples` fixture of `hello` for development (useful for this scenario to have 2).
- Updates a really old README PNG of the dashboard CLI!
- Replaces @wapgear 's great initial foray into an `--ignore-assets` flag. Closes #289
2019-08-27 14:50:17 -07:00
Ryan Roemer
f90e6ab345
BUG: Handle large webpack stats bundles without socket.io client disconnect. (#281)
- Limits the webpack stats messaged object to just errors and warnings. Fixes #279 
- Add client disconnect / error messages to help analogous issues in the future.
2019-04-17 15:55:20 -07:00
parkerziegler
5f6e2e4d2c Migrate to using neo-blessed as underlying blessed renderer. 2019-02-12 16:51:57 -08:00
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
7f99b31c5f
Feature: Enable opt-out of minified, gzip calculations. (#230)
Adds `minified` and `gzip` configuration options that can optionally disable the relatively expensive per-module calculations of each by `inspectpack` under the hood.

- Fixes #227
- Adds `minified` and `gzip` plugin options, both defaulted to `true` so we don't need a semver major bump.
- Adds more README documentation and explanations about CPU intensive workloads and the `inspectpack` cache.
2018-01-23 08:37:59 -08:00
Tim Schaub
839fbdee4b Wait until apply to create inspectpack daemon (#215)
This makes it so the dashboard plugin can be configured without creating the inspectpack daemon.  If the daemon is created in the constructor, the plugin cannot be conditionally applied.  Currently, if the plugin is configured and added as part of a development only config, the process running the production config will never exit.  With the changes here, the plugin can be configured but if it is never applied, the webpack process exits properly.

Fixes #96.
Fixes #125.
2017-11-07 10:43:23 -08:00
Gabriel Reitz Giannattasio
2f24fe9d89 Feature - Add plugin host option (#188)
* Add support to change the host in the plugin options

* Add the host option to the documentation and clarify in the docs what act as server and what act as client

* Fix the double quote lint error
2017-10-13 08:19:34 -05:00
Carlos Paelinck
9bfeab33c0 Use getOr and fix minor error in readme 2017-10-09 15:23:20 -05:00
Carlos Paelinck
b8f0a49f17 Added docs and simplifed prod warning messaging. 2017-10-09 14:26:38 -05:00
Carlos Paelinck
f5645a86f3 Fixed spacing. 2017-10-09 13:33:39 -05:00
Carlos Paelinck
a73fa958df Added support for node env provide plugin. 2017-10-09 13:27:50 -05:00
Carlos Paelinck
e5bc557af4 Fix WP 3 size reporting, disable inspectpack in minimal 2017-10-04 13:08:12 -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
8fe3836759 Add travis 2017-09-11 21:27:40 -07:00
Tyler Thompson
03e0a4164b Upgrade inspectpack 2017-09-10 16:21:37 -07:00
Ken Wheeler
c6fe421585 moving daemon to constructor 2017-08-21 14:37:28 -04:00
Tyler Thompson
dd06bcd783 Stream actions with completion to the socket 2017-08-19 13:38:02 -07:00
Ken Wheeler
f74dbe9080 Electron fix (#178)
* making prettier

* fixing electron
2017-08-18 12:58:12 -04:00
Kevin Kerr
021f56469b close socket if not watching (#172) 2017-07-06 10:59:20 -04:00
Tyler Thompson
b067205e95 Fix busted error messages; fix percentages 2017-04-19 21:52:53 -07:00
Tyler Thompson
20b5fc15cd Don't parse sourcemaps! 2017-04-17 13:32:04 -07:00
Tyler Thompson
b6903ea03a Move inspectpack daemon to the plugin and add problem pane support 2017-04-13 17:15:55 -07:00
Tyler Thompson
dd3fa3ebf4 Use new built-in inspectpack daemon; restore version numbers; add colors and error state 2017-04-06 15:19:51 -07:00
Tyler Thompson
333c99db9d Initial pass at min+gz sizes using inspectpack 2017-03-31 15:30:41 -07:00
Tyler Thompson
c748af7747 Fix remaining lint issues and convert to node 4 ES6 2017-03-31 10:12:04 -07:00
Simon Flack
ef6cb31a42 Respect stats options from webpack config in log output (#155)
Inspired by solutions to #149 provided by @nlutterman
2017-03-24 13:29:42 -04:00
Yacine Hmito
14094fe55f Get log directly from Webpack (#143)
The plugin sends log message through the socket
If the dashboard is used as it is now, this is simply ignored
It is however printed if the user doesn't provide a command
2017-01-27 10:38:46 -05:00
Simen Bekkhus
d9d80fc304 Show millis under Operation (#140) 2017-01-02 10:03:17 -05:00
Semyon Radionov
7466622259 Add time information to Operation block (#74) 2016-08-25 20:53:03 -04:00
Dylan Markow
35e9f463a7 Switch from json-socket to socket.io
`json-socket` has issues with multibyte characters in large messages.
`socket.io` appears to be much more actively maintained and properly
supports the messages `json-socket` was having problems with.
2016-08-19 10:23:26 -05:00
Ken Wheeler
d306062cec Fixing windows & babel-node (#63)
* - Fixes windows by using cross-spawn, closes #57, #62
- Fixes babel node issue where child processes aren't killed, closes #61

* Cleaning up quotes and passing colors through

* Fixing log color output
2016-08-19 08:44:02 -04:00
Ken Wheeler
7b6e9a1904 New approach (#50)
* Separate processes

* Socket comm

* Fixing some things, adding minimal mode
2016-08-17 21:15:05 -04:00
Ken Wheeler
ed6625d018 console redirection 2016-08-15 16:52:48 -04:00
C. T. Lin
be271364c1 fix 2 spaces indent 2016-08-15 10:55:07 +08:00
Ken Wheeler
75ddff3120 Initial commit 2016-08-14 14:41:04 -04:00