sql-formatter
sql-formatter copied to clipboard
Sql-Formatter plugin can not work in IE browser
In IE browser,it is report error msg.
whether this plugin can support IE, when the version is greater than 2.3.4 ?
Yes. IE is not supported, as SQL Formatter is built with ES6 target, which isn't supported by IE.
If you need IE support, you have the option to compile it with Babel to ES5.
https://kangax.github.io/compat-table/es6/
@nene I try compile it with Babel to ES5, but I found it also can not work in IE, because The Babel cannot transform unicode regex. so. It there any way to compile it?
What about using regexpu to transform these regexes to ES5?
I suspect though that the main problem is that sql-formatter builds lots of regexes dynamically, and those can't be detected by the transformation tools.
I think there are really only a few places where we really need these unicode regexes. The main one being matching of identifiers. And this part definitely can't be transformed, as it's not part of a /regex-literal/u
.
I think it should be possible to eliminate most of our current unicode regexes (or maybe only use them when unicode support is detected in browser). I'll reopen this issue to reconsider.