ui5-community / babel-plugin-transform-modules-ui5

A Babel transformer plugin for OpenUI5/SAPUI5. It allows you to develop UI5 applications by using the latest ECMAScript or TypeScript, including new syntax and objective oriented programming technology.
MIT License
34 stars 16 forks source link

feat(overridesToOverride): backward compatibility for overrides #89

Closed tobiasqueck closed 1 year ago

tobiasqueck commented 1 year ago

Description

Thanks to #82 done by @akudev, it is possible to define controller extensions overrides nicely in with class syntax, however, it only works with very recent UI5 versions. To be backward compatible, I would like to add a configuration option allowing to convert overrides to override.

Contributes to fixing https://github.com/SAP/ui5-typescript/issues/332

Tasks

akudev commented 1 year ago

Thanks for the PR!

The code change looks good to me.

The documentation should IMO go to the list at: https://github.com/ui5-community/babel-plugin-transform-modules-ui5#class-conversion

In general this documentation is a bit ahead of its time, as the "overrides" itself is not documented yet here - because it is not even documented in UI5 at all. But that's ok, just me a favor and add a short sentence to https://github.com/ui5-community/babel-plugin-transform-modules-ui5#handling-metadata-and-renderer to have the "overrides" handling itself mentioned.

Maybe after

This plugin allows you to configure metadata and renderer as class properties (static or not) and the plugin will convert it to object properties for the extend call.

Add something like:

The same happens for overrides in controller extensions.

Don't forget satisfying the commitlint check by declaring this a new feature in the PR .