-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[WIP]: Improve jsdoc tags for tsd-jsdoc integration #6899
Conversation
Thanks for the pull request @bampakoa!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Looks good so far @bampakoa! Just ping me when this is ready for another look |
Reverted changes to
|
|
I think it is ok to define it as |
@bampakoa yeah that sounds fine. We don't do |
@hpinkos noticed that in some cases an object has functions defined in its namespace such as |
@bampakoa these are all helper functions related to those enums. It's just taking advantage of how flexible javascript is for the convenience of keeping related things grouped together. |
Sure, but why methods are not part of the enum in the |
There's no difference between var enum = {
value: 0,
myFunction: function() { }
}; and var enum = { value: 0 };
enum.myFunction = function() {}; The result object is the same. Does it make a difference from a documentation standpoint? |
Hard to say yet because tsd-jsdoc does not support enums yet. Let me check and I will get back to this. Nevertheless, I was just wondering why you wrote it in a different way than the others 😃 . The first approach is more performant in some engines such as V8. |
@hpinkos I checked with With that being said, methods that return or have a parameter of such an enumeration should reference the value of the enumeration and not the enumerated object itself. For example, the following:
should be:
What's your opinion on that? I did not push any commit because there are a lot of such occurences and would like to be sure about that first 😉 |
I'm honestly not too sure about that one. Does anyone else have an opinion on that? @mramato? |
My initial reaction is that |
@mramato they have indeed support for |
I'm not super familiar with TypeScript, but if we were writing typescript manually wouldn't we document it as returning the enum rather than a number? That's how other doc systems, like C#, work. |
@mramato @hpinkos thanks very much for your comments. After searching about the issue, I made some second thoughts. I think that we do not need to document it as
That way, it is handled properly from functions that use this type:
|
@bampakoa yes, I think that's a good solution. Can you push that up? I want to make sure our reference documentation still generates something reasonable with that change. (if you didn't know already, you can run |
@hpinkos sure. Do you want me to push only for |
Yes, that works. If you've already changed it everywhere feel free to push that up, but just |
Nope I have not, because I wanted to check first with you about any problems. Let me push |
@hpinkos the commit for |
It looks like |
I think you need the |
@hpinkos yeah, I had removed it for testing purposes and never restored it. Sorry about that. I have pushed the change in the PR. Can you please confirm? |
@hpinkos just to ping you in case you have missed my previous comment. I would appreciate your feedback on the missing |
Thanks for following up! I did miss that comment from a few weeks ago. I pulled down your branch and ran |
Can you describe how can I check ref doc listing by myself so that I can perform some tests without bothering you? |
Yes, from the cesium root directory:
|
@hpinkos It is now in |
Hey, any update on this? |
I'm honestly not sure. @mramato do you have an opinion on #6899 (comment)? |
@bampakoa sounds good to me! We'll absolutely take incremental improvements. |
@hpinkos I have pushed changes regarding Core, DataSources and Renderer folders. There are some differences though after running the documentation locally, particularly in the Renderer domain: All following now appear in the Documentation which seems reasonable to me since they are not documented as
|
Thanks @bampakoa! I'll take a look at these changes soon |
Thanks again for your contribution @bampakoa! No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy? I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@bampakoa sorry for the long wait on this. I think after those two comments are addressed this will be ready to go |
here it is @hpinkos . Sorry about the missing things. Can you please check and if everything is fine, I could go on with the rest of the PR (have a look in the checklist) |
Thanks @bampakoa! I just pushed up a few changes |
@hpinkos shall I continue with a separate PR for the remaining items since you have merged and closed this one already? Also, is it better for you to have one PR per folder for Scene, Widgets and Workers? |
@bampakoa separate smaller PRs are easier to get merged. I think it'd be fine if you did one for scene and one for widgets/workers though |
This PR is a continuation of #6767 . It contains improvements on the
jsdoc
block tags so that the output fromtsd-jsdoc
will be more accurate. Please note that the PR refers to the Source directory only.As this PR is going to be a long one, I would really appreciate if anyone from the Cesium team can review along the way.