3 ms·
I had a dev write some "modern" Javascript in a project. We neglected to test in slightly out-of-date safari on Mac. Took forever to figure out that "let" keywo
by cabaalis 9y ago
I had a dev write some "modern" Javascript in a project. We neglected to test in slightly out-of-date safari on Mac. Took forever to figure out that "let" keyword was not supported.
- aaron-lebo 9y agoYou're probably aware of this but that's why you put everything through Babel or Typescript to convert it. That setup is easy enough.
- klipt 9y agoIt's like compiling for older CPUs ... if newer CPUs could execute C++ source code directly.
- trynewideas 9y agoAssuming they read the post, they're not only aware of it but also read the post's author warning their fictional subject about the performance problems of using transpilers in production, and shrugging it off for the example because it's just a learning exercise and "easy to change later".
- troygoode 9y agoThe warning in the content is (correctly) against performing the transpilation in the client; the fix is to run the transpiler on your server, preferably as part of your CI build process.
- mjevans 9y agoObligatory links: https://caniuse.com/let https://caniuse.com/let https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Browser_compatibility https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... It's amazing how recently some things arrive and how late competitors skip some elements.
- mediumdeviation 9y agoWow, Safari Mobile only gained support in iOS 10. That's September 2016, and leaves out iPhone 4S, iPad 2 and iPad 3, devices from 2011 and 2012.