-
Notifications
You must be signed in to change notification settings - Fork 3k
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
types(config): add GlobalConfig interface #6247
types(config): add GlobalConfig interface #6247
Conversation
@niklas-wortmann it seems odd that we have to introduce a type we're going to publish to the masses just to get documentation here. Is there a better way to fix this? |
I think this is fine, but I don't see why it needs to be in |
@cartant I think so. When I was working on #6233, I couldn't make |
I'm more surprised that the type has to be exported, TBH. |
If I move |
My preference would be to try to figure out why the docs generation requires this, as, IIRC, it's legal to use parameters (for example) in an exported API that have a |
I could try playing with the docs builder to see why it fails to collect stuff that are not exported from However, there could be another solution to this, but it would take time to be handled and I'm not even sure it could be handled at all. I could try to create a new template just for this case where that new template would have a list of properties much like a template for interfaces has. Would that be a good idea? 🤔 BTW, this is how this looks like now (on master, without changes from this PR): |
I'll try.
Do you have an example of this? |
Pretty much all of the config types, IIRC: https://github.com/ReactiveX/rxjs/blob/7.0.0-rc.2/src/internal/operators/share.ts#L7 |
Yeah, that's why I think we should try to fix the docs generation. (FWIW, I thought TS had an issue with interfaces - rather than type aliases - being used without being exported, but I guess not.) |
I'll do my best, but I think we'll need help from @niklas-wortmann for this one. |
I'm inclined to change my mind. I think introducing and exporting the type is a small price to pay and we should make sure that all of the other types that are used for parameters, etc. are also exported, too. It's reasonable to say that if something warrants docs, it warrants an exported type, I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a nitpick.
I'll try to collect all other non-exported types and make a PR. |
There is also one more thing that can be fixed (that is already fixed in the Angular docs) that I'll try to work on: basically enable links on the types. In the next image from Angular docs: This is actually a link that opens a type, while in RxJS docs these are not links at all. That would be a handy addition to the docs. |
Thank you, @jakovljevic-mladen! |
Description:
The reason why I wanted to add an interface for
config
object is so that we can have a proper documentation page for it. Constant documentation pages don't have a list of properties like interface documentation pages do.Also, by introducing this interface, we will fix an error while building the docs (
npm run docs
) from this line:rxjs/src/internal/Observable.ts
Line 101 in 23bc7fd
because a link to
onUnhandledError
will now be available.I was thinking about naming this interface with just as
Config
, but I choseGlobalConfig
in the end. If needed, I can change toConfig
if it feels more appropriate.Related issue (if exists):
None