diff --git a/packages/@glimmer/interfaces/lib/template.d.ts b/packages/@glimmer/interfaces/lib/template.d.ts index f052ad2283..d443ec6ed3 100644 --- a/packages/@glimmer/interfaces/lib/template.d.ts +++ b/packages/@glimmer/interfaces/lib/template.d.ts @@ -19,7 +19,6 @@ export interface LayoutWithContext { readonly owner: Owner | null; readonly scope: (() => unknown[]) | undefined | null; readonly isStrictMode: boolean; - readonly asPartial: boolean; } export interface BlockWithContext { @@ -40,7 +39,6 @@ export interface TemplateOk { // internal casts, these are lazily created and cached asLayout(): CompilableProgram; - asPartial(): CompilableProgram; asWrappedLayout(): CompilableProgram; } @@ -95,7 +93,6 @@ export interface NamedBlocks { } export interface ContainingMetadata { - asPartial: boolean; evalSymbols: Option; upvars: Option; scopeValues: unknown[] | null; diff --git a/packages/@glimmer/opcode-compiler/lib/opcode-builder/encoder.ts b/packages/@glimmer/opcode-compiler/lib/opcode-builder/encoder.ts index 42ad1231a6..ec27d96d11 100644 --- a/packages/@glimmer/opcode-compiler/lib/opcode-builder/encoder.ts +++ b/packages/@glimmer/opcode-compiler/lib/opcode-builder/encoder.ts @@ -99,13 +99,9 @@ export function encodeOp( freeVar ]; - if (meta.asPartial === true) { - encoder.push(constants, Op.ResolveMaybeLocal, name); - } else { - let then = op[2]; + let andThen = op[2]; - then(name, meta.moduleName); - } + andThen(name, meta.moduleName); break; diff --git a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/shared.ts b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/shared.ts index 54a25d0ad0..435bdbfbb8 100644 --- a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/shared.ts +++ b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/shared.ts @@ -107,7 +107,6 @@ export function meta(layout: LayoutWithContext): ContainingMetadata { let [, symbols, , upvars] = layout.block; return { - asPartial: layout.asPartial || false, evalSymbols: evalSymbols(layout), upvars: upvars, scopeValues: layout.scope?.() ?? null, diff --git a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/stdlib.ts b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/stdlib.ts index 2be1892a0d..a0a298b04e 100644 --- a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/stdlib.ts +++ b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/stdlib.ts @@ -110,7 +110,6 @@ export function compileStd(context: CompileTimeCompilationContext): StdLib { } const STDLIB_META = { - asPartial: false, evalSymbols: null, upvars: null, moduleName: 'stdlib', diff --git a/packages/@glimmer/opcode-compiler/lib/template.ts b/packages/@glimmer/opcode-compiler/lib/template.ts index 1ff52b47f6..ac74df0119 100644 --- a/packages/@glimmer/opcode-compiler/lib/template.ts +++ b/packages/@glimmer/opcode-compiler/lib/template.ts @@ -104,10 +104,9 @@ class TemplateImpl implements TemplateWithIdAndReferrer { readonly result = 'ok'; private layout: Option = null; - private partial: Option = null; private wrappedLayout: Option = null; - constructor(private parsedLayout: Omit) {} + constructor(private parsedLayout: LayoutWithContext) {} get moduleName() { return this.parsedLayout.moduleName; @@ -128,30 +127,13 @@ class TemplateImpl implements TemplateWithIdAndReferrer { asLayout(): CompilableProgram { if (this.layout) return this.layout; - return (this.layout = compilable( - assign({}, this.parsedLayout, { - asPartial: false, - }), - this.moduleName - )); - } - - asPartial(): CompilableProgram { - if (this.partial) return this.partial; - return (this.partial = compilable( - assign({}, this.parsedLayout, { - asPartial: true, - }), - this.moduleName - )); + return (this.layout = compilable(assign({}, this.parsedLayout), this.moduleName)); } asWrappedLayout(): CompilableProgram { if (this.wrappedLayout) return this.wrappedLayout; return (this.wrappedLayout = new WrappedBuilder( - assign({}, this.parsedLayout, { - asPartial: false, - }), + assign({}, this.parsedLayout), this.moduleName )); }