-
Notifications
You must be signed in to change notification settings - Fork 134
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
Current state of the project? #26
Comments
(We'll try to give more frequent updates going forward. Something was broken with my GitHub notifications, so I just noticed your question today.) Status: I'm currently working on the initial architecture and prototype for the parser library. Once we have a working prototype, it will be in a good state to accept pull requests / feedback from the community. Until then it's a little hard to collaborate unless someone is in the Seattle area and wants to meet up. I was making pretty good progress until I ran into some questions about how to model the AST, specifically handling of mutiline tokens whose "lines" are embedded inside a doc comment, for example: /**
* `abc
* def`
*/ (Is We met with the TypeScript compiler owners, and they gave a bunch of really helpful feedback. They also suggested that we build the tsdoc NPM package as an extension of the compiler's AST, rather than having it act as a standalone parser. It would still be its own library, but the input would be a TypeScript compiler data structure instead of a plain text string (as in the current approach). Integrating with the compiler has some benefits:
But there are also drawbacks:
It's a tough call. My coding progress stalled while I researched this decision, and then recently I got sidetracked by some other priorities. TSDoc is now my primary focus again for the rest of June, but then in July I will be away on vacation for a few weeks... so the short answer is that it's moving along, but probably won't take off until later this summer. I will say that we now feel reasonably confident about the initial language spec for TSDoc, and also the overall parsing strategy.
The easiest way to contribute right now is to open/answer GitHub issues that help us flesh out the requirements and syntax for the TSDoc notation. There are still plenty of interesting edge cases and cool feature ideas. If you maintain a documentation tool, you can also compare/contrast your syntax and features against what we're proposing for TSDoc and identify any gaps. |
Hi folks.. I'm just going jump in here as I've been following Anyway So what I see as most beneficial and generalized is |
Thank you for this feedback! I find it highly persuasive. We were unsure whether anyone would want to use the tsdoc library without first invoking the TypeScript compiler engine. Certainly you shouldn't be forced to write your own parser just because your tool isn't based on the TypeScript engine. BTW if you plan to be contributing, feel free to create an PR to add your project to the "Who's involved?" list. |
Another way to look at this is, the best projects I've participated in often took the form of a 2.0 reboot of a working 1.0 implementation. Only with the hindsight of having actually coded everything, do we learn how to code everything well. So if standalone-tsdoc requires us to later redo the entire parser inside the compiler's code base, perhaps that's a benefit and not a wasted duplication. :-) |
@pgonzal I'll definitely do a PR when I get back into full swing of things which should be in August. TJSDoc is event based on inter-module communication. Based on the file type comment nodes would be dispatched to I bit my tongue w/ other discussion regarding potential markdown dependencies for Nonetheless a well defined Typescript comment format and module to generate an accompanying AST for consumption by documentation tooling is highly needed. This is one of the sore spots in ESDoc and certainly latent sore spot in TJSDoc (and I assume a lot of other documentation tooling!) as currently implementation is just a bunch of adhoc regex processing instead of separate modules that provide a well defined AST for processing comments. As much as it is painful to accept regex processing as the way forward it is a generalized approach. It's certainly hard to get right, but worth the effort as if there is a standard module implementing things for Typescript comments and a separate module for JSDoc that generates a compatible AST for documentation tools to consume then all tooling can offload this aspect to common efforts, etc. |
So far we've come to the same opinion, see #12 (comment) . Thanks again for sharing your use case, very informative! |
@pgonzal It has definitely been a pleasure following the progression thus far with the sussing out of potential features. I'd say in an ideal world the result of I must say that for expediency in the case of creating a JSDoc module I'd likely fork |
Status update: Today we published the first release of the @microsoft/tsdoc NPM package! . This is “alpha quality” and still pretty rough around the edges, but the major approach and model are worked out. The project is now (finally!) in a state where people can give useful feedback on the implementation and API design. I’ve put together a small demo project that illustrates the basic usage. If you get a chance, please try it out and open GitHub issues with your feedback/ideas. In the coming weeks we’ll be working on updating API Extractor to use this library for parsing doc comments, and fixing lots of bugs and feature gaps along the way. Thanks again to everyone who’s been contributing ideas and input! |
And here's a quick summary of the major ideas:
If you want to see some examples of all these pieces together, the Jest snapshots are somewhat informative:
|
@pgonzal How is memory efficiency and speed looking? Those are my two big concerns with a more "heavyweight" / precise solution like I've done a ton of optimization on both fronts over ESDoc for my forthcoming documentation effort, but it can still be a beast on very large projects. Perhaps tests can be added to stress |
Hey @typhonrt Performance is certainly an important goal for this project, however we have not yet invested in measurements or optimization work in that area. The first priority is still to get the main usage scenarios to be feature complete and running. (If someone else wanted to set up some performance tests, that would be very appreciated!) That said, the current architecture is designed with performance in mind. Like the TypeScript compiler, the core parser works primarily with integers (i.e. indexes into an array of tokens, or indexes into an array of characters) instead of allocating and comparing text strings. Here I am referring to the The parser's algorithm time complexity should be analogous to a CommonMark parser: It sometimes performs infinite lookahead, e.g. parsing " The last aspect that comes to mind from a performance standpoint is circular references in the Hope that helps! |
I have added a Where are we on the roadmap? section to the root-level README file, which people can use to track our progress until we get a proper newsfeed set up. Here's what I posted there as of today:
As such, I'm going to close this GitHub issue. BTW I'm also excited to announce that we made a cool little TSDoc Playground with an interactive demo of the parser. (Big thanks to @iclanton and @KevinTCoughlin for their work on this!) Enjoy! :-P |
Hello everyone!
Super excited about this project. I'd love to get involved in any way I can.
I tried to install & run
tsdoc
locally, and ran into issues. So, I wanted to know - is there a roadmap available with planned features / support + implemented features / support? I'm asking both so I can debug the issue I ran into, and so I can reference it when looking for ways to contribute =)Thanks for the hard work everyone!
The text was updated successfully, but these errors were encountered: