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
doesn't produce valid es3 javascript code #2591
Comments
Ping! |
1 similar comment
Ping! |
Hi @sormy, What I could see for Rollup is to support a compatibility mode for Rollup which would imply setting a compatibility target and change/omit some transformations based on that. But also note that we recently REMOVED an IE8 compatibility feature because it became unmaintainable, so to revert on that stance, a few things need to happen.
|
First of all, thank you for your hard work to support rollup. Integration tests running on real browsers is a nice feature to have however I don't see why this small fix can't be easily covered by unit tests. Quoting the export name doesn't break upward compatibility, have no performance degradation, and doesn't not significantly contribute to bundle size (indention takes much more space than two extra characters per exported entry). If minification is used, these extra quotes will anyway gone. I think there is no any harm to keep it as default. However, I'm fine if it will be gated by config option, if you disagree. Regarding overall compatibility of Rollup with ES3 (IE6, IE7, IE8). Rollup is very very very compatible based on my experience. This is the only incompatible thing I found in rollup core. I have pretty big application that cross compiled to different platforms using different set of plugins. Currently I have to patch some plugins to make final bundle fully compatible with ES3. You will be probably surprised, but es3 keyword quoting is the only but typical topic of all these patches. Babel with Current incompatibilities:
After these fixes (3 lines of code change in total) rollup with typical plugin set is fully compatible with es3. I would like to contribute back es3 support, provide documentation for rollup for es3 if needed and cover by unit tests. |
Ping! Is this a such big deal to accept 3 line fix? I can submit PR, add unit tests. Just let me how would you like me to fix the issue. I can gate the feature by outputOption. Keep in mind, Babel now has full es3 support on |
I guess considering that we also have something like this in our interop wrapper, we might just as well just do your originally proposed change though I still find it wasteful to do it for any variable name, not just for "default". Are there others to be considered? Adjusting the existing tests should then probably be enough. Just be aware that this does not give you full ES3 compatibility in case your dynamic namespaces contain reassigned variables, in which case getters are used, and I do not feel very happy about reintroducing the legacy option we removed last year to achieve that. So unless we have integration tests, it will be just guesswork. |
How about using |
Hey folks. This is a saved-form message, but rest assured we mean every word. The Rollup team is attempting to clean up the Issues backlog in the hopes that the active and still-needed, still-relevant issues bubble up to the surface. With that, we're closing issues that have been open for an eon or two, and have gone stale like pirate hard-tack without activity. We really appreciate the folks have taken the time to open and comment on this issue. Please don't confuse this closure with us not caring or dismissing your issue, feature request, discussion, or report. The issue will still be here, just in a closed state. If the issue pertains to a bug, please re-test for the bug on the latest version of Rollup and if present, please tag @shellscape and request a re-open, and we'll be happy to oblige. |
#4215 Should finally fix this |
How Do We Reproduce?
Rollup doesn't quote keys in export objects and that is causing some reserved keywords (like "default") to be used as object keys. That is not compatible with es3 (ie6/ie7).
Proposed fix is:
I can submit PR and fix unit tests if you are ok with this solution.
Another solution is to create new rollup options where target js version is specified and according to es3/es5/es6 version we could escape only required parameters. Will need to steal some code from babel in that case and dev effort will be much higher.
Expected Behavior
Ideally rollup bundle should be compatible with es3. It is minifier responsibility to remove extra quotation where it is needed.
Actual Behavior
Produces objects like
{ default: ... }
in js source code and it is not parseable by IE7.PS
I know that IE6/7 are dead on desktop but these browsers are still used on mobile devices operating Windows CE 6/7 (a lot of zebra hand scanners, for example). It is nice that with modern build tools we could write once and transpile code to multiple platforms but, unfortunately, current rollup version has this small compatibility issue that could be easily fixed.
The text was updated successfully, but these errors were encountered: