Closed thomashoneyman closed 4 years ago
We made a choice to stick with ES5 in the core libraries, and I will continue to do so in my personal libraries at least, as I like knowing that no extra post-processing is required after bundling an app. I know support is pretty decent for arrow fn/const/let now, but I'm fine with the aesthetic hit that the FFI JS takes to never have to think about whether something is going to need babel or whatever. But that's just, like, my opinion man. :smile:
I think there might be a similar conversation about it on the discourse somewhere... although it could have been in a PR to a core library, where we discussed >ES5 in core libraries.
I think that's a good reason to continue with ES5 -- the caniuse support sits at 97%, which ain't 100% -- and it's good to ensure PureScript libraries can confidently be used without a bundling step. I was thinking that if the compiler can parse it it's fine, but that's not really correct -- it's not like PureScript is transpiling the FFI files.
With this in mind I'm going to close this issue and stick with ES5 for any library that wouldn't already require a bundling step (for example, a library with a JS dependency that would require bundling anyway).
Currently we only allow ES5 in our eslint configuration. But recent versions of the PureScript compiler support several useful features from ES6, namely:
const
andlet
keywordsI think that it should be acceptable to use ES6 features like these in our FFI files. That may make current versions of these libraries unusable with earlier versions of the PureScript compiler, however (compiler versions with older language-javascript versions, specifically). I haven't measured how far back these changes go but I believe they're all part of the 0.13.x series of the compiler.
@garyb Do you have an opinion on this?