News for hackers. Stuff that matters.
Re:How to Write CSS That Works in Every Browser, Even the Ol... by wolco on Thursday March 08, 2018 @05:23PM (#16548253)
I never stopped. For that matter I never stopped writing javascript the same way. Using let instead of var still breaks a few browsers. I want to move to modern javascript without the babel requirement some older browsers are not ready yet. I would like to but prefer no production bugs.
Re:How to Write CSS That Works in Every Browser, Even the Ol... by allover on Thursday March 08, 2018 @07:21PM (#16548883)
> Using let instead of var still breaks a few browsers. I want to move to modern javascript without the babel requirement

It seems unreasonable to me to expect to run new language features on old runtimes, do you have a good reason to not use Babel and move on? I've been writing ES6 (with Babel) from > 2 years now and have never regretted the move.

Re:How to Write CSS That Works in Every Browser, Even the Ol... by dclowd9901 on Friday March 09, 2018 @12:31AM (#16549985)
Indeed. We have to now think of JS dev for the web as something like a Universal build and dispense with trying to code for the oldest version.

I know JS is JIT, but with tools like Babel and webpack and sourcemapping, that doesn’t mean we have to write the same code that’s executed. New code is so much more resilient. Remember: this is what we evolved to.

Re:How to Write CSS That Works in Every Browser, Even the Ol... by wavefunction on Thursday March 08, 2018 @08:37PM (#16549243)
I think they mean they use var instead of let as var is fully supported by all JavaScript capable browsers.
Re:How to Write CSS That Works in Every Browser, Even the Ol... by Rumudiez on Thursday March 08, 2018 @08:48PM (#16549285)
And I think allover’s point was that doesn’t matter if you use Babel to transpile back to ES5. Personally, I would never go back now that I’ve been writing ES6 in production for almost two years
Re:How to Write CSS That Works in Every Browser, Even the Ol... by wavefunction on Thursday March 08, 2018 @09:27PM (#16549418)
ES5 doesn't cover all browsers, which is again I believe OP's point.

https://babeljs.io/docs/usage/caveats/

Re:How to Write CSS That Works in Every Browser, Even the Ol... by veeti on Friday March 09, 2018 @03:34AM (#16550504)
No, but as your link mentions you can add a polyfill to cover those gaps instead of letting IE9 dictate what you can and can't do.
Re:How to Write CSS That Works in Every Browser, Even the Ol... by pluma on Friday March 09, 2018 @04:27AM (#16550648)
Not using tooling also means no module system and no dependency management. Which likely also means no unit tests. And no minification. No linting or type checking. No third party code except maybe a few bundles you downloaded once and will never update that barf all over the global scope.

I get the appeal of partying like it's 1999 but as someone who used JS in the 1990s these are things I would not want to live without. I'm perfectly capable of writing ES3 code without any tooling but I'd rather not.

Re:How to Write CSS That Works in Every Browser, Even the Ol... by dvddgld on Thursday March 08, 2018 @06:57PM (#16548785)
Which browsers does let break?
Re:How to Write CSS That Works in Every Browser, Even the Ol... by wolco on Thursday March 08, 2018 @07:07PM (#16548822)
safari and older ie versions. 10 for sure.

Remember when console.log broke ie? Debugging was fun.

Re:How to Write CSS That Works in Every Browser, Even the Ol... by pluma on Friday March 09, 2018 @04:29AM (#16550654)
Remember when console.log was available when the dev tools were open but would be undefined otherwise, so your code would break unexpectedly but then work fine when you tried to figure out what went wrong?
Re:How to Write CSS That Works in Every Browser, Even the Ol... by laxd on Friday March 09, 2018 @11:50AM (#16552989)
Oh gaahd, It's all coming back to me now. function log(msg) { if (console.log) console.log(msg) }
Re:How to Write CSS That Works in Every Browser, Even the Ol... by Yaggo on Friday March 09, 2018 @07:05AM (#16551174)
> safari and older ie versions. 10 for sure.

This is false information about Safari. In fact, Safari was the first browser to implement 100% ES2015 support.

https://developer.apple.com/safari/technology-preview/releas...

Re:How to Write CSS That Works in Every Browser, Even the Ol... by neonhomer on Thursday March 08, 2018 @07:35PM (#16548957)
It was terrible when the only thing you could do was alert your variables!
Re:How to Write CSS That Works in Every Browser, Even the Ol... by geocar on Thursday March 08, 2018 @07:55PM (#16549064)
Back in the day I used LiveConnect[1] for this and other purposes[2]. I would dump errors to an IRC server so that I could collect the results. I could also respond with code that would be eval'd making development very easy.

[1]: https://developer.mozilla.org/en-US/docs/Archive/Web/LiveCon...

[2]: http://geocar.sdf1.org/ajaj.html

Re:How to Write CSS That Works in Every Browser, Even the Ol... by tonyarkles on Thursday March 08, 2018 @09:54PM (#16549512)
> I could also respond with code that would be eval'd making development very easy

In dev only, I hope?! I honestly love the idea as a super fun hack, but the security implications for prod are terrifying.

Re:How to Write CSS That Works in Every Browser, Even the Ol... by geocar on Friday March 09, 2018 @05:21PM (#16555528)
Not sure there was much risk: The web application used a private IRC server with name+password registered users. L3 support who /msg'd a user session some JavaScript doesn't seem likely as the messages were all logged, and anyone with fileserver access could just put whatever they want in the <script> tag anyway...
Re:How to Write CSS That Works in Every Browser, Even the Ol... by comex on Friday March 09, 2018 @06:35AM (#16551092)
It doesn’t break Safari.
Re:How to Write CSS That Works in Every Browser, Even the Ol... by wolco on Friday March 09, 2018 @06:25PM (#16555972)
version 9 and below it breaks