Babel 8 Ecosystem Migration Stuff
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- devtools, release, testing-qa
調査の方向性
リンクされた Babel 8 Release Plan issue (#10746) と既存の next-8-dev ブランチから始めて、移行の範囲を理解してください。提案されている環境変数 BABEL_8_BREAKING と、v7/v8 テストの命名方法を確認してください。完了とするには、合意された移行戦略とサンプル PR が必要で、その後に別のプロジェクトで移行演習を行います。
索引モデルが issue の本文から書いたものです。
説明
Didn't want to spam our release issue too much so just writing this here as well.
There are a lot of concerns (I have them too) around what a major version bump would look like for the ecosystem. What else can we do in addition to a upgrade guide for the end user (good errors, clear explanation of changes, workaround/migration)?
What about dependencies of dependencies? Especially if you aren't using Babel directly (see issues from v6 to v7). We ended up with slow approach of essentially a year of alphas/betas/rc so that by the time it was out, most things were already updated and you could say it was relatively smooth compared to v5 to v6. But then again it took forever and there was a long process of versioning.
Idea
Use an environment variable (currently BABEL_8_BREAKING), which includes all breaking changes. Essentially a "feature flag" that we introduce (and continue to add onto) in Babel 7 patch versions.
Enables opt-ing into breaking changes without needing to change versions or dependencies.
So as a library author, you could do a dry-run and update accordingly. Or make PRs that run against the flag so that you can update the package ahead of release as we land changes. (hopefully we don't prolong this more than needed).
For the Babel codebase, ideally we do it in a way that makes this easy to automate away with a codemod. Babel 8 diff would be removing the flags (this is good because we aren't trying to introduce new features in the major version, we just do it in the minor)
if (process.env.BABEL_8_BREAKING) {
runNewFunction();
} else {
runOldFunction();
}
// new code during Babel 8 release
runNewFunction();
Tests?
We'll need to run tests for both "versions" to not break anything.
One approach: based on file extension: if the flag is enabled and it's a v7 test OR if the flag isn't enable and it's a v8 test, then skip the test?
Test renaming:
- A test only for v7: rename to
output.v7.js,options.v7.json - A test only for v8: rename to
output.v8.js,options.v8.json - For both: keep as is!
- During v8 release: remove all
.v7.files, rename.v8.files to normal
Issues
- Generally (or the Babel codebase), we shouldn't intend to use this approach in general.. and end up with if statements/flags everywhere. So use a unique name for the flag:
BABEL_8_BREAKING babel a.jsinstead of something likeBABEL_BREAKING babel a.js- Does it even matter it's a
process.envvs. config option? It seems easier since we don't need to pass options between packages (config, plugin, parser option). Also there's no access to options in our interations like CRA.
- Does it even matter it's a
- We already have a
next-8-devbranch that has merged some PRs into it. Ideally we would be able to just port all breaking change PRs tomasterunder the flag and ignorenext-8-dev. - It may be a lot of work to add this flag everywhere, and maintain multiple versions of tests
- It's very likely can't put everything under a flag, but it's a best effort to help with ecosytem migration. We can defer those till the actual release.
- What about only supporting later versions of Node? We'll have to defer to the final release?
Todo
- I'll make an example PR that does this, and then we can attempt a migration on another project as another example.
- 主要言語
- 言語のデータがありません
- スター
- 123
- フォーク
- 16
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
babel/notes のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
June 10th - Meetingオープンmeeting
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
🧠 Ideas/Issues dumpオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
automation models
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Nimblesite/Deslop#575 ·
メンテナーはふだん 1 日以内に返信
-
ai-discovered
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radius-project/ai-extensions#923 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
foundry-rs/foundry#17175 ·
メンテナーはふだん 1 日以内に返信