ui5-typescript
ui5-typescript copied to clipboard
Any best practice about migration from existing UI5 project into TS UI 5 ?
As the title is, and this is not an issue, but discussion. Any best practice about migration from existing UI5 project into TS UI 5 ? And hopes there are some suggestions and maybe guides. Thanks
And really hopes using the TS in our ui5 projects.
Thanks, Kevin
Hi Kevin,
unfortunately, I don't really have a best-practice how to migrate your project from classic UI5 to TS UI5. But in order to get started you may take a look into the following blog about "getting started with TS for UI5": https://blogs.sap.com/2021/07/01/getting-started-with-typescript-for-ui5-application-development/
How I would start to migrate my code is to convert the sap.ui.define
calls in to import
statements and convert the UI5 Object.extend
syntax into ES classes and for sure renaming these files from js
to ts
. Finally, it is just doing the steps of the babel-plugin-transform-modules-ui5
in the reverse order: https://github.com/r-murphy/babel-plugin-transform-modules-ui5#features
Maybe someone else can also contribute here?
HTH and BR, Peter
Hi Kevin, all TypeScript documentation related to UI5 is now bundled on https://sap.github.io/ui5-typescript/ What we have is there, what's not there, we don't have... The section https://sap.github.io/ui5-typescript#how-to-convert-an-existing-ui5-app-to-typescript should meet your requirement best, although it is clear that this could be still improved further.
Regards Andreas