How to use the @glimmer/reference.DirtyableTag.create function in @glimmer/reference

To help you get started, we’ve selected a few @glimmer/reference examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / components / emberish-curly.ts View on Github external
import { Option, Opaque, ProgramSymbolTable, ComponentCapabilities, ModuleLocator } from '@glimmer/interfaces';
import GlimmerObject from '@glimmer/object';
import { PrimitiveReference, Tag, combine, PathReference, TagWrapper, DirtyableTag } from '@glimmer/reference';
import { EMPTY_ARRAY, assign, Destroyable, expect } from '@glimmer/util';
import { Environment, Arguments, WithDynamicTagName, PreparedArguments, WithDynamicLayout, ElementOperations, Bounds, CapturedNamedArguments, DynamicScope, Invocation } from '@glimmer/runtime';
import { UpdatableReference } from '@glimmer/object-reference';

import { Attrs, createTemplate, AttrsDiff } from '../shared';
import LazyRuntimeResolver from '../modes/lazy/runtime-resolver';
import EagerRuntimeResolver from '../modes/eager/runtime-resolver';
import { TestComponentDefinitionState, TemplateMeta } from '../components';

export class EmberishCurlyComponent extends GlimmerObject {
  public static positionalParams: string[] | string = [];

  public dirtinessTag: TagWrapper = DirtyableTag.create();
  public layout: { name: string, handle: number };
  public name: string;
  public tagName: Option = null;
  public attributeBindings: Option = null;
  public attrs: Attrs;
  public element: Element;
  public bounds: Bounds;
  public parentView: Option = null;
  public args: CapturedNamedArguments;

  static create(args: { attrs: Attrs }): EmberishCurlyComponent {
    return super.create(args) as EmberishCurlyComponent;
  }

  recompute() {
    this.dirtinessTag.inner.dirty();
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / components / emberish-glimmer.ts View on Github external
didUpdateAttrs: number;
  didReceiveAttrs: number;
  willInsertElement: number;
  willUpdate: number;
  willRender: number;
  didInsertElement: number;
  didUpdate: number;
  didRender: number;
}

export interface HookedComponent {
  hooks: ComponentHooks;
}

export class EmberishGlimmerComponent extends GlimmerObject {
  public dirtinessTag: TagWrapper = DirtyableTag.create();
  public attrs!: Attrs;
  public element!: Element;
  public bounds!: Bounds;
  public parentView: Option = null;

  static create(args: { attrs: Attrs }): EmberishGlimmerComponent {
    return super.create(args) as EmberishGlimmerComponent;
  }

  recompute() {
    this.dirtinessTag.inner.dirty();
  }

  didInitAttrs(_options: { attrs: Attrs }) {}
  didUpdateAttrs(_diff: AttrsDiff) {}
  didReceiveAttrs(_diff: AttrsDiff) {}
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / abstract-test-case.ts View on Github external
constructor(value: Object) {
    this.tag = DirtyableTag.create();
    assign(this, value);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / components / basic-curly.ts View on Github external
}

  didUpdateLayout(): void {}
  didUpdate(): void {}

  getDestructor({ component }: BasicCurlyComponentState): Destroyable {
    return {
      destroy() {
        component.destroy();
      },
    };
  }
}

export class BasicCurlyComponent {
  public dirtinessTag: TagWrapper = DirtyableTag.create();

  constructor(public args: BasicCurlyArgs) {}

  recompute() {
    this.dirtinessTag.inner.dirty();
  }

  destroy() {}
}

const BaseBasicCurlyComponent = class extends BasicCurlyComponent {};
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / components / emberish-curly.ts View on Github external
import { PrimitiveReference } from '@glimmer/runtime';
import { TestComponentConstructor } from './types';

export interface EmberishCurlyComponentFactory
  extends TestComponentConstructor {
  fromDynamicScope?: string[];
  positionalParams: Option;
  create(options: { attrs: Attrs; targetObject: any }): EmberishCurlyComponent;
}

let GUID = 1;

export class EmberishCurlyComponent {
  public static positionalParams: string[] | string = [];

  public dirtinessTag: TagWrapper = DirtyableTag.create();
  public layout!: { name: string; handle: number };
  public name!: string;
  public tagName: Option = null;
  public attributeBindings: Option = null;
  public attrs!: Attrs;
  public element!: Element;
  public bounds!: Bounds;
  public parentView: Option = null;
  public args!: CapturedNamedArguments;

  public _guid: string;

  static create(args: { attrs: Attrs }): EmberishCurlyComponent {
    let c = new this();

    for (let key of keys(args)) {
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment.ts View on Github external
this.dirtinessTag.inner.dirty();
  }

  didInitAttrs(_options: { attrs: Attrs }) { }
  didUpdateAttrs(_diff: AttrsDiff) { }
  didReceiveAttrs(_diff: AttrsDiff) { }
  willInsertElement() { }
  willUpdate() { }
  willRender() { }
  didInsertElement() { }
  didUpdate() { }
  didRender() { }
}

export class EmberishGlimmerComponent extends GlimmerObject {
  public dirtinessTag: TagWrapper = DirtyableTag.create();
  public attrs: Attrs;
  public element: Element;
  public bounds: Bounds;
  public parentView: Option = null;

  static create(args: { attrs: Attrs }): EmberishGlimmerComponent {
    return super.create(args) as EmberishGlimmerComponent;
  }

  recompute() {
    this.dirtinessTag.inner.dirty();
  }

  didInitAttrs(_options: { attrs: Attrs }) { }
  didUpdateAttrs(_diff: AttrsDiff) { }
  didReceiveAttrs(_diff: AttrsDiff) { }
github glimmerjs / glimmer-vm / packages / @glimmer / object-model / lib / meta.ts View on Github external
tag(name: PropertyKey): Tag {
    let bookkeeping = this.bookkeeping;
    let tag = bookkeeping[name];

    if (tag === undefined) {
      tag = DirtyableTag.create();
      bookkeeping[name] = tag;
    }

    return tag;
  }