allowJs:true + declaration:true#21455
allowJs:true + declaration:true#21455nojvek wants to merge 6 commits intomicrosoft:masterfrom nojvek:emitJsDeclarations
Conversation
…modules to prevent version mismatch. furthermore lit-html and preact is imported from js, this will give an compile error see this microsoft/TypeScript#21455. but it compiles fine, and makes it possible to use the renderers without any module bundling from the users side
| // More comment`; | ||
| const configFileContentAfterComment = ` | ||
| "compilerOptions": { | ||
| "allowJs": true, |
There was a problem hiding this comment.
you could change this to set { "inlineSourceMap": true, "sourceMap": true } to make sure the errors are reported on those lines in the config file.
|
This looks awesome! Is there an ETA to release? |
|
Needs some work on emitting part for type interfaces described in jsdocs.
I’ve been using puppeteer project as a real world test case to solve.
Typescript doesn’t understand that module.exports should also export the
interfaces so need to solve that too.
I think a lot of these can be sped up if I could get a mentor from
Typescript team.
This isn’t as easy as I thought it would be.
Please help Typescript.
|
|
I did a quick test of this on a project I am developing for. It works great except that it automatically detects This is a weird quirk of the code I am dealing with but it would be nice to be able to disable module detection. Since in my case require is just another function. |
|
Yeah there are lots of little quirks like that to work out. But being able to auto-generate types for js projects is going to be amazing. |
|
@nojvek Once #21930 is merged, I'd like to write a transformer for JS files that simply iterates over their exported symbols, gets their declared types, and uses a modified |
|
ooo I like it. Do you have a guesstimate for the merge ? |
|
Typescript 2.9 has introduced some nice goodies. I am going to take another stab at this. Really liking what the improvements to jsdoc and codecompletion. Whoever did that. Thank you! |
|
What needs to be done to finish this effort? |
|
I basically just need to re-focus and get back into it. TSC has moved some pieces around so need to re-base and figure out the merge conflicts + tests. Hopefully we don't end up bikeshedding again. Been trying to land this since last year now 😞 |
|
You probably want to start fresh rather than attempt a rebase - the declaration emit pipeline has entirely changed since this PR was last updated. |
|
@nojvek thanks for the work so far! I'm going to close this since it's going to require a substantial rebasing anyway. Looking forward to the next iteration. |
--declarationwith--allowJs#7546masterbranchjake runtestslocally** TODO **
From previous PR: #15911