Open gregjopa opened 2 years ago
Totally possible, but remember prerender is completely synchronous, so you can just do:
prerenderTemplate: function containerTemplate({ doc, event }) {
log('START_PRERENDER');
// do the prerender
log('END_PRERENDER');
}
That said -- this won't be that useful since:
- Prerender end will be virtually the same time as prerender start, since it's a synchronous function (always)
What about the time it takes to insert the prerenderFrame into the DOM? Here's the code I'm referring to.
https://github.com/krakenjs/zoid/blob/c10ac415ce6a2174c7ef08f2451da95bb9795888/src/parent/parent.js#L817. My thought is we need EVENT.PRERENDERED
to include that cost.
Aaah that's fair. Yeah it's still synchronous; but definitely wouldn't hurt to measure. No objections!
Sweet thanks for the review @bluepnume!
@gregjopa Are we able to pull this version (with PRERENDER/ED)? it's not available on the Cloudflare CDN and I can't get npm to install v10.1.0, as either a version or tag. Please help if you have a moment
Zoid has the following
event
feature for tracking when rendering completes: https://github.com/krakenjs/zoid/blob/main/docs/api/create.md#listening-to-zoid-events. TheseRENDER
andRENDERED
events work great for measuring rendering performance. However, we are missing events for knowing when the prerender phase is complete withprerenderTemplate
.To solve this problem let's add the following new events for hooking into the prerender lifecycle: