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
JsDoc improvements #854
Comments
Also, move the namespace/package list to the top. |
@andyberry88 I don't know if I understood your correctly, so correct me if this is wrong. If you link to a CommonJS module, you do it like so: If that is true, then I think we need a workaround that will allow us to do that. Otherwise people will have to constantly update their JsDoc when the thing they are linking to changes from namespaced-js to commonJS (and it is going to be hard to catch when that happens). |
This has been done and should be in the v0.11 release (dd2b9f5). In order to make sure the change is in the template rather than core JSDoc we now remove any instance of
Done. Just a template change. (11af58b)
Correct. I don't think there is any workaround for this and I don't think we should attempt to create one by hacking the JsDoc core. This is simply a side effect of using both commonJS and namespacedJS style code. Ultimately JSDoc needs to be able to identify any symbol, and the |
As per my original comment, I don't think this is acceptable. We had a conversation with @james-shaw-turner and he agreed. |
I think we need to get on a call at some point to discuss this then. IMO, from a BRJS point of view, we shouldn't be changing the core behaviour of tools we rely on. If this is a CT requirement then it can be done as a CT change rather than in the core of BRJS. |
This is a user issue. A developer using BRJS or CT that links to documentation in the SDK shouldn't have to care what type it is. And like I said, it will randomly break when libs are updated to CommonJS. |
Following the upgrade to jsdoc:
command is taking a very long time. 15 minutes for large apps that previously took around 1 minute. When testing on a small app in brjs it was difficult to see the issue since it was taking around 20 secs for smaller apps. But when running with bigger apps and more libraries we saw that it was taking a LOT longer. needs further investigation to see what about the jsdoc toolkit is taking so much longer |
Also, when it fails to produce a jsdoc for a class it doesn't fail gracefully - it just hangs on the command line:
|
I agree with @andyberry88 that the kind of changes @janhancic is suggesting (referring to classes and modules using the same syntax) are not changes we should be making, but should be raised directly against the upstream project. That being said, I think what @janhancic is saying makes sense since as it happens both CommonJs and NamespacedJs classes are served to the browser as CommonJs modules, and are both modelled internally as modules (they are both instances of |
Checklist of improvements (in no particular order)
|
Some more notes on this one: Found that one class that was taking more than most was ComponentFixture.js - could look into what in terms of jsdoc it has moreso than other classes - at first glance it looks to have a lot of '@see's. Also, worth noting that the command requires a working set of well over a gigabyte in memory |
In brjs API docs as well as CT, for modules, the constructor name is shown as a brackets-enclosed require statement. The first thing the user sees when looking at modules looks like garbage at first glance. Here is an example: http://apidocs.bladerunnerjs.org/v0.11/js/KnockoutComponent.html I propose that this should read |
Also for modules JSDoc, there is a redundant link to source code underneath the constructor. Again as an example: http://apidocs.bladerunnerjs.org/v0.11/js/KnockoutComponent.html. There are 2 links next to each other, one to line 3, another to line 25. |
|
Hi, I'm the maintainer of JSDoc, and I just stumbled across this issue. I've made some changes to JSDoc over the past couple of weeks that should drastically improve performance for large docsets. I haven't investigated memory usage, though. Please try the current version of JSDoc on master and let me know if you're still seeing performance and/or memory issues. (If you can run JSDoc on Node.js, rather than Mozilla Rhino, that will also give you much better performance.) Also, the I'll work with @dchambers on the issues he filed. I'm about to go out of town, though, so it will be a couple of weeks before I can respond in detail. |
Thanks @hegemonic, your assistance is very much appreciated. |
👍 |
IMO, the various issues raised here in this meta issue have either been fixed by #926, or mitigated against. Things that have been fixed:
This leaves the following:
|
verified all the points Dom's mentioned above, all classes are now displayed as module:my/Module. No performance improvements noticed while running jsdoc against live-examples compared to the previous version. |
Using v0.11.324-ge900841 classes appear twice, both in the classes and modules lists. All classes are modules, so it doesn't make sense to list classes under modules. constructor name is not valid JavaScript, e.g.
h1 at top of page for classes looks weird, e.g.
|
Here's a illustration of the issue seen by @jeremyherr (moving a couple of issues back to test to discuss during today's standup) |
This is an issue that is likely to be fixed in coming releases of jsdoc. We spoke about this at the standup today and the general consensus was that we wait for it to be fixed upstream rather than hacking it in to BRJS. Moving this back in to the backlog until its 100% fixed. |
@jeremyherr: Sorry, only just seen your comment, but to address your points:
While it's true that both BladeRunnerJS and CaplinTrader adhere to the one class per module rule, it's also possible to have modules that export multiple classes. Also, the maintainer of jsdoc feels this is how it should work since modules that contain classes are both modules and classes, and so this is deliberate.
I agree, but suggest it would be better to raise this as single issue item against the upstream project.
I actually think this is broadly a good thing. The logical name of the entity being documented is In the old documentation we used to have different icons for classes, interfaces, singletons, etc, but since jsdoc does't have icons, having some text to tell us what we're looking at is the next best thing IMO. Again, if you disagree I'd recommend creating an issue with the upstream project. |
@andyberry88, I'd suggest we close this issue as we've now integrated with jsdoc, ironed out any upgrade issues, and contributed a number of improvements as pull-requests. IMO, any further improvements to jsdoc3 should be issued against that project as a number of single-use issues so they can be more easily managed. |
@dchambers Agreed. I'll move it to 'ReadyForTest' so @thecapdan has a chance to comment first. |
Since we've found a workaround, we can move to done - but keep an eye on jsdoc upgrades that might improve performance |
When creating a link to a module:
{@link module:my/Module}
, the default text of the link should bemy/Module
, notmodule:my/Module
.Same for return types and argument types.
The text was updated successfully, but these errors were encountered: