Live data from Hacker News

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

giuseppegurgone.com

151–160 of 163 posts

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

#151

It feels very unnatural to me to use React Native semantics and bolt on props for headings and the like; it seems like it would be better to write than , even just from a DX perspective.

Since everything is a component in React you could abstract that eg.

const H1 = props =>

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

#153

Earlier quoted context omitted.

Same here, with the same conclusion. React may not be my favorite web framework, but the native ecosystem blows everything else out of the water. Desktop support is approaching “okay” (judging by the almost kinda somewhat native feeling flagship app Facebook Messenger on macOS), which puts it many kilometers ahead of any alternative. The main alternatives for native feeling apps seem to be Xamarin Forms and Qt Quick,…

> kinda somewhat native feeling flagship app Facebook Messenger on macOS You mean "horribly slow, loses scroll position, can't reliably load and display images, bad click targets everywhere" flagship app?

… yeah. It’s not great. The corners aren’t even rounded. But my gut feeling is that it’s mostly a failing of the Facebook Devs, not React Native Desktop.

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

#154

Earlier quoted context omitted.

Same here, with the same conclusion. React may not be my favorite web framework, but the native ecosystem blows everything else out of the water. Desktop support is approaching “okay” (judging by the almost kinda somewhat native feeling flagship app Facebook Messenger on macOS), which puts it many kilometers ahead of any alternative. The main alternatives for native feeling apps seem to be Xamarin Forms and Qt Quick,…

Judging from KDE's Kirigami apps and Subsurface on Android, I would not describe Qt Quick apps as native-performing or feeling.

Because you’re judging one that don’t try. There are demos of Qt Quick apps emulating Android very closely.

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

#155

Earlier quoted context omitted.

Judging from KDE's Kirigami apps and Subsurface on Android, I would not describe Qt Quick apps as native-performing or feeling.

Last time I used Qt Quick, native looking widgets were outside of its scope. You're meant to define the styling you want for all of your widgets, and Qt will render them consistently across platforms.

Out of scope for Qt Quick, perfectly in scope for Qt Quick controls. It looks very native on all the platforms I’ve tried, likely due to their experience with Qt Widgets.

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

#156

Earlier quoted context omitted.

> kinda somewhat native feeling flagship app Facebook Messenger on macOS You mean "horribly slow, loses scroll position, can't reliably load and display images, bad click targets everywhere" flagship app?

… yeah. It’s not great. The corners aren’t even rounded. But my gut feeling is that it’s mostly a failing of the Facebook Devs, not React Native Desktop.

More: it doesn't remember window size, takes up to several seconds to apply a custom background to a group chat, and requires a measly 1.1 GB of memory (3.6 GB of real memory) to fail to do all that.

This is the failing of both React Native Desktop and of the Facebook Devs that couldn't even make a rather primitive chat work properly.

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

#157

Let me write it all down, it's a bit confusing. There is a React framework, created to produce Javascript backed applications running in the browser. Then there is a React Native, a wrapper to run those applications on mobile platforms by compiling Javascript apps to native code. And then here is a React Native for Web, a way to compile a Javascript React Native apps into... Javascript to run inside browsers? Boy, th…

React Native web is really all about code sharing between web and mobile in my mind. Say Twitter were to build their website in plain ReactJS, if they did that then there would be no easy way to transfer components from web to mobile, yes they are both written in React, but regular React isn't 100% interoperable with React Native.

This is where React Native for Web comes into the picture, RN for Web patches that gap of interoperability between web and mobile, what Twitter likely has behind the scenes is a custom UI library that provides all the elements you see on Twitter, if they had chosen ReactJS for the web, they would have to maintain two libraries, however with React Native for web, they only have to maintain one.

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

#158
post #126
post #104

Earlier quoted context omitted.

Why would you attribute that to a dark pattern? I would think that your first visit loaded a resource/set a state somewhere which let's the second visit go through. Much more likely to be a programming error then a purposeful decision by a PO as the end result is objectively terrible. I cannot imagine anyone getting convinced to register to a webpage that cannot even load. It's not that content is hidden behind a pop…

Because it's hard to believe that Twitter has been that incompetent for that long. It seems more likely that they're trying to push people to log in.

GTA online has had slow loading times for years until a fan reverse engineered the game to find a bad serialization issue which basically created a n*n computation.

Some issues are fucking hard to detect and an initial page load breakage that only happens sometimes (likely a race condition that cannot be replicated in testing) is an example of that

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

#159

It feels very unnatural to me to use React Native semantics and bolt on props for headings and the like; it seems like it would be better to write than , even just from a DX perspective.

Since everything is a component in React you could abstract that eg. const H1 = props =>

Sure. But I think the framework would need to emit a proper tag rather than the tag soup that it seemingly emits now. I can't see a win in expressing something in an idiomatic way, to have it translated to an unidiomatic output that mimics the behavior of the original idiomatic code.

Like, if you're typing the Text version, you already know it's going to be a H1. So just write that.

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

#160
post #149

So this explains how their markup is hot garbage, but not really WHY it is.

laziness. they could just not use a tool that generates reams of bullshit markup but that would require thought and effort to understand and work with the material of the web.

React Native for Web is the tool that generates that HTML
Post reply on HN