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

refactor: rework the ColorPaletteMoreColors feature #10505

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Jan 9, 2025

The Component Features concept is no longer needed. Features can now be implemented natively in UI5 Web Components by just using JSX and dynamic imports.

Changes:

  • ColorPalette.ts dynamically loads the extra template, only if the showMoreColors property is set. When the module loads, the component is invalidated and will render the extra dialog (but in reality the module is always fetched before people have clicked the "More colors" button so it doesn't degrade user experience)
  • features/ColorPaletteMoreColors.js is not deleted for compatibility, and now serves as a "preload" of the template. Apps no longer need to import this module, but if they do, they can get the extra template bundled along with the component.
  • ColorPalette.ts is made fully declarative - it used to query the shadow DOM for the dialog/color picker, which may not be there yet (if the dynamic import is not fetched yet). Now, it just updates the state and the template is invalidated and updated whenever it's fetched.

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