Live data from Hacker News

Twitter.com's HTML, which is produced by React Native for Web, explained

giuseppegurgone.com

81–90 of 163 posts

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#81

Earlier quoted context omitted.

Twitter should be a protocol integrated into browsers, not a site.

Wasn't that RSS?

It's close, but browser support & integration was never good enough, and that lacks the ability to carry on a dialog or to attach one's own post to someone else's, which people clearly want.

Any move to develop it further to add those sorts of things would have run into the same problem other protocols have for the last 20+ years, which has made them even more difficult to develop and promote than they already were: keeping huge numbers of users captive has become per se valuable, thanks to having as-complete-as-possible spying-generated profiles on people and massive datasets being important both to the money-spigot of the modern online ad market, and for developing machine-learning solutions to dominate other "verticals" (against any competitor who lacks the same massive, spying-obtained datasets, so is at a huge disadvantage). Application-level open protocols make tracking & spying harder, so companies chasing those datasets really don't want them around. The few that survive in common use do so under constant threat, protected only by luck, by already being "good enough", and by having already established a large presence before that sort of business model really took off.

[EDIT] incidentally, pioneering the inclusion of an open, cross-site social network as a first-class browser feature is one of my crazy ideas for how Firefox could save itself from irrelevance—but like most of the other ideas I have to save them, it's probably too late anyway.

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#82
post #8

I've been searching a stack which could allow for a single codebase to be rendered in Android, iOS, and the web, and React Native + React Native Web might be the top choice for that. Other competitor includes Flutter, which used to only render canvas on the web, but right now it seems they have an option to render as HTML as well. I bet the need for cross-platform stack might continue to rise in the future. It's just…

You might find this recent blog post from the React Native team informative, about their long-term vision for multi-platform support: https://reactnative.dev/blog/2021/08/26/many-platform-vision From personal experience, I've had great success targeting the 3 platforms you mention in a single RN codebase, with a very high degree of code re-use.

[deleted]

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#83
post #79

Lots of classic HN dismissals here, though I am glad we as a community have finally gotten past the anger around requiring JS to use the site. In my mouth, Twitter is probably the best, most responsive web app I've ever used. It is not trivial to make a responsive infinite scroll that remembers your place on back, live updates gracefully, has useful shareable URLs, keeps memory usage low, loads quickly, etc. To me it…

> we as a community have finally gotten past the anger around requiring JS to use the site.

We have not. It still sucks.

As for the twitter responsiveness experience... You must be living in an alternate universe.

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#84
post #31

Twitter's website is absolute garbage, the feed is unresponsive, tweets fail to load, it's just terrible. If you're modeling your frontend off of anything please do not pick Twitter because their web experience is awful.

The tweets not loading is clearly intentional. They want you signed in, preferably on a native client where they can track more invasively.

That said, I fully agree - the website is literal garbage despite its insane simplicity, and there would be 0 reason to trust that their web tech works well because they have never demonstrated such a thing.

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#86
post #8

I've been searching a stack which could allow for a single codebase to be rendered in Android, iOS, and the web, and React Native + React Native Web might be the top choice for that. Other competitor includes Flutter, which used to only render canvas on the web, but right now it seems they have an option to render as HTML as well. I bet the need for cross-platform stack might continue to rise in the future. It's just…

I created a tool for those wanting a cross-platform RN app: http://ult.dev/

You can create a project by running: "npx ult ProjectName"

You could use Expo, but I didn't want to be locked into the Expo environment, I wanted native extensions, and I wanted desktop platforms.

For web it uses a lite forked CRA project tailored for React Native Web. For native it runs the proper commands and sets up all the platforms for you.

Currently ReactXP is the default as it's more stable and feature complete, but RNW is supported.

In the future RNW will be default as ReactXP is abandoned and RNW is the clear winner.

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#88
post #62

Earlier quoted context omitted.

You literally can't use the site properly when you're not logged in (and I mean basic clicking on retweeted/quoted stuff shows a login page, clicking on people's names shows a login page etc.) - how is that good? (I mean sure, build your walled garden as you please, but then you have no business showing in search engine results.)

I've been encountering this a lot today, because apparently the MTA (and the Metro North) have decided that Twitter is their official news distribution channel [0]. They're posting updates there more frequently than they are on their official website, and because we're in the middle of dealing with a hurricane, they're pushing me to interact with Twitter to figure out how to get home tonight. Apropos of that: the MTA…

governments should be strictly prohibited from requiring privacy-invasive (tracking, deanonymizing) technology for any service, let alone emergency services. a gov website requiring google fonts, apis, captcha and tracking is not in accordance with the basic civil right of being free of government surveillance (via said 3rd-parties).

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#89
Amusing anecdote involving div soups: Back in 2010 in one of my CS classes, the professor maintained a Google Sites to communicate with her students and upload slides. At the end of the semester, she wrote a list of students who must take the finals to get at least a passing grade.

The thing is, you view it Chrome, the list displays normally, a handful of students. But you view it in Firefox and it's an empty list. On Firefox it would look like

> (MM/DD/YY) Here's the list of students who must take the finals:

>

> (MM/DD/YY) [Next reminder...]

Sucks to be a Firefox user and be on that list.

A few years later, maybe 2015/2016, with a few years in the industry under my belt, I remember this curiosity and rechecked. Firefox is still not showing the list. I open developer tools to inspect and I'm greeted by an eldritch, decadent, and blasphemous nesting of divs. I did not try to understand it but it seems the stylesheet in use indents divs a certain amount and they abused this rule to get the list to the indentation they want. Probably it hit some limit in Firefox.

I've never used Google Sites so I can't guess whose fault is this. But it's unlikely my prof hand-wrote that HTML.

With this article, it seems to me that Twitter devs, for all their fancy dev toolchains, could only produce slightly better HTML than my professor. Perhaps the industry in general is really not much better than Google Sites, seeing our reliance on such bloated frameworks. What a sobering thought.

P.S. I did look her up just to check if this bug is still present. Her Google Sites is still up, she still teaches, but she seems to have taken down her earlier course pages.

Re: Twitter.com's HTML, which is produced by React Native for Web, explained

#90
post #31

Twitter's website is absolute garbage, the feed is unresponsive, tweets fail to load, it's just terrible. If you're modeling your frontend off of anything please do not pick Twitter because their web experience is awful.

I rarely experience any of these issues and think their front end is quite good. Just their a11y / keyboard nav stuff is some of the best I've seen. Some questionable design choices but that's more of a product thing

About 90% of my interaction with Twitter is is clicking a link from HN. When I do so, there's about a 1/3 chance that tweet doesn't load.
Post reply on HN