build icon indicating copy to clipboard operation
build copied to clipboard

Add module size "lint"

Open kevmoo opened this issue 6 years ago • 8 comments

If a module is greater than some threshold size, give users a "hint" that they should consider breaking it up – ideally by pointing to documentation

kevmoo avatar Mar 06 '18 16:03 kevmoo

I like this one! I'd also love more docs on what a module is, how it effects compilation time, etc.

On Tue, Mar 6, 2018, 8:05 AM Kevin Moore [email protected] wrote:

If a module is greater than some threshold size, give users a "hint" that they should consider breaking it up – ideally by pointing to documentation

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dart-lang/build/issues/1102, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKQ7pTMvfP-WCpFJIR_hF9i2vlkFG36ks5tbrPWgaJpZM4Se-PM .

matanlurey avatar Mar 06 '18 16:03 matanlurey

Should we do this only for the root package or for other packages as well?

jakemac53 avatar Mar 06 '18 19:03 jakemac53

All the things!

Some ideas:

  • --[no]-module-checks: Enable/disable checking modules for potential problems.
  • --module-check-deps: If --module-checks is enabled, also check dependencies.

Ideally we wouldn't be checking dependencies by default, because (a) that seems wasteful and (b) often the user won't have the option to change it [at least not easily] anyway. I could see it being useful for diagnostics.

Other option is simply have a diagnostics/doctor-like mode instead, i.e.:

$ pub run build_runner build --diagnose-problems

... where it cleans, builds, and potentially even builds again to check caching?

matanlurey avatar Mar 06 '18 19:03 matanlurey

Other option is simply have a diagnostics/doctor-like mode instead

I do like the idea of a special command for this.

natebosch avatar Mar 06 '18 21:03 natebosch

Doctor mode is fine, too – instead of adding 3 more special-purpose flags. Sure...

On Tue, Mar 6, 2018 at 1:19 PM, Nate Bosch [email protected] wrote:

Other option is simply have a diagnostics/doctor-like mode instead

I do like the idea of a special command for this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dart-lang/build/issues/1102#issuecomment-370931878, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCitE3_WIJSMf-DkMLaNIBXlfPkoasks5tbv1SgaJpZM4Se-PM .

kevmoo avatar Mar 06 '18 21:03 kevmoo

Concrete issue we should try to prevent: https://github.com/dart-lang/webdev/issues/170

natebosch avatar Mar 14 '19 18:03 natebosch

I believe that the implementation of this warning could help solve this issue too: https://github.com/dart-lang/webdev/issues/436, considering this discussion: https://github.com/dart-lang/webdev/issues/170

supermuka avatar Jul 22 '19 12:07 supermuka

@supermuka - the CPU issue appears related to file watching which is orthogonal to module sizes.

natebosch avatar Jul 22 '19 17:07 natebosch