-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[Feature]: Abstract progressplugin to webpack contrib #9252
Comments
CC @webpack/contributor-team for insight |
Relevant: webpack/webpack-cli#717 |
Don't think it is should be in Why don't use this?
|
@evenstensberg hmm, i agree with the decoupling of progress plugin. but, i personally view the ora usage a little undesirable from a dependency standpoint |
We can do that. Does it make sense to move it as a seperate plugin in /webpack ? |
@evenstensberg I’m still getting email notifications for webpack issues.
Can you please check and remove me from those teams? Thanks! |
Will be great to look on PoC, it is hard to say how to solve problem(s) better without examples. We already have option to change behavior as i written above. Why it is not solve problem? |
I think it's difficult to move the ProgressPlugin into a separate repo. It's very coupled to webpack internals so keeping it up-to-date as separate repo would be a hard job. You can still build a ora progress plugin on top of this like @evilebottnawi mentioned: #9252 (comment) So I don't see strong arguments for separating it. |
Gotcha |
I think what's more important is to make the handler payload better. There's different types of progress that we can track and we should have separate object signatures for each, rather than just sending a bunch of pre-prepared strings down to it. Currently in order to make a good handler you need to parse this information our with something like RegExps, which is really bad for performance and generally a poor experience. E.g. in my implementation of a progress bar using the ProgressPlugin I have to resort to regexps/splits to re-parse the data out of the strings in order to be able to position these parts properly. The result is something like this: I would imagine handler being most flexible e.g. when called like this: handler({compilerIndex, currentStage, doneModules, activeModules, lastModulesCount, moduleCount, count, mode}) And some of those parameters would obviously be The default handler would simply makes these strings as they are now, so there wouldn't be a "breaking change" in the way we display it - we get the same behavior, and still give greater flexibility for alternative handlers. It could also be a disjoint union of various statuses with their own meta, ideally typed with JSDoc. |
@niieani do you have idea how we can change plugin for better integration as you written above? Maybe you can send PoC? |
Reopening for design discussion |
I don't really have time for a POC these days, but here's the part I'm talking about: Lines 149 to 170 in bba93d2
You can see here we're pre-preparing some ways to display this data, e.g.: items.push(`${doneEntries}/${entriesCount} entries`) and then feeding all that to the handler in "random" order: handler(...items) I say random, because it's not predictable - depending on the settings and stage of compilation you'll get different strings ( My suggestion is to simply provide the raw metadata, like: handler({compilerIndex, currentStage, doneModules, activeModules, lastModulesCount, moduleCount, count, mode}) and then leave it up to the |
/cc @sokra what do you think? |
@niieani Makes sense to make it more customizable. Maybe it makes even sense to split the jobs into handler(...formater({compilerIndex, currentStage, doneModules, activeModules, lastModulesCount, moduleCount, count, mode})) This could keep compatiblity with existing handlers, makes it easy for the simple case, but allows customizablility for the advanced case. It would also allows to only change the format while keeping the default |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
bump, still feel free to sens a PR with PoC |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Feature request
https://github.com/webpack/webpack/blob/master/lib/ProgressPlugin.js
It would be nice to abstract the progressplugin to webpack contrib if we can do that to avoid code that some users don't need as apart of webpack. Furthermore I think we should allow the progressplugin to have more flavors instead of one bar that is outputting in a single fashion.
I suggest that we can make use of Ora as well as look out for other spinners that might make the CLI visually better and improve the user experience for webpack. I'm up for doing this task if allowed.
Even
What is the expected behavior?
ProgressPlugin with various of flavors
What is motivation or use case for adding/changing the behavior?
Better Interface
How should this be implemented in your opinion?
Abstracted Progress Plugin to another repository with more options
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: