Skip to content

Migration guide: Mention accessing createApp from a CDN build #774

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

Merged
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
10 changes: 9 additions & 1 deletion src/guide/migration/global-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ import { createApp } from 'vue'
const app = createApp({})
```

If you're using a [CDN](/guide/installation.html#cdn) build of Vue then `createApp` is exposed via the global `Vue` object:

```js
const { createApp } = Vue

const app = createApp({})
```

An app instance exposes a subset of the current global APIs. The rule of thumb is _any APIs that globally mutate Vue's behavior are now moved to the app instance_. Here is a table of the current global APIs and their corresponding instance APIs:

| 2.x Global API | 3.x Instance API (`app`) |
Expand Down Expand Up @@ -198,7 +206,7 @@ export default {
}
```

Using `provide` is especially useful when writing a plugin, as an alternative to `globalProperties`.
Using `provide` is especially useful when writing a plugin, as an alternative to `globalProperties`.

## Share Configurations Among Apps

Expand Down