Jason Miller

Results 1173 comments of Jason Miller

There is a significant rewrite underway that we aim to land as Preact 11. One of the important part of this is to firm up Suspense support, at which point...

We currently recommend using Preact's suspense mechanic. You can see a very small but complete example of this in `preact-iso`: https://github.com/preactjs/wmr/blob/master/packages/preact-iso/lazy.js

I worry that this will prevent us from supporting [EventListener Objects](https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener) in the future, in addition to the issue you noted with set/unset. An idea I had while looking at...

Excellent analysis. A few initial guesses at the culprit here: - circular references in the virtual DOM tree (`vnode._parent` 🔁 `vnode._children[0]`) - `component._hooks` being attached to those vnodes as `vnode._component.__hooks`

given that it's affected by timing, I wonder if this could be related to the event handler pathing fixes that went out in .19? There's a large VDOM tree here...

Tests are failing, and I think it's because Suspense assumed `Component.prototype.render` would render children.

I think we can merge. Only thing I was wondering is whether we wanted to hoist the function up as a constant (`EMPTY_FUNC`). Potentially useful for null callbacks?

Ah nah - I was just guessing this would be smaller and wasn't near a computer so I abused the size bot to check. There is probably a decent performance...

@JoviDeCroock my hope was that this would make #2210 unnecessary. I should copy the test over and see if it fails here.

@JoviDeCroock perhaps if we null'd the `._hooks` reference when unmounting? The demo in the linked issue continually remounts trees, so it's very likely that this leak happens for unmounted components.