storeon / websocket

Module for storeon to sync events through WebSocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS flavor

paul-pro opened this issue · comments

Hello. I also want to add 'exclude' option and to refactor module signature a bit. Is there reason to use ES5 (without let const and destructuring) in favor of latest EcmaScript specification?

Hi :)

I also want to add 'exclude' option and to refactor module signature a bit.

Feel free to send PR.

Is there reason to use ES5 (without let const and destructuring) in favor of latest EcmaScript specification?

The storeon itself use ES5 only to support IE, Opera Mini. So module for storeon has two ways: to be written using ES5 or use modern JS but with describing in docs How to compile the library with Babel for IE.

I prefer the first way. Be consistent with storeon core and use ES5 only.

More about you can read in this issue: storeon/localstorage#9

Yeah, @ai has some point and sticks to it, but as he said, it's up to you how to handle your own libs.

Don't rely on his opinion too much: it is obvious that both ways has some pros and cons and 'pure es5' way is definitely losing over time. One day Andrey will change his mind and you will be in a strange position: forced to rewrite your code just because you are now allowed to. Adding Babel compile docs is not that bad, most of the users who needs to support ancient browsers are already doing it.

I have my PR ready, but will change it to ES5. By the way, Symbol is ES6 feature and you should replace it to something else (I don't know if it worth issue in https://github.com/nkt/eslint-plugin-es5)

@paul-pro Thank you for your comment.

Don't rely on his opinion too much: it is obvious that both ways has some pros and cons and 'pure es5' way is definitely losing over time. One day Andrey will change his mind and you will be in a strange position: forced to rewrite your code just because you are now allowed to. Adding Babel compile docs is not that bad, most of the users who needs to support ancient browsers are already doing it.

And how you have said it is up to me. But thank you for your suggestion.

Symbol is ES6 feature and you should replace it to something else

Thanks. I didn't know about it. I will think about Symbol