CrowdStrike/ember-velcro

Convert to V2 Addon - at present, this addon is not compatible with fullly static apps

NullVoxPopuli opened this issue · 1 comments

Been playing around with this addon in https://github.com/NullVoxPopuli/baobab-ram/
and it appears that I can't import the velcro modifier with embroider's staticModifiers option set to true.

By converting to a v2 addon, this would be able to happen.

The code I was using was:

import { DefaultTooltip, tooltipFor } from './tooltips';
import velcro from 'ember-velcro/modifiers/velcro';

import type { TOC } from '@ember/component/template-only';
import type { ProcessInfo } from './info';

const idFor = (process: ProcessInfo) => `text#pid-${process.pid}`;

export const Tooltip: TOC<{
  Element: HTMLDivElement;
  Args: {
    process: ProcessInfo;
  }
}> =
  <template>
    {{#if @process}}
      <div ...attributes {{velcro (idFor @process)}}>
        {{#let (tooltipFor @process.name) as |Info|}}

          {{#if Info}}
            <Info />
          {{/if}}

        {{/let}}

        <DefaultTooltip @process={{@process}} />
      </div>
    {{/if}}
  </template>;

this is implemented!