-
Notifications
You must be signed in to change notification settings - Fork 4
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
Getters/setters should be removed somehow #3
Comments
@IvanSanchez instead of this plugin, as far as I remember, |
@IvanSanchez Please see this PR rollup/rollup#1068 I've merged this plugin into About the getter issue, I think it's the AST problem to identify the https://github.com/rollup/rollup/blob/master/src/Declaration.js#L82 |
@futurist Thanks for the info! I'll keep an eye on that PR then. I assume that this plugin will be deprecated eventually? |
For a long term, YES. |
@futurist there doesn't appear to be a |
There is no way to remove or transpile getters/setters to ES3 and any feature that is relying on them (like decorators). Any library that depends on However, most libraries have similar older version that doesn't use modern getters/setters or decorators. You could easily polyfill However, rollup and bunch of base plugins like commonjs have an issue when named exports are not escaped and es3 can't event parse |
@sormy yes but in this case, the request is to remove getters/setters when there weren't any to begin with, and aren't necessary for the outputted code to function (eg. from the OP, a getter that just returns the property...it would have been fine as a normal property without the getter). |
babel can exclude |
In Leaflet, we've got a bit of code like:
Normally
rollup
will take all the exports and wrap them in aObject.freeze()
, like:For some reason I don't fully understand (related to the fact that the exports are variables and not explicit functions), they're just a getter.
Now, when running
rollup-plugin-es3
, the resulting code will be as follows:...and that will trigger a parse error, even in ES5 and ES6 environments. 😞
cc @mourner - this is blocking IE8 support in Leaflet/Leaflet#4989
cc @Rich-Harris - maybe the getters/setters issue is a core rollup issue
The text was updated successfully, but these errors were encountered: