Skip to content

Comment on Everything about Google Translate crashing React (and other web apps)parent

Comments

The primary application is the browser.

The problem here is that react "application" builds its own state of the web page, fails to reconcile it with changes to actual state, ends up in a detached state with stale information and then proceeds to alter actual state based on the corrupted information it has.

I disagree. The browser is a VM that runs other applications, in this case one that's written in React.

Then the browser, via an extension, is corrupting that application's internal state and is then surprised when that application stops working correctly. Well, duh.

If Translate were to only modify the text on the website, I'd think React would be able to deal with it better. But it seems to be modifying the structure too (adding <font> tags); I think it's not reasonable to expect every JS framework to be able to deal with that properly.

The browser extension is not touching "application's" state whatsoever. The browser extension is, however, making a perfectly legal store on a shared system resource (if you consider browser to be VM), but the application ignores those modifications and continues to issue state modification calls computed from it's own, now long invalidated, internal cache.

I think it's not reasonable to expect every JS framework to be able to deal with that properly.

It would be unreasonable to call any framework out of pre-alpha prototype stage, much less production ready, if it can't handle such basic stuff, sorry.

I disagree with that. Fundamentally, it comes down to who is in charge. Does React control the DOM or does the DOM control react? I see this as a cache concurrency issue--React is trying to cache the DOM and breaking when that fails.

either that or the browser is the new OS, as people keep saying.

If there is such a thing as web apps, then the primary application is the web app, and that primary application runs in the browser.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.