-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[IDEA] Add JSDoc to AST #8532
Comments
I think the right article to link to - is: https://www.puruvj.dev/blog/get-to-know-typescript--using-typescript-without-typescript It has been mentioned in: https://devclass.com/2023/05/11/typescript-is-not-worth-it-for-developing-libraries-says-svelte-author-as-team-switches-to-javascript-and-jsdoc/ I personally would love to get "autocomplete" and "type popups" if I hover a TW function in VSCode. IMO JSDOC is not too much different, to what we do have already. We will probably increase the source code size a bit, but I think the wins would be worth it. What we have atm is suboptimal. eg: Just yesterday I had to lookup the GitHub-saver code for a thread at Talk
That's nice, but how can we tell VSCode, where to find that info in If we could improve the inline documentation in a way, that VSCode Intellisense automatically recognises it, in the whole project, I would support the effort. VSCode does understand JSDoc -- and JSDoc understands commonjs - Because TW implements its own require function So IMO $tw.modules.execute(moduleName,moduleRoot) We would need to let JSDoc know, how to use this info. There is a second relation -- eg: JSDoc also has no idea about that relation, but it would need to know it to give proper info if you hover Just some thoughts. @Jermolene -- Did you ever have a closer look at JSDoc in relation with TW source code? |
Maybe sourcemap can handle this, no JSDoc/TS required. Or use https://github.com/tiddly-gittly/TW5-Typed/blob/master/src/modules/utils/index.d.ts https://github.com/tiddly-gittly/TW5-Typed/blob/master/src/core.d.ts#L164
And this will only require JSDoc, no sourcemap/TS reuqired. Currently I only care about AST node, they change frequent than other methods. Other methods in https://github.com/tiddly-gittly/TW5-Typed haven't break since they are added. I can add PR to add some type, but #8255 may cause conflict and rework. An example here #8533 |
My views are:
|
I'm with you. For those unaware of the negatives (sorry, there are many), and are unwilling to spend the hours necessary to do the full-on, deepdive analyses, grab a coffee (or six) and head here: https://medium.com/javascript-scene/the-typescript-tax-132ff4cb175b https://medium.com/javascript-scene/the-shocking-secret-about-static-types-514d39bf30a3 https://medium.com/javascript-scene/you-might-not-need-typescript-or-static-types-aa7cb670a77b |
Is your feature request related to a problem? Please describe.
To build WYSIWYG editor, I need to maintain https://github.com/tiddly-gittly/wikiast , but it's dev experience is so bad that I don't want to touch it for a while.
Describe the solution you'd like
At least move AST part of typing from https://github.com/tiddly-gittly/TW5-Typed to the tw core, using JSDoc like how svelte does ( https://news.ycombinator.com/item?id=35932617 )
Example:
https://github.com/sveltejs/svelte/blob/1681b218cf3b42757f7d0f0a7c0dc45a79fea6f0/packages/svelte/src/store/shared/index.js#L7-L10
Describe alternatives you've considered
Directly use .d.ts may be better, but inline typing will make sure people update it.
Currently AST type in TW5-Typed is broken, the wikiast's code is in a mess. My time on opensource is liminted, so I need auto type checker to help GPT4 to help me. (GPT works better with type check output)
Additional context
I've heard that tw core maintainers don't like TS even JSDoc, but the fact is plugin developer need it, I need it, so please consider providing a better experience here. (Obsidian provides TS SDK and plugin template even it is close-sourced. Many people misunderstood Obsidian is opensourced because of its opensource plugin community. Consider how it attract modern web developers to contribute so much plugins)
The text was updated successfully, but these errors were encountered: