Skip to content
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: improve fresh async render to render after/during hydration #829

Closed
igorbrasileiro opened this issue Sep 10, 2024 · 2 comments · Fixed by #831
Closed

feat: improve fresh async render to render after/during hydration #829

igorbrasileiro opened this issue Sep 10, 2024 · 2 comments · Fixed by #831
Labels
enhancement New feature or request triage

Comments

@igorbrasileiro
Copy link
Contributor

Describe the feature request

Improve the user experience, and core web vitals metrics(FCP, LCP), rendering the async render section immediately after/during the fresh hydration.

Current behavior

Today the fresh LoadingFallback fetches the async rendered section in two scenarios:

  1. when readyState === complete;
  2. otherwise, when the event load is fired

The problem happens in the second case, because, sometimes, the page takes too long to trigger the load event due to third-party scripts.

Expected behavior

Render the async render section immediately after/during the fresh hydration

@igorbrasileiro igorbrasileiro added the enhancement New feature or request label Sep 10, 2024
@igorbrasileiro
Copy link
Contributor Author

igorbrasileiro commented Sep 10, 2024

A proposal: add a data-attribute (data-partial-trigger or data-async-render-trigger) to the fresh binding LoadingFallback button that triggers the partial.

By doing this, an island in the userland can add a query for these button triggers and click on them.

@igorbrasileiro
Copy link
Contributor Author

I've changed the proposal to a better approach that switches the current way to trigger the fresh partial, which uses a script with a 'load' event listener, to an island that triggers the partial. Islands are better because it always runst before the load event, delivering a better UX for those whos are navigating on those sites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant