Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Implement different hydration techniques #12

@luisherranz

Description

@luisherranz

This one should be pretty straightforward.

We could use a data-gutenberg-hydrate="technique" with values load, idle and view for now.

Something like:

const technique = this.getAttribute("data-gutenberg-hydrate");

const hydrate = () => {...};

switch (technique) {
  case "idle":
    requestIdleCallback(hydrate)
    break;
  case "view":
    onInteresect(this, hydrate)
    break;
  default:
    hydrate();
}

For reference, Astro's code is here: https://github.com/withastro/astro/tree/main/packages/astro/src/runtime/client.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions