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

API - Document MultiStats #480

Closed
donaldpipowitch opened this issue Dec 8, 2016 · 9 comments
Closed

API - Document MultiStats #480

donaldpipowitch opened this issue Dec 8, 2016 · 9 comments

Comments

@donaldpipowitch
Copy link
Contributor

"By accident" I found out about MultiStats today. Looks like neither the old nor the new docs mention MultiStats.

This actually broke my code when I switched from a normal compiler config to the multi compiler config, because I tried to access stats.compilation which is undefined on MultiStats (but not a normal Stats).

@skipjack
Copy link
Collaborator

@webpack/documentation-team any idea what's involved to get this documented? It seems the stats configuration page may need to updated and something would have to be added in the API docs? This is a part of webpack I'm not too familiar with but I'd be happy to help push this forward however I can.

@donaldpipowitch where do you think would be an appropriate place (or places) to add this documentation? Is there anywhere specific you were looking when you were trying to debug that issue?

@skipjack
Copy link
Collaborator

There's also this small section on the MultiCompiler.

@skipjack skipjack changed the title MultiStats missing in docs API - Document MultiStats Jun 14, 2017
@kevinbuhmann
Copy link

kevinbuhmann commented Jun 25, 2017

The @types/webpack type definitions also need updating.

@sokra
Copy link
Member

sokra commented Jul 1, 2017

The Stats object interface has only these methods:

toJson(opt)
toString(opt)
hasErrors()
hasWarnings()

The compilation property is private.

webpack either returns a Stats or a MultiStats which both fulfill this interface.

@skipjack
Copy link
Collaborator

skipjack commented Jul 1, 2017

Ok and those methods are all documented here. I'll just add a note about the MultiStats which I guess is returned when using the MultiCompiler. @donaldpipowitch so it seems the answer to your issue is really just that compilation is not meant to be accessed.

@donaldpipowitch
Copy link
Contributor Author

Good to know, thank you all.

@kevinbuhmann
Copy link

kevinbuhmann commented Jul 3, 2017

Is the stats array on MultiStats supposed to be private also? https://github.com/webpack/webpack/blob/master/lib/MultiStats.js#L13

@skipjack
Copy link
Collaborator

skipjack commented Jul 3, 2017

@kevinphelps good question, @sokra? It seems maybe the private methods should be prefixed by an _ to prevent confusion?

@donaldpipowitch
Copy link
Contributor Author

A _ prefix would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants