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

Improve stringified config output by --inspect #928

Merged
merged 1 commit into from Jun 5, 2018

Conversation

@edmorley
Copy link
Member

edmorley commented Jun 5, 2018

This takes advantage of the new webpack-chain toString() added in neutrinojs/webpack-chain#53.

The output from neutrino --inspect now lists the correct plugin declarations and arguments, annotates plugins/loaders with hints about how to reference them in a custom Neutrino config, and supports using __expression to override the stringified output when needed.

The usage of deep-sort-object has been removed since it breaks the new toString() comment annotations, and really if sorted output is considered important, it should be handled by webpack-chain itself.

Example output for Treeherder's WIP Neutrino 9 config:
https://emorley.pastebin.mozilla.org/9086982

After this merges, I was thinking we could backport this to Neutrino 8 under a separate flag (eg --inspect-v9) which would make it easier for people to diff Neutrino 8 and 9 configs.

Fixes #328.
Refs #96.

This take advantage of the new webpack-chain `toString()` added in
neutrinojs/webpack-chain#53.

The output from `neutrino --inspect` now lists the correct plugin
declarations and arguments, annotates plugins/loaders with hints
about how to reference them in a custom Neutrino config, and supports
using `__expression` to override the stringified output when needed.

The usage of `deep-sort-object` has been removed since it breaks the
new `toString()` comment annotations, and really if sorted output is
considered important, it should be handled by webpack-chain itself.

Fixes #328.
Refs #96.
@edmorley edmorley added this to the v9 milestone Jun 5, 2018
@edmorley edmorley self-assigned this Jun 5, 2018
@edmorley edmorley requested a review from eliperelman Jun 5, 2018
@eliperelman

This comment has been minimized.

Copy link
Member

eliperelman commented Jun 5, 2018

Note: I don't think we should port back to v8 since that means adding back deep-object-sort, since non-sorted objects is a breaking change.

@edmorley

This comment has been minimized.

Copy link
Member Author

edmorley commented Jun 5, 2018

under a separate flag (eg --inspect-v9)

@eliperelman

This comment has been minimized.

Copy link
Member

eliperelman commented Jun 5, 2018

Oops haha.

Copy link
Member

eliperelman left a comment

👏

@edmorley edmorley merged commit d7b0b13 into neutrinojs:master Jun 5, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@edmorley edmorley deleted the edmorley:improved-inspect branch Jun 5, 2018
edmorley added a commit to edmorley/neutrino that referenced this pull request Jun 6, 2018
This backports neutrinojs#928 to `release/v8` under a new argument name, to
prevent it from being a breaking change. This will allow Neutrino 8
users to benefit from the stringifed config improvements sooner, as
well as providing a way to compare v8 and v9 configurations.

I've not backported the eslint `formatter.__expression` change, since
it would require a fair amount of refactoring, increasing risk for
little benefit.

Fixes neutrinojs#328 for `release/v8`.
edmorley added a commit that referenced this pull request Jun 7, 2018
This backports #928 to `release/v8` under a new argument name, to
prevent it from being a breaking change. This will allow Neutrino 8
users to benefit from the stringifed config improvements sooner, as
well as providing a way to compare v8 and v9 configurations.

I've not backported the eslint `formatter.__expression` change, since
it would require a fair amount of refactoring, increasing risk for
little benefit.

Fixes #328 for `release/v8`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.