SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.23k forks source link

Change to typescript? #2627

Closed deeprobin closed 5 years ago

deeprobin commented 5 years ago

I would suggest that the whole project be rewritten in TypeScript. Since TypeScript is currently one of the most common languages and will eventually be compiled to JavaScript anyway. With TypeScript, you have the advantage that you have type definitions and this is easier to integrate into other projects, but also that the IntelliSense works. TypeScript has a strong typing and thus errors occur less often, which are more likely to happen with dynamic typing. There is also the possibility to include generics and interfaces in TypeScript. Classes also exist there. And the TypeScript syntax is similar to that of ES6. The only difference is that TypeScript has strong typing. And I could imagine that you get more contributors if you use TypeScript instead of raw JavaScript because TypeScript is in hype.

petermuessig commented 5 years ago

Dear @DeepRobin ,

the hype of using TypeScript for web development is quite huge and even increasing. I fully understand the TypeScript support will be beneficial for developers. At the last UI5con, I briefly mentioned that there is TypeScript support for UI5 already: https://www.youtube.com/watch?v=lPETbnuL9hs (~52:15). The according GH repository is here: https://github.com/SAP/ui5-typescript. We are still in a setup phase here but we are preparing our UI5 codebase to provide all required information for the typescript definition files via JSDoc and this project is using this information to generate the typescript definition. The next step is to make this part of the UI5 NPM modules so that everyone can decide to use TypeScript for application development.

But for the UI5 framework development, we will stick to plain old JavaScript. This has several reasons for compatibility and also for the effort of moving this codebase to TypeScript. I know this sounds like an excuse but we have to be careful on the framework layer since there are so many users of UI5 which highly rely on stability. I know TypeScript is just an extension but we have to introduce a complete new process for the development, build and testing of the UI5 framework then. For applications and even for own libraries using TypeScript might be possible...

Unfortunately, I cannot just say: yes, let's go that way - but I hope you also get my points from UI5 framework development perspective. I can just invite you to play around with the offering we have right now or even help us to make the tooling better.

Thanks for raising this question, Peter