TypeScript no longer requires a custom type -- any uses of Opaque
must be replaced with unknown
.
Moved from @glimmer/runtime
to @glimmer/interfaces
Cursor
DynamicScope
Arguments
->VMArguments
CapturedArguments
VM
TemplateIterator
Moved from @glimmer/util
to @glimmer/interfaces
- Dict
Moved from @glimmer/program
to @glimmer/interfaces
ConstantPool
Old:
let heap = new Heap({
table: serializedHeap.table,
handle: serializedHeap.handle,
buffer: bytecode,
});
let resolver = new BytecodeResolver(app, table, meta, prefix);
let constants = new RuntimeConstants(resolver, pool);
let program = new RuntimeProgram(constants, heap);
New:
let artifacts = {
heap: {
table: serializedHeap.table,
handle: serializedHeap.handle,
buffer: bytecode,
},
constants: pool,
};
let program = hydrateProgram(artifacts);
Old:
import { CompilableProgram } from '@glimmer/opcode-compiler';
let block = JSON.parse(templateBlock);
let compilable = new CompilableProgram(this.compiler.compiler, {
block,
referrer: meta,
asPartial: false,
});
New:
import { compilable } from '@glimmer/opcode-compiler';
let block = JSON.parse(templateBlock);
let compilable = compilable({
block,
referrer: meta,
});
Old:
async function getTemplateIterator(
app: BaseApplication,
buffer: ArrayBuffer,
data: BytecodeData,
env: Environment,
builder: ElementBuilder,
scope: DynamicScope,
self: PathReference<Opaque>
): TemplateIterator {
let heap = new Heap({ buffer, table: heap.table, handle: heap.handle });
let resolver = new BytecodeResolver(app, data);
let constants = new RuntimeConstants(resolver, data.pool);
let program = new RuntimeProgram(constants, heap);
return renderMain(program, env, self, scope, builder, mainEntry);
}
New:
async function getTemplateIterator(
app: BaseApplication,
buffer: ArrayBuffer,
data: BytecodeData,
env: Environment,
builder: ElementBuilder,
self: PathReference<Opaque>
): Promise<TemplateIterator> {
let heap = data.heap;
let program = hydrateProgram({ buffer, table: heap.table, handle: heap.handle });
let resolver = new BytecodeResolver(app, data);
let runtime = {
env,
program,
resolver,
};
return renderAotMain(runtime, self, builder, data.mainEntry);
}
@glimmer/runtime
- Removed
DefaultEnvironment
RuntimeEnvironmentDelegate
->EnvironmentDelegate
iterable
->toIterator
, now returns anIteratorDelegate
- Changed
JitRuntime
creation methods to receive EnvironmentOptions instead adocument
object - Added
willDestroy
component capability. Should generally be avoided, it's just for classic interop.
- Removed
@glimmer/reference
- Removed
MapReference
- Removed
UpdatableReference
, replaced it withUpdatableRootReference
andIterationItemReference
- Most references now require the
env
- Refactor property and root references generally, not a complete rewrite, but large enough that embedders should really pay attention to that code and will have to rewrite some things.
- Major changes
- Removed
@glimmer/validator
- Simplified
meta
implementation in general.tagFor
anddirtyTagFor
have changed decently. - Added assertions to tags to prevent incorrect usage
- Simplified