-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: keep track of which resources have emitted early hints and emit complete event once all resources have emitted #421
Conversation
… complete event once all resources have emitted
Came to think of, what happens if one or more podlets don't send an early hint (like if it's down, or on a version that doesn't send those hints)? |
Good catch, if the podlet is down, the fallback will be pushed and this will also qualify as having received hints. |
I think it's fair to say that this a feature that only makes sense if all podlets have been upgraded. The feature needs all podlets to be early hinting their assets (or fallbacks) to be able to send the document head early. The best we could do would be to go straight to fallback for podlets that dont support the feature which isn't ideal and is tricky to implement since we would either need to add something to the podlet manifest so that the client can tell if its dealing with old v new or otherwise add a timeout which would add complexity and negate the benefits of sending the header early. So, I think we just say that all podlets need to be upgraded before a layout can use this feature. The actual version would be non breaking and so safe to update all layouts but the feature would require consciously upgrading podlets to be using early hints. |
🎉 This PR is included in version 5.2.0-next.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 5.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is phase 2b or phase 3a.
Needs: podium-lib/utils#261
This change uses a new property on http incoming to track which resources have received early hints back. When all resources have responded with their early hints, incoming.hints will automatically emit a 'complete' event.