Skip to content

Adaptive site: hydrate islands according to their priority - #9021

Merged
sndrs merged 5 commits into
mainfrom
oj/adaptive/prioritised-hydration
Oct 6, 2023
Merged

sndrs merged 5 commits into
mainfrom
oj/adaptive/prioritised-hydration

Conversation

@sndrs

@sndrs sndrs commented Oct 4, 2023 •

Copy link
Copy Markdown
Contributor

depends on #8970...

What does this change?

  • uses the scheduler to hydrate islands according to their priority prop

Why?

  • ensures higher priority island are hydrated before lower priority tasks are run

@sndrs
sndrs force-pushed the oj/adaptive/island-priorities branch from d284108 to dadb0eb Compare October 4, 2023 13:34
Co-authored-by: Max Duval <max.duval@theguardian.com>
@sndrs
sndrs force-pushed the oj/adaptive/prioritised-hydration branch from a01f881 to aa17e15 Compare October 4, 2023 13:36
@github-actions

github-actions Bot commented Oct 4, 2023 •

Copy link
Copy Markdown

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

@mxdvl mxdvl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean!

@sndrs
sndrs marked this pull request as ready for review October 4, 2023 14:39
@sndrs
sndrs requested a review from a team as a code owner October 4, 2023 14:39
@mxdvl mxdvl added 📶 Open Journalism run_chromatic Runs chromatic when label is applied labels Oct 4, 2023
Comment thread dotcom-rendering/src/client/islands/initHydration.ts Outdated
Base automatically changed from oj/adaptive/island-priorities to main October 5, 2023 13:41
* actually apply priority settings to islands!

* dont bind
@mxdvl
mxdvl requested a review from cemms1 October 5, 2023 15:38
Comment thread dotcom-rendering/src/client/islands/initHydration.ts
Comment thread dotcom-rendering/src/client/islands/getPriority.ts Outdated
Comment thread dotcom-rendering/src/client/islands/initHydration.ts
Co-authored-by: Charlotte Emms <43961396+cemms1@users.noreply.github.com>
@mxdvl
mxdvl force-pushed the oj/adaptive/prioritised-hydration branch from 7216921 to f689b80 Compare October 6, 2023 07:39

@mxdvl mxdvl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should keep the whenVisible and onInteraction callback signatures as they were?

Comment thread dotcom-rendering/src/client/islands/onInteraction.ts Outdated
Comment thread dotcom-rendering/src/client/islands/whenVisible.ts Outdated
@sndrs
sndrs merged commit 18446c5 into main Oct 6, 2023
@sndrs
sndrs deleted the oj/adaptive/prioritised-hydration branch October 6, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants