-
Notifications
You must be signed in to change notification settings - Fork 30
Adaptive site: add priority
prop to Island
#8970
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
Conversation
Size Change: 0 B 🆕 Total Size: 0 B |
abef462
to
1e2b436
Compare
1e2b436
to
1d8e3ee
Compare
eaa286c
to
677d42c
Compare
b285560
to
5e40ec2
Compare
5e40ec2
to
d284108
Compare
Island
Island
Non-critical islands _must_ be deferred! Co-authored-by: Alex Sanders <alex@sndrs.dev>
d284108
to
dadb0eb
Compare
Island
priority
prop to Island
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ 💃 ✨
@@ -400,7 +400,7 @@ export const renderElement = ({ | |||
return ( | |||
// Deferring interactives until CPU idle achieves the lowest Cumulative Layout Shift (CLS) | |||
// For more information on the experiment we ran see: https://github.com/guardian/dotcom-rendering/pull/4942 | |||
<Island defer={{ until: 'idle' }}> | |||
<Island priority="critical" defer={{ until: 'visible' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We made this change because you cannot defer until idle
for a critical
priority – we should probably have brought more attention to this change to @guardian/commercial-dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depends on #8967...
What does this change?
priority
prop toIsland
, which corresponds to the priorities of the schedulerIsland
via the new propImportant
This PR does not affect way in which
Island
s are loaded/hydrated right now.A subsequent PR will use the new
priority
prop to orchestrate hydration with the scheduler.Why?
Will enable us to ensure high priority islands are run on the page before other, lower priority tasks.
Reviewing
A lot of files are touched, but the main changes are in
dotcom-rendering/src/components/Island.tsx
(and its test file).All other changes should just be adding the
priority
prop to existingIsland
s.#9013