Open montogeek opened 4 years ago
If this doesnt get traction, i suggest adding a small outline to the types in the docs somewhere or as i suggested earlier, a tooltip when hover types
@EugeneHlushko Typescript notations are less confusing and should be used in my opinion.
Another alternative is to use TypeScript documentation from webpack source code directly (it would be a fun AST ride, maybe).
Major part of the code in the webpack source code in written in javascript with commented types, thus extracting the types from there wouldn't be a nice idea.
I agree with @rishabh3112 here. We can see the two version here https://github.com/webpack/webpack.js.org/pull/3706#issuecomment-619119074, the TypeScript one is much better. Also, when user reading docs, they won't read the writers guide first to figure out the difference. So it would be better to choose the popular notations.
We might use details
/summary
here:
type Entry = | string | [string] | { key: | string | [string] | { import: string | [string] dependOn: string | [string] filename: string } } | (() => | string | [string] | { key: | string | [string] | { import: string | [string] dependOn: string | [string] filename: string } })
Some time ago a writes guide was created that specifies how to add types notations to our documentation, but later some users found it confusing, an alternative is to use TypeScript notation which has better standardization process and it is more known by the community.
Another alternative is to use TypeScript documentation from webpack source code directly (it would be a fun AST ride, maybe).