How to use the @glimmer/bundle-compiler.DebugConstants function in @glimmer/bundle-compiler

To help you get started, we’ve selected a few @glimmer/bundle-compiler 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 / integration-tests / lib / modes / aot / delegate.ts View on Github external
function getBundleCompiler(
  registry: AotCompilerRegistry
): { compiler: BundleCompiler; constants: DebugConstants } {
  let delegate: AotCompilerDelegate = new AotCompilerDelegate(registry);
  let constants = new DebugConstants();
  let compiler = new BundleCompiler(delegate, {
    macros: new TestMacros(),
    constants,
  });
  return { constants, compiler };
}
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / bundle-compiler.ts View on Github external
renderTemplate(template: string, context: Dict, element: HTMLElement): RenderResult {
    let macros = new TestMacros();
    let delegate: BundlingDelegate = new BundlingDelegate(this.components, this.modules, this.compileTimeModules, specifier => {
      return compiler.compileSpecifier(specifier);
    });
    let program = new WriteOnlyProgram(new DebugConstants());
    let compiler = new BundleCompiler(delegate, { macros, program });

    let spec = specifierFor('ui/components/main', 'default');
    compiler.add(spec, template);

    let { components, modules, compileTimeModules } = this;
    Object.keys(components).forEach(key => {
      assert(key.indexOf('ui/components') !== -1, `Expected component key to start with ui/components, got ${key}.`);

      let component = components[key];
      let spec = specifierFor(key, 'default');

      let block;
      let symbolTable;

      if (component.type === "Curly" || component.type === "Dynamic") {

@glimmer/bundle-compiler

MIT
Latest version published 3 years ago

Package Health Score

60 / 100
Full package analysis