Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Is there a way to opt out of ember-cli-babel entirely?

オープン
#446 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript

調査の方向性

まず、リンクされている issue 418、444、417、296、447 を読んで、ember-cli-babel の設定に関する既存の制限を理解します。次に、addon がどのように app をビルドし、ここで説明されている Babel 設定を処理しているかを調べます。必要な Ember transforms を維持したまま、transforms の無効化またはカスタマイズがサポートされているかどうかを明らかにできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Related issue: https://github.com/babel/ember-cli-babel/issues/418

just wondering, given the inability to use custom babel plugins, or not transpile class properties, (and a bunch of other bugs (some as old as 2019!), that seems to have been the result of ecosystem complacency in this tool in that it is "good enough", but ultimately does too much (babel-wise)).

Does it even make sense to not use ember-cli-babel?

minimally, this is all that's needed for the style of JS we write:

export default {
 presets: ['@babel/preset-env'],
 plugins: [
   ['@babel/plugin-proposal-decorators', { legacy: true }],
   // ... @ember/debug removal
   // ... @ember/deprecations removal
   // ... ESM to AMD
 ]
};

What I removed from the above:

  • class-properties -- this isn't needed because proposal-decorators doesn't need it, and browsers all natively support class properties. At least for development, removing this could speed up builds
  • ember modules api polyfill -- since ember 3.27, the modules polyfill isn't needed. Less plugins, less faster build.

Eventually, given that I could eventually customize ember-cli-babel, I'd like to experiment with removing the ESM to AMD transform.

I know that addons can provide their own babel plugins / transforms, but, I don't think I'm at a point yet there addons' own configs even matter as I'm just trying to build the app and keep the Router in router.js as a native class with native properties, but today it looks like this:

;define("minimal-babel-demo/router", ["exports", "@ember/routing/router", "minimal-babel-demo/config/environment"], function (_exports, _router, _environment) {
 "use strict";

 Object.defineProperty(_exports, "__esModule", {
   value: true
 });
 _exports.default = void 0;

 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

 class Router extends _router.default {
   constructor(...args) {
     super(...args);

     _defineProperty(this, "location", _environment.default.locationType);

     _defineProperty(this, "rootURL", _environment.default.rootURL);
   }

 }

 _exports.default = Router;
 Router.map(function () {});
});

IF we could use custom bebel configs, then the above could be minimally,

;define("minimal-babel-demo/router", ["exports", "@ember/routing/router", "minimal-babel-demo/config/environment"], function (_exports, _router, _environment) {
"use strict";

Object.defineProperty(_exports, "__esModule", {
  value: true
});
_exports.default = void 0;

class Router extends _router.default {
  location = _environment.default.locationType;
  rootURL = _environment.default.rootURL;
}

_exports.default = Router;
Router.map(function () {});
});

Which is _significantly smaller, and should be way less boot time for apps as well.

主要言語
JavaScript
スター
151
フォーク
115
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

emberjs/ember-cli-babel のほかの issue

emberjs/ember-cli-babel の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。