Repository navigation
fix: register all themes in the web component bundles - #417
Merged
Merged
Conversation
## What changed - `mfp-wc-dashboard.js` now imports `@ui5/webcomponents/dist/generated/json-imports/Themes.js`, so every theme UI5 ships is registered for `@ui5/webcomponents`, as it already is for `@ui5/webcomponents-theming`. - New e2e spec `themes.e2e.ts` switches the OpenUI5 theme to `sap_horizon_dark`, `sap_horizon_hcb` and `sap_horizon_hcw`, waits for the theme to apply, opens edit mode and the Edit Cards dialog, and fails on any "not registered for package" console error. ## Why Only the default `sap_horizon` was registered for `@ui5/webcomponents`. In any other theme the console showed `Theme [sap_horizon_dark] not registered for package [@ui5/webcomponents]`, and the "Edit Home" and action buttons and the Edit Cards dialog were not themed. The theme-loader registry is module-local in the bundle, so consumers cannot register the themes themselves. ## Details - `@ui5/webcomponents-fiori` is not imported: the dashboard bundle contains no fiori components, so it never registers that package. - The full `@ui5/webcomponents/dist/Assets.js` is not used: it also inlines all i18n and CLDR data and grows the bundle to 16.3 MB. - Bundle size: 1,819,159 B → 2,720,920 B raw (+49.6%), 358,768 B → 476,595 B gzip (+32.8%). On-behalf-of: @SAP grzegorz.krajniak@sap.com Signed-off-by: gkrajniak <gkrajniak@gmail.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Sobyt483
approved these changes
Nov 18, 2026
## What changed `mfp-webcomponents.js` now imports the theme registrations for `@ui5/webcomponents-theming`, `@ui5/webcomponents` and `@ui5/webcomponents-fiori`, like `mfp-wc-dashboard.js` does. ## Why A page that loads both bundles runs two UI5 Web Components runtimes that share the theme setting and the `data-ui5-theme-properties` stylesheet. `mfp-webcomponents.js` registered no themes, so on the first switch to `sap_horizon_dark` it fell back to `sap_horizon`, wrote the light values into the shared stylesheet tagged as `sap_horizon_dark`, and the dashboard runtime then skipped its own update. The cards stayed light until the theme was switched a second time. ## Details - `@ui5/webcomponents-fiori` is included here because this bundle contains fiori components (for example the illustrated message). - Bundle size: 4,090,636 B → 5,934,115 B raw (+45.1%), 1,118,632 B → 1,343,766 B gzip (+20.1%). On-behalf-of: @SAP grzegorz.krajniak@sap.com Signed-off-by: gkrajniak <gkrajniak@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
mfp-wc-dashboard.jsnow imports@ui5/webcomponents/dist/generated/json-imports/Themes.js, so every theme UI5 ships is registered for@ui5/webcomponents, as it already is for@ui5/webcomponents-theming.mfp-webcomponents.jsnow imports the theme registrations for@ui5/webcomponents-theming,@ui5/webcomponentsand@ui5/webcomponents-fiori.themes.e2e.tsswitches the OpenUI5 theme tosap_horizon_dark,sap_horizon_hcbandsap_horizon_hcw, waits for the theme to apply, opens edit mode and the Edit Cards dialog, and fails on any "not registered for package" console error.Why
sap_horizonwas registered for@ui5/webcomponentsin the dashboard bundle. In any other theme the console showedTheme [sap_horizon_dark] not registered for package [@ui5/webcomponents], and the "Edit Home" and action buttons and the Edit Cards dialog were not themed. The theme-loader registry is module-local in the bundle, so consumers cannot register the themes themselves.data-ui5-theme-propertiesstylesheet.mfp-webcomponents.jsregistered no themes, so on the first switch tosap_horizon_darkit fell back tosap_horizon, wrote the light values into the shared stylesheet tagged assap_horizon_dark, and the dashboard runtime then skipped its own update. The cards stayed light until the theme was switched a second time.Details
@ui5/webcomponents-fiorithemes: it contains no fiori components.mfp-webcomponents.jsdoes, because it contains fiori components (for example the illustrated message).@ui5/webcomponents/dist/Assets.jsis not used: it also inlines all i18n and CLDR data and grows the dashboard bundle to 16.3 MB.Bundle size
mfp-wc-dashboard.jsmfp-webcomponents.jsCloses #416