Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Improve stringified config output by --inspect #928

Merged
merged 1 commit into from
Jun 5, 2018
Merged

Improve stringified config output by --inspect #928

merged 1 commit into from
Jun 5, 2018

Conversation

edmorley
Copy link
Member

@edmorley 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 June 5, 2018 00:16
@eliperelman
Copy link
Member

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

edmorley commented Jun 5, 2018

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

@eliperelman
Copy link
Member

Oops haha.

Copy link
Member

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@edmorley edmorley merged commit d7b0b13 into neutrinojs:master Jun 5, 2018
@edmorley edmorley deleted the improved-inspect branch June 5, 2018 20:24
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants