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

fix: make sure subThemes are taken into account when generating style cache #534

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@lightningjs/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"publishConfig": {
"access": "public"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ export default class StyleManager extends lng.EventEmitter {
this.update();
}

/**
* Clears the style chain cache.
*/
clearStyleChainCache() {
clearStyleChainCache();
}

/**
* Clears the source cache.
*/
Expand Down Expand Up @@ -127,6 +134,7 @@ export default class StyleManager extends lng.EventEmitter {
_generateCacheKey(name) {
const cacheKey = [
name,
this.component._targetSubTheme,
this.component.constructor.__componentName,
this._customStyleHash
]
Expand Down Expand Up @@ -204,7 +212,6 @@ export default class StyleManager extends lng.EventEmitter {
// Style source does not exist so it will need to be generated. We attempt to run this function only when necessary for optimal performance
styleSource = generateComponentStyleSource({
alias: this.component.constructor.aliasStyles,
componentConfig: this.component._componentConfig,
inlineStyle: this.component._componentLevelStyle,
styleChain: getStyleChainMemoized(this.component),
theme: this.component.theme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
if (this._targetSubTheme) {
this._styleManager.clearListeners();
this._styleManager.setupListeners();
this._styleManager.clearStyleChainCache();
this._styleManager.clearStyleCache();
this._styleManager.clearSourceCache();
this._styleManager.update();
Expand Down
Loading