Live data from Hacker News

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

giuseppegurgone.com

41–50 of 163 posts

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

#41

Earlier quoted context omitted.

With React Native you can just use file.ios.js or file.windows.js etc if you want to do something different entirely for a platform. You can also check the platform with a function for minor adjustments. You can also handle these differences in a RN extension if they involve native code. You can model your codebase so the function stubs are the same, but the implementation differs based on platform. So you can use it…

> With React Native you can just use file.ios.js or file.windows.js etc if you want to do something different entirely for a platform. You can also check the platform with a function for minor adjustments. You can also handle these differences in a RN extension if they involve native code. Well if you need a specific widget or library that react native doesn't support by default you have to write bindings, and unless…

Not really as you'll have to do that work anyway if it doesn't exist. It's better to do a small extension than to duplicate all of your other shared code just to do that change.

Most of the time there will already be a 3rd party extension, but it's really easy to make them. You will need some slight native experience, but you would need more for a full native app.

With Titanium it wasn't easy to do these extensions, with RN you have direct access to the native platforms and code. You can go as native as you want in one or all platforms while sharing the code you want to.

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

#42

Too much complexity with garbage excuses. A lot of the web is like that now. You can't link to a specific tweet. 'Nuff said

> You can't link to a specific tweet. 'Nuff said

What? https://twitter.com/Twitter/status/1433462575438643206

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

#43
rnweb saved my bacon in an app I did that was architected as a react app hosted within an iOS webview. the killer problem I was facing is that the webview didn't handle touches well within a scrolling context. so if you began your scrolling gesture by touching down on a button's box, it would often interpret that as a button press.

which was hella annoying and a classic "tell" that you are dealing with a web app trying to masquerade as a native app.

refactoring to use rnweb's and made all that go away. Now I'd (boldly) challenge you to find a "tell" that this app is not native. (shelf.fm if you're curious).

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

#44
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…

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, the former seems hard to do special things with and the latter has a pretty confusing and convoluted setup process. Neither has real web support.

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

#45
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.

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

#46
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.

Is there any infinite scrolling website that works smoothly on mobile devices?

I mean... I'm perfectly fine hitting buttons to goto the next page honestly.

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

#47
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

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

#49
post #46

Earlier quoted context omitted.

Is there any infinite scrolling website that works smoothly on mobile devices?

I mean... I'm perfectly fine hitting buttons to goto the next page honestly.

I kinda want to agree but then, I practically never do hit that button. Not on google search results. Not on hacker news.

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

#50

Earlier quoted context omitted.

> With React Native you can just use file.ios.js or file.windows.js etc if you want to do something different entirely for a platform. You can also check the platform with a function for minor adjustments. You can also handle these differences in a RN extension if they involve native code. Well if you need a specific widget or library that react native doesn't support by default you have to write bindings, and unless…

Not really as you'll have to do that work anyway if it doesn't exist. It's better to do a small extension than to duplicate all of your other shared code just to do that change. Most of the time there will already be a 3rd party extension, but it's really easy to make them. You will need some slight native experience, but you would need more for a full native app. With Titanium it wasn't easy to do these extensions,…

Point being these are leaky abstractions. You have to have some measure of knowledge as to how the underlying platform works in a professional context.
Post reply on HN