Skip to content

MWPW-170394: Hydratation manager POC #1075

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

Open
wants to merge 1 commit into
base: stage
Choose a base branch
from
Open

Conversation

joaquinrivero
Copy link
Collaborator

Description

This PR introduces a hydration manager to support our partial hydration strategy.

Key updates include:

It extracts minified static content from a <script type="text/html" id="prerendered-code"> tag in the and injects it into the container, ensuring fast initial rendering and SEO compatibility.

Using a MutationObserver, the manager monitors for the interactive block (loaded by verb-widget.js and unity.js) by checking for the data-block-status milo attribute. Once the interactive content signals that it’s loaded, the static, prerendered widget is removed, and the interactive version is appended to the container.

Related Issue

Resolves: MWPW-170394

Test URLs

Copy link

aem-code-sync bot commented Mar 28, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 94 lines in your changes missing coverage. Please review.

Project coverage is 73.86%. Comparing base (a00e31c) to head (4fec2ae).

Files with missing lines Patch % Lines
acrobat/scripts/hydrationManager.js 0.00% 94 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #1075      +/-   ##
==========================================
- Coverage   74.77%   73.86%   -0.92%     
==========================================
  Files          51       52       +1     
  Lines        7627     7721      +94     
==========================================
  Hits         5703     5703              
- Misses       1924     2018      +94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants