-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
TypeScript (Help Wanted) #8120
Comments
@yairtawil - given your work on DefinitelyTyped/DefinitelyTyped#22894, I'm curious what you would suggest in terms of automating TypeScript definition files ( |
As long as you can also insert your TypeScript type definitions into your own module you should not apply them to DefinitelyTyped (DT). In addition there is already a definition on DT. My recommendation is to insert a new definition based on the existing one with the help of the current definition author (@yairtawil). After that you can set the current type definition on DT as deprecated and maintain it in your module directly. I can also help you a litte bit, if you wish. |
Please help, @atd-schubert. Your feedback is much appreciated. |
Wouldn't it make sense to have more members defined in the TypeScript types? In the Definition Files at https://github.com/DefinitelyTyped/DefinitelyTyped/ all classes are modelled like this
Does it make sense to have the members like I just started with this TypeScript things, so sorry if I am wrong. |
Maybe another topic for our FOSSGIS Hacking-Event in Essen 😄 |
maybe it is time to switch to typescript 😄 |
@chrismayer of course you can just make an The biggest advantage on TypeScript you will have when you switch to TypeScript completely like @beginor asked in his comment. TypeScript will check your source-code against contradictions. As long as you just write a type definition file TypeScript is not able to proof your theoretical type definition against the actual. In my current job I convert a lot of libraries to TypeScript and always found wrong architectural implementations during the rewrite process! TypeScript can not find them by a simple type definition, you will find them after you fail in a specific enough situation. There is also a strong argument against TypeScript. JavaScript is undisputed the programming language with the biggest community. Switching to TypeScript minimize you potential community, especially for pull requests. On the other hand you will increase your code quality and stability that also has an influence on your projects community. Writing a type definition in parallel has also the problem that you have to keep your definition up-to-date! So maybe someone can make a pull request easier in JavaScript, but on every change someone else have to check if there is also a change in the type definition! You have to develop your library in two different languages and it is on your responsibility that your codes will not differ! So in the end the maintainers should ask themselves this question first: "Do you want to switch to TypeScript or do you want to maintain two languages in your project?" By the way with TypeScript it is quite easy to switch step by step, because you can enhance a single file and keep the others in JavaScript, but you have to do it structured. For example in OL I would start with the event emitter, because it doesn't have any dependence. After that you can rewrite the files with dependencies on the event-emitter and so on... |
I've already made such a JSDoc plugin to auto-generate https://github.com/jumpinjackie/jsdoc-typescript-plugin An example of I've been using it to generate typings for OpenLayers in my own projects for many releases now. Despite the name suggesting it's a general purpose plugin, sadly it is not. It's just handles the OpenLayers case, which it handles very well. |
Our current plan is this:
We're not going to block the 5.0 release on this, so I'll remove the milestone. |
Hi, i just want to push back to a tool used by google to move from closure to typescript:
I think this tool could have been more used for all the tasked we've done for es6 module migration, maybe it can still be usefull and maybe people that were using openlayers and closure in their project could find this usefull. |
For the converter, see https://github.com/angular/clutz#gents---closure-to-typescript-converter. |
No news about this?? |
The codebase is now annotated with JSDoc types that TypeScript understands. This work is complete, but there's one TypeScript issue that keeps us from running tsc type checks as part of our CI: microsoft/TypeScript#26883. |
Is there a workaround for us to use in the meantime for our types, other than rolling back to v4? That bug seems to be getting kicked along and doesn't show any signs of getting resolved soon. |
What's the status of getting TypeScript definitions for v5.x now that TS v3.4.3 is released? Not being able to use TS for OpenLayers v5.x is holding up deployment of a project. |
i have manually generated typescript declaration fo openlayers v5.3.2 using JSDoc. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm pretty sure this shouldn't be closed, right? |
A regression in TypeScript 3.6 is currently affecting us: microsoft/TypeScript#33575. |
Hey @hanreev, I just forked your repository and it looks really great. 🎉 As we'd like to include the creation of If you don't have the time and you don't mind I'm gonna try to do so. |
@KaiVolland with pleasure. that will be very helpful. |
As @bampakoa state here #8448 (comment) the next typescript version will probably allow the generation of declaration files from js doc directly: https://devblogs.microsoft.com/typescript/announcing-typescript-3-7-beta/ So we can easily create the |
I opened microsoft/vscode#82054 to describe the type of behavior I think it would be good to avoid. Having |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It's possible to add a tag (not sure which is more appropriate) so the stale bot doesn't mark this issue as stale anymore? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'd like to see if we can publish TypeScript definitions for the 5.0 release. My understanding is that these can be published as
@types/ol
or in theol
package itself. I assume we'll need more than a singleindex.d.ts
since we do not make everything exportable from a single module. I'm hoping we can automatically generate the TypeScript definitions from existing JSDoc annotations in the code. Perhaps this will be a migration path away from JSDoc annotations to authoring in TypeScript, but initially I think our goal should be to publish TypeScript definitions that are in sync with the code.I'll be doing some more reading, but if anybody has experience and knowledge that they can spread, please let us know.
The text was updated successfully, but these errors were encountered: