-
Notifications
You must be signed in to change notification settings - Fork 16
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
Property getters and setters #25
Comments
petermuessig
added a commit
that referenced
this issue
May 29, 2023
To ensure that other plugins can be used upfront the conversion of the ES6 imports and classes to UI5 AMD-like syntax and Object.extend, the plugin now runs in the exit phase of the visitor. This allows other plugins, e.g. decorators to run before and convert the code accordingly. This plugin only sanitizes the decorators to remove the plugin proprietary ones to avoid conflicts with other plugins. The plugin is now also not dependent on the plugin order anymore and using the preset-env ensures a proper transpilation of code to a specific target browser set. Added tests to ensure that a proper decorator handling works when using the plugin-proposal-decorators or that e.g the conversion of getters/setters takes place when using the babel plugin named plugin-transform-property-mutators as this is not part of the preset-env by default. Updated all dependencies of the project with this change. Fixes #23 Fixes #25
petermuessig
added a commit
that referenced
this issue
May 30, 2023
To ensure that other plugins can be used upfront the conversion of the ES6 imports and classes to UI5 AMD-like syntax and Object.extend, the plugin now runs in the exit phase of the visitor. This allows other plugins, e.g. decorators to run before and convert the code accordingly. This plugin only sanitizes the decorators to remove the plugin proprietary ones to avoid conflicts with other plugins. Added tests to ensure that a proper decorator handling works when using the plugin-proposal-decorators or that e.g the conversion of getters/setters takes place when using the babel plugin named plugin-transform-property-mutators as this is not part of the preset-env by default. Updated all dependencies of the project with this change. Fixes #23 Fixes #25
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ES6 defines classes with property getters / setters:
Unfortunately, classes handled by the UI5 transformation are missing out on a lot of Babel's class features (see e.g. #23), and getters/setters are among those. The plugin produces a class declaration such as this:
There are two problems with this:
extend
which "accidentally" triggers execution of the getter withthis
being the aforementioned object instead of an instance of the class.Would it be possible to change the UI5 transformation so that it only creates a skeleton class through UI5's
.extend
with the metadata, renderer and constructor set, and delegates creation/declaration of everything else to the usual Babel mechanisms?The text was updated successfully, but these errors were encountered: