natemoo-re / microsite

Do more with less JavaScript. Microsite is a smarter, performance-obsessed static site generator powered by Preact and Snowpack.

Home Page:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate inconsistent hydration results

natemoo-re opened this issue · comments

  • hydrating on idle consistently caused the component to mount as expected and then immediately unmount (which I see at least on mobile for either hydration case on your example)

  • hydrating on visible caused hydration to sometimes not occur at all/immediately unmount, sometimes occur adjacent to the server rendered node, and sometimes function normally

I strongly suspect there’s some timing factor involved here. But I was in build mode so I didn’t get hung up on it once I brute forced a fix

Originally posted by @eyelidlessness in #107 (comment)

I can confirm the mobile issue on iOS. Likely has to do with Safari's lack of support for requestIdleCallback... I thought I was checking for support before calling it, but maybe not.

The other methods are probably a timing issue as you suspect. I'll take a look.

Oh sorry to clarify, the description above was observed on desktop Chrome before I rolled back my lockfile. I meant to say I was only seeing the first behavior on mobile. I’m fairly certain you do check for requestIdleCallback, I noticed it when I was looking at how the hydration options work.

ezoic increase your site revenue