@glimmer/runtime
- Version 0.93.1
- Published
- 1.1 MB
- 12 dependencies
- MIT license
Install
npm i @glimmer/runtime
yarn add @glimmer/runtime
pnpm add @glimmer/runtime
Overview
Minimal runtime needed to render Glimmer templates
Index
Variables
Functions
- clear()
- clientBuilder()
- createCapturedArgs()
- curry()
- dynamicAttribute()
- inTransaction()
- invokeHelper()
- isSerializationFirstNode()
- isWhitespace()
- normalizeProperty()
- rehydrationBuilder()
- reifyArgs()
- reifyNamed()
- reifyPositional()
- renderComponent()
- renderMain()
- renderSync()
- resetDebuggerCallback()
- runtimeOptions()
- setDebuggerCallback()
- templateOnlyComponent()
Classes
NewTreeBuilder
- appendComment()
- appendDynamicFragment()
- appendDynamicHTML()
- appendDynamicNode()
- appendDynamicText()
- appendText()
- block()
- closeElement()
- constructing
- cursors
- debug
- debugBlocks()
- didAppendBounds()
- didAppendNode()
- didOpenElement()
- dom
- element
- flushElement()
- forInitialRender()
- hasBlocks
- initialize()
- nextSibling
- openElement()
- operations
- popBlock()
- popElement()
- popRemoteElement()
- pushAppendingBlock()
- pushBlock()
- pushBlockList()
- pushElement()
- pushRemoteElement()
- pushResettableBlock()
- resume()
- setDynamicAttribute()
- setStaticAttribute()
- updateOperations
- willCloseElement()
VM
- args
- associateDestroyable()
- beginCacheGroup()
- bindDynamicScope()
- call()
- capture()
- commitCacheGroup()
- compile()
- constants
- context
- debug
- dynamicScope()
- enter()
- enterItem()
- enterList()
- env
- execute()
- exit()
- exitList()
- fetch()
- fetchValue()
- getOwner()
- getSelf()
- initial()
- load()
- loadValue()
- lowlevel
- next()
- pc
- popDynamicScope()
- popScope()
- popUpdating()
- program
- pushChildScope()
- pushDynamicScope()
- pushRootScope()
- pushScope()
- pushUpdating()
- referenceForSymbol()
- registerItem()
- return()
- scope()
- stack
- trace
- tree()
- updateWith()
Interfaces
Type Aliases
Variables
variable ARGS
const ARGS: Symbol;
variable array
const array: {};
Use the
{{array}}
helper to create an array to pass as an option to your components.```handlebars <MyComponent @people={{array 'Tom Dale' 'Yehuda Katz' this.myOtherPerson}} /> ``` or ```handlebars {{my-component people=(array 'Tom Dale' 'Yehuda Katz' this.myOtherPerson) }} ```
Would result in an object such as:
```js ['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')] ```
Where the 3rd item in the array is bound to updates of the
myOtherPerson
property.array
Parameter options
{Array} Array
Modifiers
@public
variable concat
const concat: {};
Concatenates the given arguments into a string.
Example:
```handlebars {{some-component name=(concat firstName " " lastName)}}
{{! would pass name="<first name value> <last name value>" to the component}} ```
or for angle bracket invocation, you actually don't need concat at all.
```handlebars <SomeComponent @name="{{firstName}} {{lastName}}" /> ```
concat
Modifiers
@public
variable DOMChanges
const DOMChanges: typeof DOMChangesImpl;
variable DOMTreeConstruction
const DOMTreeConstruction: typeof TreeConstruction;
variable EMPTY_ARGS
const EMPTY_ARGS: CapturedArguments;
variable EMPTY_NAMED
const EMPTY_NAMED: CapturedNamedArguments;
variable EMPTY_POSITIONAL
const EMPTY_POSITIONAL: CapturedPositionalArguments;
variable fn
const fn: {};
The
fn
helper allows you to ensure a function that you are passing off to another component, helper, or modifier has access to arguments that are available in the template.For example, if you have an
each
helper looping over a number of items, you may need to pass a function that expects to receive the item as an argument to a component invoked within the loop. Here's how you could use thefn
helper to pass both the function and its arguments together:```app/templates/components/items-listing.hbs {{#each as |item|}} <DisplayItem @item=item @select={{fn this.handleSelected item}} /> {{/each}} ```
```app/components/items-list.js import Component from '@glimmer/component'; import { action } from '@ember/object';
export default class ItemsList extends Component { handleSelected = (item) => { // ...snip... } } ```
In this case the
display-item
component will receive a normal function that it can invoke. When it invokes the function, thehandleSelected
function will receive theitem
and any arguments passed, thanks to thefn
helper.Let's take look at what that means in a couple circumstances:
- When invoked as
this.args.select()
thehandleSelected
function will receive theitem
from the loop as its first and only argument. - When invoked asthis.args.select('foo')
thehandleSelected
function will receive theitem
from the loop as its first argument and the string'foo'
as its second argument.In the example above, we used an arrow function to ensure that
handleSelected
is properly bound to theitems-list
, but let's explore what happens if we left out the arrow function:```app/components/items-list.js import Component from '@glimmer/component';
export default class ItemsList extends Component { handleSelected(item) { // ...snip... } } ```
In this example, when
handleSelected
is invoked inside thedisplay-item
component, it will **not** have access to the component instance. In other words, it will have nothis
context, so please make sure your functions are bound (via an arrow function or other means) before passing intofn
!See also [partial application](https://en.wikipedia.org/wiki/Partial_application).
fn
Modifiers
@public
variable get
const get: {};
Dynamically look up a property on an object. The second argument to
{{get}}
should have a string value, although it can be bound.For example, these two usages are equivalent:
```app/components/developer-detail.js import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking';
export default class extends Component { developer = { name: "Sandi Metz", language: "Ruby" } } ```
```handlebars {{this.developer.name}} {{get this.developer "name"}} ```
If there were several facts about a person, the
{{get}}
helper can dynamically pick one:```app/templates/application.hbs <DeveloperDetail @factName="language" /> ```
```handlebars {{get this.developer @factName}} ```
For a more complex example, this template would allow the user to switch between showing the user's height and weight with a click:
```app/components/developer-detail.js import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking';
export default class extends Component { developer = { name: "Sandi Metz", language: "Ruby" }
currentFact = 'name'
showFact = (fact) => { this.currentFact = fact; } } ```
```app/components/developer-detail.js {{get this.developer this.currentFact}}
<button {{on 'click' (fn this.showFact "name")}}>Show name <button {{on 'click' (fn this.showFact "language")}}>Show language ```
The
{{get}}
helper can also respect mutable values itself. For example:```app/components/developer-detail.js <Input @value={{mut (get this.person this.currentFact)}} />
<button {{on 'click' (fn this.showFact "name")}}>Show name <button {{on 'click' (fn this.showFact "language")}}>Show language ```
Would allow the user to swap what fact is being displayed, and also edit that fact via a two-way mutable binding.
get
Modifiers
@public
variable hash
const hash: {};
Use the
{{hash}}
helper to create a hash to pass as an option to your components. This is specially useful for contextual components where you can just yield a hash:```handlebars {{yield (hash name='Sarah' title=office )}} ```
Would result in an object such as:
```js { name: 'Sarah', title: this.get('office') } ```
Where the
title
is bound to updates of theoffice
property.Note that the hash is an empty object with no prototype chain, therefore common methods like
toString
are not available in the resulting hash. If you need to use such a method, you can use thecall
orapply
approach:```js function toString(obj) { return Object.prototype.toString.apply(obj); } ```
hash
Parameter options
{Object} Hash
Modifiers
@public
variable INNER
const INNER: Symbol;
variable on
const on: {};
variable OWNER
const OWNER: Symbol;
variable RESOLVED
const RESOLVED: Symbol;
variable SERIALIZATION_FIRST_NODE_STRING
const SERIALIZATION_FIRST_NODE_STRING: string;
variable TEMPLATE_ONLY_COMPONENT_MANAGER
const TEMPLATE_ONLY_COMPONENT_MANAGER: TemplateOnlyComponentManager;
variable TRANSACTION
const TRANSACTION: TransactionSymbol;
variable TYPE
const TYPE: Symbol;
Functions
function clear
clear: (bounds: Bounds) => Nullable<SimpleNode>;
function clientBuilder
clientBuilder: (env: Environment, cursor: CursorImpl) => TreeBuilder;
function createCapturedArgs
createCapturedArgs: ( named: Dict<Reference>, positional: Reference[]) => CapturedArguments;
function curry
curry: <T extends CurriedType>( type: T, spec: object | string | CurriedValue<T>, owner: Owner, args: CapturedArguments | null, resolved?: boolean) => CurriedValue<T>;
function dynamicAttribute
dynamicAttribute: ( element: SimpleElement, attr: string, namespace: Nullable<AttrNamespace>, isTrusting?: boolean) => DynamicAttribute;
function inTransaction
inTransaction: (env: Environment, block: () => void) => void;
function invokeHelper
invokeHelper: ( context: object, definition: object, computeArgs?: (context: object) => Arguments) => Cache<unknown>;
function isSerializationFirstNode
isSerializationFirstNode: (node: SimpleNode) => boolean;
function isWhitespace
isWhitespace: (string: string) => boolean;
function normalizeProperty
normalizeProperty: ( element: SimpleElement, slotName: string) => { normalized: any; type: any };
function rehydrationBuilder
rehydrationBuilder: (env: Environment, cursor: CursorImpl) => TreeBuilder;
function reifyArgs
reifyArgs: (args: CapturedArguments) => { named: Dict<unknown>; positional: unknown[];};
function reifyNamed
reifyNamed: (named: CapturedNamedArguments) => Dict<unknown>;
function reifyPositional
reifyPositional: (positional: CapturedPositionalArguments) => unknown[];
function renderComponent
renderComponent: ( context: EvaluationContext, tree: TreeBuilder, owner: Owner, definition: ComponentDefinitionState, args?: Record<string, unknown>, dynamicScope?: DynamicScope) => TemplateIterator;
function renderMain
renderMain: ( context: EvaluationContext, owner: Owner, self: Reference, tree: TreeBuilder, layout: CompilableProgram, dynamicScope?: DynamicScope) => TemplateIterator;
function renderSync
renderSync: (env: Environment, iterator: TemplateIterator) => RenderResult;
function resetDebuggerCallback
resetDebuggerCallback: () => void;
function runtimeOptions
runtimeOptions: ( options: EnvironmentOptions, delegate: EnvironmentDelegate, artifacts: RuntimeArtifacts, resolver: Nullable<ClassicResolver>) => RuntimeOptions;
function setDebuggerCallback
setDebuggerCallback: (cb: DebugCallback) => void;
function templateOnlyComponent
templateOnlyComponent: ( moduleName?: string, name?: string) => TemplateOnlyComponentDefinition;
This utility function is used to declare a given component has no backing class. When the rendering engine detects this it is able to perform a number of optimizations. Templates that are associated with
templateOnly()
will be rendered _as is_ without adding a wrapping<div>
(or any of the other element customization behaviors of [@ember/component](/ember/release/classes/Component)). Specifically, this means that the template will be rendered as "outer HTML".In general, this method will be used by build time tooling and would not be directly written in an application. However, at times it may be useful to use directly to leverage the "outer HTML" semantics mentioned above. For example, if an addon would like to use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the
template-only-glimmer-components
optional feature.Parameter moduleName
the module name that the template only component represents, this will be used for debugging purposes EMBER_GLIMMER_SET_COMPONENT_TEMPLATE
Example 1
```js import { templateOnlyComponent } from '@glimmer/runtime';
export default templateOnlyComponent(); ```
templateOnly
Modifiers
@public
Classes
class ConcreteBounds
class ConcreteBounds implements Bounds {}
constructor
constructor(parentNode: SimpleElement, first: SimpleNode, last: SimpleNode);
property parentNode
parentNode: SimpleElement;
method firstNode
firstNode: () => SimpleNode;
method lastNode
lastNode: () => SimpleNode;
method parentElement
parentElement: () => SimpleElement;
class CurriedValue
class CurriedValue<T extends CurriedType = CurriedType> {}
property [ARGS]
[ARGS]: any;
property [INNER]
[INNER]: string | object | CurriedValue<T>;
property [OWNER]
[OWNER]: Owner;
property [RESOLVED]
[RESOLVED]: boolean;
property [TYPE]
[TYPE]: CurriedType;
class CursorImpl
class CursorImpl implements Cursor {}
constructor
constructor(element: SimpleElement, nextSibling: Nullable<SimpleNode>);
property element
element: SimpleElement;
property nextSibling
nextSibling: Nullable<SimpleNode>;
class DynamicAttribute
abstract class DynamicAttribute implements AttributeOperation {}
constructor
constructor(attribute: AttributeCursor);
property attribute
attribute: AttributeCursor;
method set
abstract set: (dom: TreeBuilder, value: unknown, env: Environment) => void;
method update
abstract update: (value: unknown, env: Environment) => void;
class DynamicScopeImpl
class DynamicScopeImpl implements DynamicScope {}
constructor
constructor(bucket?: Dict<Reference>);
method child
child: () => DynamicScopeImpl;
method get
get: (key: string) => Reference;
method set
set: (key: string, reference: Reference) => Reference;
class EnvironmentImpl
class EnvironmentImpl implements Environment {}
constructor
constructor(options: EnvironmentOptions, delegate: EnvironmentDelegate);
property [TRANSACTION]
[TRANSACTION]: Nullable<TransactionImpl>;
property appendOperations
protected appendOperations: GlimmerTreeConstruction;
property debugRenderTree
debugRenderTree: DebugRenderTreeImpl<object>;
property isArgumentCaptureError
isArgumentCaptureError: (error: any) => boolean;
property isInteractive
isInteractive: boolean;
property updateOperations
protected updateOperations?: any;
method begin
begin: () => void;
method commit
commit: () => void;
method didCreate
didCreate: (component: ComponentInstanceWithCreate) => void;
method didUpdate
didUpdate: (component: ComponentInstanceWithCreate) => void;
method getAppendOperations
getAppendOperations: () => GlimmerTreeConstruction;
method getDOM
getDOM: () => GlimmerTreeChanges;
method scheduleInstallModifier
scheduleInstallModifier: (modifier: ModifierInstance) => void;
method scheduleUpdateModifier
scheduleUpdateModifier: (modifier: ModifierInstance) => void;
class IDOMChanges
class DOMChangesImpl extends DOMOperations implements GlimmerTreeChanges {}
constructor
constructor(document: SimpleDocument);
property document
protected document: SimpleDocument;
property namespace
protected namespace: Nullable<string>;
method insertAfter
insertAfter: ( element: SimpleElement, node: SimpleNode, reference: SimpleNode) => void;
method removeAttribute
removeAttribute: (element: SimpleElement, name: string) => void;
method setAttribute
setAttribute: (element: SimpleElement, name: string, value: string) => void;
class LowLevelVM
class LowLevelVM {}
constructor
constructor( stack: VmStack, context: EvaluationContext, externs: Externs, registers: LowLevelRegisters);
property context
readonly context: EvaluationContext;
property currentOpSize
currentOpSize: number;
property externs
externs: Externs;
property registers
readonly registers: LowLevelRegisters;
property stack
stack: VmStack;
method call
call: (handle: number) => void;
method evaluateInner
evaluateInner: (opcode: RuntimeOp, vm: VM) => void;
method evaluateMachine
evaluateMachine: (opcode: RuntimeOp, vm: VM) => void;
method evaluateOuter
evaluateOuter: (opcode: RuntimeOp, vm: VM) => void;
method evaluateSyscall
evaluateSyscall: (opcode: RuntimeOp, vm: VM) => void;
method fetchRegister
fetchRegister: (register: MachineRegister) => number;
method goto
goto: (offset: number) => void;
method loadRegister
loadRegister: (register: MachineRegister, value: number) => void;
method nextStatement
nextStatement: () => Nullable<RuntimeOp>;
method popFrame
popFrame: () => void;
method popSmallFrame
popSmallFrame: () => void;
method pushFrame
pushFrame: () => void;
method pushSmallFrame
pushSmallFrame: () => void;
method return
return: () => void;
method returnTo
returnTo: (offset: number) => void;
method setPc
setPc: (pc: number) => void;
method target
target: (offset: number) => number;
class NewTreeBuilder
class NewTreeBuilder implements TreeBuilder {}
constructor
constructor( env: Environment, parentNode: SimpleElement, nextSibling: Nullable<SimpleNode>);
property constructing
constructing: Nullable<SimpleElement>;
property cursors
readonly cursors: Stack<Cursor>;
property debug
debug?: () => { blocks: AppendingBlock[]; constructing: Nullable<SimpleElement>; cursors: Cursor[];};
property dom
dom: GlimmerTreeConstruction;
property element
readonly element: SimpleElement;
property hasBlocks
readonly hasBlocks: boolean;
property nextSibling
readonly nextSibling: Nullable<SimpleNode>;
property operations
operations: Nullable<ElementOperations>;
property updateOperations
updateOperations: GlimmerTreeChanges;
method appendComment
appendComment: (string: string) => SimpleComment;
method appendDynamicFragment
appendDynamicFragment: (value: SimpleDocumentFragment) => void;
method appendDynamicHTML
appendDynamicHTML: (value: string) => void;
method appendDynamicNode
appendDynamicNode: (value: SimpleNode) => void;
method appendDynamicText
appendDynamicText: (value: string) => SimpleText;
method appendText
appendText: (string: string) => SimpleText;
method block
protected block: () => AppendingBlock;
method closeElement
closeElement: () => Nullable<ModifierInstance[]>;
method debugBlocks
debugBlocks: () => AppendingBlock[];
method didAppendBounds
didAppendBounds: (bounds: Bounds) => Bounds;
method didAppendNode
didAppendNode: <T extends SimpleNode>(node: T) => T;
method didOpenElement
didOpenElement: (element: SimpleElement) => SimpleElement;
method flushElement
flushElement: (modifiers: Nullable<ModifierInstance[]>) => void;
method forInitialRender
static forInitialRender: ( env: Environment, cursor: CursorImpl) => NewTreeBuilder;
method initialize
protected initialize: () => this;
method openElement
openElement: (tag: string) => SimpleElement;
method popBlock
popBlock: () => AppendingBlock;
method popElement
popElement: () => void;
method popRemoteElement
popRemoteElement: () => RemoteBlock;
method pushAppendingBlock
pushAppendingBlock: () => AppendingBlock;
method pushBlock
protected pushBlock: <T extends AppendingBlock>( block: T, isRemote?: boolean) => T;
method pushBlockList
pushBlockList: (list: AppendingBlock[]) => AppendingBlockList;
method pushElement
protected pushElement: ( element: SimpleElement, nextSibling?: Maybe<SimpleNode>) => void;
method pushRemoteElement
pushRemoteElement: ( element: SimpleElement, guid: string, insertBefore: Maybe<SimpleNode>) => RemoteBlock;
method pushResettableBlock
pushResettableBlock: () => ResettableBlockImpl;
method resume
static resume: (env: Environment, block: ResettableBlock) => NewTreeBuilder;
method setDynamicAttribute
setDynamicAttribute: ( name: string, value: unknown, trusting: boolean, namespace: Nullable<AttrNamespace>) => DynamicAttribute;
method setStaticAttribute
setStaticAttribute: ( name: string, value: string, namespace: Nullable<AttrNamespace>) => void;
method willCloseElement
willCloseElement: () => void;
class RehydrateTree
class RehydrateTree extends NewTreeBuilder implements TreeBuilder {}
constructor
constructor( env: Environment, parentNode: SimpleElement, nextSibling: Nullable<SimpleNode>);
property blockDepth
blockDepth: number;
property candidate
candidate: Nullable<SimpleNode>;
property currentCursor
readonly currentCursor: Nullable<RehydratingCursor>;
property cursors
cursors: Stack<RehydratingCursor>;
property startingBlockOffset
startingBlockOffset: number;
method didAppendBounds
didAppendBounds: (bounds: Bounds) => Bounds;
method disableRehydration
disableRehydration: (nextSibling: Nullable<SimpleNode>) => void;
method enableRehydration
enableRehydration: (candidate: Nullable<SimpleNode>) => void;
method getMarker
getMarker: (element: HTMLElement, guid: string) => Nullable<SimpleNode>;
method pushElement
pushElement: ( this: | RehydrateTree | (NewTreeBuilder & Partial<Pick<RehydrateTree, 'blockDepth' | 'candidate'>>), element: SimpleElement, nextSibling?: Maybe<SimpleNode>) => void;
method remove
protected remove: (node: SimpleNode) => Nullable<SimpleNode>;
method willCloseElement
willCloseElement: () => void;
class RemoteBlock
class RemoteBlock extends AppendingBlockImpl {}
constructor
constructor(parent: SimpleElement);
class ResettableBlockImpl
class ResettableBlockImpl extends AppendingBlockImpl implements ResettableBlock {}
constructor
constructor(parent: SimpleElement);
method reset
reset: () => Nullable<SimpleNode>;
class ScopeImpl
class ScopeImpl implements Scope {}
constructor
constructor(owner: Owner, slots: ScopeSlot[], callerScope: Nullable<Scope>);
property owner
readonly owner: Owner;
method bind
bind: (symbol: number, value: ScopeSlot) => void;
method bindBlock
bindBlock: (symbol: number, value: Nullable<ScopeBlock>) => void;
method bindCallerScope
bindCallerScope: (scope: Nullable<Scope>) => void;
method bindSelf
bindSelf: (self: Reference<unknown>) => void;
method bindSymbol
bindSymbol: (symbol: number, value: Reference<unknown>) => void;
method child
child: () => Scope;
method getBlock
getBlock: (symbol: number) => Nullable<ScopeBlock>;
method getCallerScope
getCallerScope: () => Nullable<Scope>;
method getSelf
getSelf: () => Reference<unknown>;
method getSymbol
getSymbol: (symbol: number) => Reference<unknown>;
method init
init: ({ self }: { self: Reference<unknown> }) => this;
method root
static root: (owner: Owner, { self, size }: ScopeOptions) => Scope;
method sized
static sized: (owner: Owner, size?: number) => Scope;
method snapshot
snapshot: () => ScopeSlot[];
class SimpleDynamicAttribute
class SimpleDynamicAttribute extends DynamicAttribute {}
class TemplateOnlyComponent
class TemplateOnlyComponentDefinition {}
constructor
constructor(moduleName?: string, name?: string);
property moduleName
moduleName: string;
property name
name: string;
method toString
toString: () => string;
class TemplateOnlyComponentManager
class TemplateOnlyComponentManager implements InternalComponentManager {}
method getCapabilities
getCapabilities: () => InternalComponentCapabilities;
method getDebugName
getDebugName: ({ name }: TemplateOnlyComponentDefinition) => string;
method getDestroyable
getDestroyable: () => null;
method getSelf
getSelf: () => Reference;
class UpdatingVM
class UpdatingVM implements IUpdatingVM {}
constructor
constructor( env: Environment, { alwaysRevalidate }: { alwaysRevalidate?: boolean });
property alwaysRevalidate
alwaysRevalidate: boolean;
property dom
dom: GlimmerTreeChanges;
property env
env: Environment;
method execute
execute: (opcodes: UpdatingOpcode[], handler: ExceptionHandler) => void;
method goto
goto: (index: number) => void;
method throw
throw: () => void;
method try
try: (ops: UpdatingOpcode[], handler: Nullable<ExceptionHandler>) => void;
class VM
class VM {}
constructor
constructor( { scope, dynamicScope, stack, pc }: ClosureState, context: EvaluationContext, tree: TreeBuilder);
property args
readonly args: VMArgumentsImpl;
property constants
readonly constants: ProgramConstants;
property context
readonly context: EvaluationContext;
property debug
readonly debug?: () => DebugVmSnapshot;
property env
readonly env: Environment;
property lowlevel
readonly lowlevel: LowLevelVM;
property pc
readonly pc: number;
property program
readonly program: Program;
property stack
readonly stack: EvaluationStack;
property trace
readonly trace?: () => DebugVmTrace;
method associateDestroyable
associateDestroyable: (child: Destroyable) => void;
## State changes
[-] associate destroyable
child
method beginCacheGroup
beginCacheGroup: (name?: string) => void;
## Opcodes
- Append:
BeginComponentTransaction
## State Changes
[ ] create
guard
(JumpIfNotModifiedOpcode
) [ ] createtracker
(BeginTrackFrameOpcode
) [!] push Updating Stack <-guard
[!] push Updating Stack <-tracker
[!] push Cache Stack <-guard
[!] push Tracking Stack
method bindDynamicScope
bindDynamicScope: (names: string[]) => void;
## Opcodes
- Append:
BindDynamicScope
## State changes:
[!] pop Dynamic Scope Stack
names.length
times
method call
call: (handle: number | null) => void;
method capture
capture: (args: number, pc?: number) => Closure;
method commitCacheGroup
commitCacheGroup: () => void;
## Opcodes
- Append:
CommitComponentTransaction
## State Changes
Create a new
EndTrackFrameOpcode
(end
)[!] pop CacheStack ->
guard
[!] pop Tracking Stack ->tag
[ ] createend
(EndTrackFrameOpcode
) withguard
[-] consumetag
method compile
compile: (block: CompilableTemplate) => number;
method dynamicScope
dynamicScope: () => DynamicScope;
Get current Dynamic Scope
method enter
enter: (args: number) => void;
## Opcodes
- Append:
Enter
## State changes
[!] push Element Stack as
block
[ ] createtry
(TryOpcode
) withblock
, capturingargs
from the Eval StackDid Enter (
try
): [-] associate destroyabletry
[!] push Destroyable Stack <-try
[!] push Updating List <-try
[!] push Updating Stack <-try.children
method enterItem
enterItem: ({ key, value, memo }: OpaqueIterationItem) => ListItemOpcode;
## Opcodes
- Append:
Iterate
- Update:ListBlock
## State changes
Create a new ref for the iterator item (
value
). Create a new ref for the iterator key (key
).[ ] create
valueRef
(Reference
) fromvalue
[ ] createkeyRef
(Reference
) fromkey
[!] push Eval Stack <-valueRef
[!] push Eval Stack <-keyRef
[!] push Element Stack <-UpdatableBlock
asblock
[ ] captureclosure
with *2* items from the Eval Stack [ ] createiteration
(ListItemOpcode
) withclosure
,block
,key
,keyRef
andvalueRef
Did Enter (
iteration
): [-] associate destroyableiteration
[!] push Destroyable Stack <-iteration
[!] push Updating List <-iteration
[!] push Updating Stack <-iteration.children
method enterList
enterList: (iterableRef: Reference<OpaqueIterator>, offset: number) => void;
## Opcodes
- Append:
EnterList
## State changes
[ ] capture
closure
with *0* items from the Eval Stack, and$pc
fromoffset
[ ] createupdating
(emptyArray
) [!] push Element Stack <-list
(BlockList
) withupdating
[ ] createlist
(ListBlockOpcode
) withclosure
,list
,updating
anditerableRef
[!] push List Stack <-list
Did Enter (
list
): [-] associate destroyablelist
[!] push Destroyable Stack <-list
[!] push Updating List <-list
[!] push Updating Stack <-list.children
method execute
execute: (initialize?: (vm: this) => void) => RenderResult;
method exit
exit: () => void;
## Opcodes
- Append:
Exit
- Append:ExitList
## State changes
[!] pop Destroyable Stack [!] pop Element Stack [!] pop Updating Stack
method exitList
exitList: () => void;
## Opcodes
- Append:
ExitList
## State changes
Pop List: [!] pop Destroyable Stack [!] pop Element Stack [!] pop Updating Stack
[!] pop List Stack
method fetch
fetch: (register: SyscallRegister) => void;
Fetch a value from a syscall register onto the stack.
## Opcodes
- Append:
Fetch
## State changes
[!] push Eval Stack <- $register
method fetchValue
fetchValue: { (register: MachineRegister): number; <T>(register: Register): T };
Fetch a value from a register (machine or syscall).
## State changes
[ ] get $register
method getOwner
getOwner: () => Owner;
method getSelf
getSelf: () => Reference<any>;
method initial
static initial: (context: EvaluationContext, options: InitialVmState) => VM;
method load
load: (register: SyscallRegister) => void;
Load a value from the stack into a syscall register.
## Opcodes
- Append:
Load
## State changes
[!] pop Eval Stack ->
value
[$] $register <-value
method loadValue
loadValue: <T>(register: SyscallRegister, value: T) => void;
Load a value into a syscall register.
## State changes
[$] $register <-
value
method next
next: () => RichIteratorResult<null, RenderResult>;
method popDynamicScope
popDynamicScope: () => void;
method popScope
popScope: () => void;
## Opcodes
- Append:
PopScope
## State changes
[!] pop Scope Stack
method popUpdating
popUpdating: () => UpdatingOpcode[];
## State changes
[!] pop Updating Stack
method pushChildScope
pushChildScope: () => void;
## Opcodes
- Append:
ChildScope
## State changes
[!] push Scope Stack <-
child
of current Scope
method pushDynamicScope
pushDynamicScope: () => DynamicScope;
## Opcodes
- Append:
PushDynamicScope
## State changes:
[!] push Dynamic Scope Stack <- child of current Dynamic Scope
method pushRootScope
pushRootScope: (size: number, owner: Owner) => Scope;
## Opcodes
- Append:
RootScope
- Append:VirtualRootScope
## State changes
[!] push Scope Stack
method pushScope
pushScope: (scope: Scope) => void;
## Opcodes
- Append:
Yield
## State changes
[!] push Scope Stack <-
scope
method pushUpdating
pushUpdating: (list?: UpdatingOpcode[]) => void;
## State changes
- [!] push Updating Stack
method referenceForSymbol
referenceForSymbol: (symbol: number) => Reference;
method registerItem
registerItem: (opcode: ListItemOpcode) => void;
method return
return: () => void;
method scope
scope: () => Scope;
Get current Scope
method tree
tree: () => TreeBuilder;
Get Tree Builder
method updateWith
updateWith: (opcode: UpdatingOpcode) => void;
## State changes
[!] push Updating List
Interfaces
interface EnvironmentDelegate
interface EnvironmentDelegate {}
property enableDebugTooling
enableDebugTooling: boolean;
Used to enable debug tooling
property isInteractive
isInteractive: boolean;
Used to determine the the environment is interactive (e.g. SSR is not interactive). Interactive environments schedule modifiers, among other things.
property onTransactionCommit
onTransactionCommit: () => void;
Callback to be called when an environment transaction commits
interface SafeString
interface SafeString {}
method toHTML
toHTML: () => string;
Type Aliases
type DebugCallback
type DebugCallback = (context: unknown, get: DebugGet) => void;
type DOMTreeConstruction
type DOMTreeConstruction = TreeConstruction;
type IteratorResult
type IteratorResult<T> = RichIteratorResult<null, T>;
Package Files (1)
Dependencies (12)
Dev Dependencies (11)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@glimmer/runtime
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@glimmer/runtime)
- HTML<a href="https://www.jsdocs.io/package/@glimmer/runtime"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 7298 ms. - Missing or incorrect documentation? Open an issue for this package.