ember-cli / ember-cli/ember-cli-htmlbars

Colocation babel plugin drops class decorators

未关闭
#442 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
77
派生
65
PR 合并指标
30 天内没有已合并 PR

描述

With an input like

```js
import hbs from 'ember-cli-htmlbars-inline-precompile';
const __COLOCATED_TEMPLATE__ = hbs`{{yield}}`;
export default @dec class {}
```

The class decorator `@dec` gets dropped:

```js
import hbs from 'ember-cli-htmlbars-inline-precompile';
const __COLOCATED_TEMPLATE__ = hbs`{{yield}}`;
export default Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, class {});
```

See example https://astexplorer.net/#/gist/4fb9360091ca6422ca0f9e4ee8ef9505/90046a397d94a8ccf8e97c17fd4f2d0cb867a129

I think all that is required to fix is to pass `defaultExportDeclaration.decorators` as the fourth argument to `t.classExpression()`.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with the colocation Babel transform that handles the default export, using the provided AST Explorer example to reproduce the dropped class decorator. Preserve the decorator in the transformed class expression and verify that the generated output retains @dec.

由索引模型根据 Issue 内容生成。

评估

技术栈
babel, javascript
领域
build-system, tooling
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。