How to use the @glimmer/opcode-compiler.WrappedBuilder function in @glimmer/opcode-compiler

To help you get started, we’ve selected a few @glimmer/opcode-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 / test-helpers / lib / environment.ts View on Github external
return resolver.compileTemplate(specifier, (source, options) => {
      let template = createTemplate(source);
      return new WrappedBuilder({ ...options, asPartial: false }, template, CURLY_CAPABILITIES);
    });
  }
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment.ts View on Github external
return resolver.compileTemplate(specifier, (source, options) => {
      let template = createTemplate(source, {});
      let compileOptions = { ...options, asPartial: false };
      return new WrappedBuilder(compileOptions, template, capabilities);
    });
  }
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / components / tagless.ts View on Github external
return resolver.compileTemplate(handle, name, (source, options) => {
      let template = createTemplate(source, {});
      let compileOptions = { ...options, asPartial: false, referer: null };
      let builder = new WrappedBuilder(compileOptions, template, capabilities);

      return {
        handle: builder.compile(),
        symbolTable: builder.symbolTable
      };
    });
  }
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / modes / aot / delegate.ts View on Github external
assert(
        key.indexOf('ui/components') !== -1,
        `Expected component key to start with ui/components, got ${key}.`
      );

      let { state, manager } = registry.components[key];

      let locator = locatorFor({ module: key, name: 'default' });

      let block;
      let symbolTable;

      if (state.type === 'Curly' || state.type === 'Dynamic') {
        let block = bundleCompiler.preprocess(locator, state.template!);
        let parsedLayout = { block, referrer: locator, asPartial: false };
        let wrapped = new WrappedBuilder(parsedLayout);
        bundleCompiler.addCompilableTemplate(normalizeLocator(locator), wrapped);

        compileTimeModules.register(key, 'other', {
          default: wrapped.symbolTable,
        });

        symbolTable = wrapped.symbolTable;

        this.symbolTables.set(locator, symbolTable);
      } else {
        block = bundleCompiler.addTemplateSource(
          locator,
          expect(state.template, 'expected component definition state to have template')
        );
        symbolTable = {
          hasEval: block.hasEval,
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / bundle-compiler.ts View on Github external
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") {
        let block = compiler.preprocess(spec, component.template);
        let options = compiler.compileOptions(spec);
        let parsedLayout = { block, referrer: spec };
        let wrapped = new WrappedBuilder(options, parsedLayout, EMBERISH_CURLY_CAPABILITIES);
        compiler.addCustom(spec, wrapped);

        compileTimeModules.register(key, 'other', {
          default: wrapped.symbolTable
        });

        symbolTable = wrapped.symbolTable;
      } else {
        block = compiler.add(spec, component.template);

        symbolTable = {
          hasEval: block.hasEval,
          symbols: block.symbols,
          referrer: key,
        };