Better HN
topnewbestaskshowjobs
Log inSign up

Zer8

11 karma · joined Mar 14, 2015 (11y ago) · 5 submissions

Submissions

comment 11y ago · link · parent

React only "renders" everything within its shadow DOM. It then applies the results of diffing the previous and current version trying to use the most atomic operation (innerText, add/removeClass, add/removeNode, etc)

comment 11y ago · link · parent

We're talking about Backbone + templating here, and that is what happens with those libs.

Obviously there are other libs / frameworks that can do that, all of them using some sort of shadow DOM.

comment 11y ago · link · parent

Say you want a form with as-you-type validation. You can't have a view containing the whole form and just re-render that as someone types. If you did, you'd lose the user current focus on every render. This forces you to manipulate parts of the DOM "by hand", something React abstracts for you.

I find Backbone events extremely hard to work with (error-prone, super hard to test / debug), because there are many operations that emit tons of events. So you either listen+render() on any event (very inconsistent performance if your app has any kind of complexity), or you hand-pick the events you want to react to (event-hell). Using immutable objects along with React's PureRenderMixin means you can just render() on any change, with great performance. It makes your UI purely functional, very easy to reason about, and easy to test.

comment 11y ago · link · parent

Same experience here. I took 0.1g to close to 1g on several occasions over a couple years.

Doses in the 0.1-0.2g range would leave me fairly slow the next day, but that's it. With heavier doses I'd see after-effects for about a week (like reaching for my phone and pulling a lighter from my pocket, disconnecting in the middle of a conversation, losing track of time)

The only time it took a long time to fully recover (5-6 weeks, progressively) was after taking some twice in 2 consecutive days. Quantities weren't big, maybe 0.5g total, but the effects lasted really long.