Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration > Global Api Treeshaking の翻訳を追従 #260

Merged
merged 1 commit into from
Apr 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/guide/migration/global-api-treeshaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ badges:

# グローバル API の Treeshaking <MigrationBadges :badges="$frontmatter.badges" />

## 2.x での文法
## 2.x での構文

手動で DOM 操作を行う必要があった場合に、このようなパターンを目にしたと思います:

Expand Down Expand Up @@ -40,7 +40,7 @@ test('an async feature', async () => {

[webpack](https://webpack.js.org/) のようなモジュールバンドラーは、[tree-shaking](https://webpack.js.org/guides/tree-shaking/) と呼ばれる、聞こえの良い "不要コード削除" をサポートします。残念ながら Vue の過去のバージョンではコードの作りに起因して `Vue.nextTick()` のようなグローバル API は tree-shaking 可能ではなく、実際にどこで使われているかそうでないかに関わらず、最終成果物の中に含まれてしまいます。

## 3.x での文法
## 3.x での構文

Vue 3 では、グローバル API と内部 API は tree-shaking のサポートを念頭に置いて作り直されました。その結果、グローバル API は ES Modules ビルドの名前付きエクスポートとしてのみアクセスすることができます。例えば、以前のスニペットは次のようになります:

Expand Down