nytimes / kyt

Starting a new JS app? Build, test and run advanced apps with kyt 🔥
https://open.nytimes.com/introducing-kyt-our-web-app-configuration-toolkit-9ccddf6f6988
Other
1.92k stars 110 forks source link

Add option to bubble up Webpack output #349

Open tizmagik opened 7 years ago

tizmagik commented 7 years ago

Webpack 2.2 RC

Webpack 2.2 RC includes support for Performance Budgets (also, dynamic imports, etc). However, kyt currently silences webpack's output so users won't be able to take advantage of this feature.

Read more here: https://medium.com/webpack/webpack-performance-budgets-13d4880fbf6d#.da4lr9175

Bug or Feature?

Feature

Current Behavior

Webpack output is swallowed

Desired Behavior

Webpack output is (optionally?) visible

Potential Solutions

  1. Include an option in kyt.config.js to bubble up/opt for Webpack's output
  2. Remove kyt's current output handling and leave it up to Webpack

I'd suggest #2 because Webpack's output is much richer than what we currently show. We can still emojify the start/end to communicate clearly to the user what's going on task-wise, but otherwise muting webpack's output seems a disservice, especially given the new Performance Budget feature.

Thoughts?

nahue commented 7 years ago

+1 on optionally show webpack's output

nahue commented 7 years ago

any news on this?

tizmagik commented 7 years ago

I think the plan is to release kyt 0.4.0 and then look in to upgrading Webpack since there are some potentially breaking changes there.

delambo commented 7 years ago

We could probably reach into the webpack stats and surface the performance budget to users so that we can avoid all of the other noise that webpack logs. But I'm not sure if kyt is going to need this feature soon. After we land vendor bundling and work on a user manual that better explains the goals behind code splitting in React apps, and since most users probably create projects from our starter kyts, most kyt projects won't need the warnings that this tool provides. Osmani's original rationale behind this feature was to warn users that were likely building a single dist: "we noticed quite a few folks were shipping down monolithic JavaScript bundles." I don't think this will apply to most kyt projects, especially if we're doing a good job of guiding our users.

tizmagik commented 7 years ago

Just to follow up here: as discussed in person, it still makes sense to have the option of showing the webpack output (for things like this performance budget and otherwise) because it is still possible to ship down a large JS chunk even if you're code-splitting at the route level. In those cases, having the performance budget warning would indicate to users to code-split within a given route, etc.