News for hackers. Stuff that matters.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by wackget on Thursday August 06, 2020 @06:41PM (#24076189)
Twitter is garbage as far as I'm concerned.

I use Firefox with uBlock (standard lists) and uMatrix (all Twitter-related requests permitted) and it's still buggy as hell.

If I try to paste anything into the "compose tweet" dialog it just completely crashes with a very helpful "something went wrong" message.

If I try to cut and re-arrange parts of my tweet, it duplicates all the text and puts it out of order.

The tweet box is not even a <textarea>, it's a <div> stuffed full of <span> elements.

Additionally, the tweet box <div> is nested over 40 layers deep in a massive pile of divs.

As always, they're trying to be way too clever for their own good.

I'm not at all surprised they need polyfills for that trash.

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by bikeshaving on Thursday August 06, 2020 @07:48PM (#24076601)
Twitter likely uses content-editables over input elements because there are certain features which require more complicated, dynamic rendering than just plaintext (hashtags, mentions, links). They probably even have a team of frontend developers dedicated to this one thing. Rich text editing on the web is something everyone, not just Twitter, has trouble with, specifically when dealing with mobile, with IME, or copy-paste edge cases. I get your frustration, but know that this is one of hardest problems remaining in modern web dev, and it’s a feature which is expected by the majority of users, who don’t spend their days editing plain-text files. I do think it’s funny that you opened a web inspector, saw the divs and spans, and decided to get mad about that.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by steve_adams_86 on Thursday August 06, 2020 @08:22PM (#24076774)
Rich text editing is one of the harder problems I’ve worked on in software, which seems strange to type but... Absolutely, it’s a hard problem. I think I’ve done other things people would (I know I did) assume were much more difficult, but in recent memories that was definitely one of the biggest pains in the ass I encountered.

Come to think of it, I was basically hired to do that one thing because the existing team was struggling with it and it was blocking a launch.

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by gruez on Thursday August 06, 2020 @07:35PM (#24076538)
>The tweet box is not even a <textarea>, it's a <div> stuffed full of <span> elements.

ah yes, because webdevs love reimplementing widgets from scratch. that's no a problem in and of itself, but they also implement it half-assed, so you end up with gems like what OP described, or links being implemented as <a href="#"> with an onclick.

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by Haydos585x2 on Thursday August 06, 2020 @08:14PM (#24076732)
I think you'd find most front-end developers don't love reimplementing widgets from scratch but instead are required to because designers, product owners and customers expect this sort of experience. I just don't think Twitter would remain competitive if it had the interface of Hacker News.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by theandrewbailey on Thursday August 06, 2020 @08:31PM (#24076820)
Tell that to Craigslist.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by itake on Thursday August 06, 2020 @08:54PM (#24076939)
Craigslist has lost a ton of market share to literally every other company. I haven’t used it in years cuz there are just better products.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by maple3142 on Friday August 07, 2020 @01:31AM (#24078688)
Or because their requirement aren't just plain text. Browser's builtin controls isn't really customizable, for example you can't change a color of a specific word in a textarea.

Details: https://news.ycombinator.com/item?id=24076601

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by hakfoo on Saturday August 08, 2020 @02:53AM (#24089651)
I always wondered why we never added any more form control tags. Everything has to be re-engineered as a huge ball of ugly JavaScript.

A <richtextarea> that yielded HTML or even RTF seems like it was an obvious need by time of the end of the Netscape/IE browser wars.

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by Asooka on Thursday August 06, 2020 @08:06PM (#24076689)
That's because you're using Firefox on Linux. I have literally no fucking idea how they managed, but all these bugs are only present in Firefox on Linux. Chrome works everywhere, Firefox on Windows works, it's just Firefox on Linux that has that problem. Skype's web client in Firefox on Linux also used to have the crash-on-paste problem. I suspect there is some framework somewhere in there that both of those used and it was crashing, but Microsoft updated to a newer version while Twitter have not, for whatever reason.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by freetonik on Friday August 07, 2020 @01:17AM (#24078611)
I have similar issues in Chrome on macOS and in Safari on iOS. Twitter feels broken, like a cheap knockoff
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by drannex on Thursday August 06, 2020 @08:33PM (#24076832)
Nope, Firefox and Chromium on Windows as well.

I've had these issues nonstop for the past year.

Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by drannex on Thursday August 06, 2020 @08:31PM (#24076825)
I hate that this is an issue, but I am happy to learn I'm not the only one who has every single one of these issues dozens of times over the last year.
Re:Twitter web app now runs ES6+, reducing polyfill bundle s... by the_gipsy on Thursday August 06, 2020 @07:05PM (#24076345)
This is so true. There is no need for any of that nonsense, for composing a tweet.