Skip to content

Conversation

@Axelcureno
Copy link
Member

@Axelcureno Axelcureno commented Dec 15, 2025

  • Enhanced variant registration logic with WeakMap for better state management.
  • Cleaned up style application process to ensure proper handling of CSSStyleSheet and fallback to style elements when necessary.
  • Adjusted variable names for consistency and clarity.
  • Avoids duplicate style injection.

Resolves: MWPW-178376

Related Milo PR: adobecom/milo#4730

Test URL: https://main--cc--adobecom.aem.page/creativecloud/plans?maslibs=mwpw-178376

- Enhanced variant registration logic with WeakMap for better state management
- Cleaned up style application process to ensure proper handling of CSSStyleSheet and fallback to style elements when necessary
- Adjusted variable names for consistency and clarity
- Avoids duplicate style injection
@aem-code-sync
Copy link

aem-code-sync bot commented Dec 15, 2025

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

  • Re-sync branch
Commits

The variant-layout and variants.js changes are made to the deprecated
web-components folder which is not used in tests. Tests use Milo's code
instead. Reverting these changes to focus on the Milo dependency update
which includes the new subcollection test.
The latest Milo stage commit (15923a43d15f...) introduced a breaking change
that uses query string parameters (?filter=) instead of hash parameters
(#filter=), causing all MAS tests to fail.

Reverting to the previous working commit (85c42131...) until the Milo
issue is resolved.
@honstar
Copy link
Contributor

honstar commented Dec 16, 2025

@Axelcureno , don't we need the WeakMap changes in web-components/src/variants as well that you did in adobecom/milo#4730? I don't see these in this PR except the package-lock.json change.

Restore the variant layout enhancements that improve stylesheet caching:
- Use constructor.name as style key instead of variant name for better isolation
- Add WeakMap for tracking variant state per card
- Implement stylesheet caching to avoid duplicate CSSStyleSheet instances
- Improve browser compatibility with proper fallback handling
@Axelcureno
Copy link
Member Author

@Axelcureno , don't we need the WeakMap changes in web-components/src/variants as well that you did in adobecom/milo#4730? I don't see these in this PR except the package-lock.json change.

yes, I accidentaly reverted the changes but have now brought them back. Thanks for the heads up @honstar.

Copy link
Contributor

@mirafedas mirafedas left a comment

Choose a reason for hiding this comment

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

Could you please add unit tests for this change?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants