Skip to content
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
9 changes: 4 additions & 5 deletions glass-easel/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
performanceMeasureStart,
} from './dev_tools'
import { Element } from './element'
import { type ShadowedEvent, type EventListener, type EventListenerOptions } from './event'

Check warning on line 56 in glass-easel/src/component.ts

View workflow job for this annotation

GitHub Actions / Build and Test (lts/*, windows-latest)

'ShadowedEvent' is defined but never used

Check warning on line 56 in glass-easel/src/component.ts

View workflow job for this annotation

GitHub Actions / Build and Test (latest, windows-latest)

'ShadowedEvent' is defined but never used

Check warning on line 56 in glass-easel/src/component.ts

View workflow job for this annotation

GitHub Actions / Build and Test (lts/*, ubuntu-latest)

'ShadowedEvent' is defined but never used

Check warning on line 56 in glass-easel/src/component.ts

View workflow job for this annotation

GitHub Actions / Build and Test (latest, ubuntu-latest)

'ShadowedEvent' is defined but never used
import { type ExternalShadowRoot } from './external_shadow_tree'
import { FuncArr, safeCallback, type GeneralFuncType } from './func_arr'
import {
Expand Down Expand Up @@ -447,8 +447,7 @@
/** @internal */
_$external: boolean
shadowRoot: ShadowRoot | ExternalShadowRoot
/** @internal */
_$tmplInst: TemplateInstance | undefined
templateInstance: TemplateInstance | undefined
/** @internal */
_$relation: Relation | null
/** @internal */
Expand Down Expand Up @@ -677,6 +676,7 @@
// eslint-disable-next-line @typescript-eslint/unbound-method
ShadowRoot.createShadowRoot,
)
comp.templateInstance = tmplInst

// write attr
if (writeExtraInfoToAttr && backendElement) {
Expand Down Expand Up @@ -891,7 +891,6 @@
} else {
tmplInst.initValues(dataGroup.innerData || dataGroup.data)
}
comp._$tmplInst = tmplInst
dataGroup.setUpdateListener((data, combinedChanges) => {
if (ENV.DEV) {
performanceMeasureRenderWaterfall('component.render', 'backend.render', comp, () => {
Expand Down Expand Up @@ -1091,13 +1090,13 @@
* This method throws error if the template engine does not support template update.
*/
applyTemplateUpdates(): void {
if (!this._$tmplInst?.updateTemplate) {
if (!this.templateInstance?.updateTemplate) {
throw new Error(
`The template engine of component "${this.is}" does not support template update`,
)
}
const dataGroup = this._$dataGroup
this._$tmplInst.updateTemplate(
this.templateInstance.updateTemplate(
this._$definition._$detail!.template,
dataGroup.innerData || dataGroup.data,
)
Expand Down
2 changes: 1 addition & 1 deletion glass-easel/src/tmpl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class GlassEaselTemplate implements Template {
}
}

class GlassEaselTemplateInstance implements TemplateInstance {
export class GlassEaselTemplateInstance implements TemplateInstance {
comp: GeneralComponent
shadowRoot: ShadowRoot
procGenWrapper!: ProcGenWrapper
Expand Down
Loading