mirror of https://github.com/vuejs/core.git
wip: avoid including vdom-only public properties map in bundle
This commit is contained in:
parent
68aa9bd768
commit
db3151b1a5
|
@ -4,7 +4,6 @@ import {
|
||||||
type Data,
|
type Data,
|
||||||
type GenericComponent,
|
type GenericComponent,
|
||||||
type GenericComponentInstance,
|
type GenericComponentInstance,
|
||||||
getComponentPublicInstance,
|
|
||||||
validateComponentName,
|
validateComponentName,
|
||||||
} from './component'
|
} from './component'
|
||||||
import type {
|
import type {
|
||||||
|
@ -280,6 +279,7 @@ export function createAppAPI<HostElement, Comp = Component>(
|
||||||
// hydrate?: RootHydrateFunction,
|
// hydrate?: RootHydrateFunction,
|
||||||
mount: AppMountFn<HostElement>,
|
mount: AppMountFn<HostElement>,
|
||||||
unmount: AppUnmountFn,
|
unmount: AppUnmountFn,
|
||||||
|
getPublicInstance: (instance: GenericComponentInstance) => any,
|
||||||
render?: RootRenderFunction,
|
render?: RootRenderFunction,
|
||||||
): CreateAppFunction<HostElement, Comp> {
|
): CreateAppFunction<HostElement, Comp> {
|
||||||
return function createApp(rootComponent, rootProps = null) {
|
return function createApp(rootComponent, rootProps = null) {
|
||||||
|
@ -409,7 +409,7 @@ export function createAppAPI<HostElement, Comp = Component>(
|
||||||
// for devtools and telemetry
|
// for devtools and telemetry
|
||||||
rootContainer.__vue_app__ = app
|
rootContainer.__vue_app__ = app
|
||||||
|
|
||||||
return getComponentPublicInstance(instance)
|
return getPublicInstance(instance)
|
||||||
} else if (__DEV__) {
|
} else if (__DEV__) {
|
||||||
warn(
|
warn(
|
||||||
`App has already been mounted.\n` +
|
`App has already been mounted.\n` +
|
||||||
|
|
|
@ -20,6 +20,7 @@ import {
|
||||||
type Data,
|
type Data,
|
||||||
type LifecycleHook,
|
type LifecycleHook,
|
||||||
createComponentInstance,
|
createComponentInstance,
|
||||||
|
getComponentPublicInstance,
|
||||||
setupComponent,
|
setupComponent,
|
||||||
} from './component'
|
} from './component'
|
||||||
import {
|
import {
|
||||||
|
@ -2445,7 +2446,12 @@ function baseCreateRenderer(
|
||||||
return {
|
return {
|
||||||
render,
|
render,
|
||||||
hydrate,
|
hydrate,
|
||||||
createApp: createAppAPI(mountApp, unmountApp, render),
|
createApp: createAppAPI(
|
||||||
|
mountApp,
|
||||||
|
unmountApp,
|
||||||
|
getComponentPublicInstance,
|
||||||
|
render,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ export const createVaporApp: CreateAppFunction<
|
||||||
ParentNode,
|
ParentNode,
|
||||||
VaporComponent
|
VaporComponent
|
||||||
> = comp => {
|
> = comp => {
|
||||||
if (!_createApp) _createApp = createAppAPI(mountApp, unmountApp)
|
if (!_createApp)
|
||||||
|
_createApp = createAppAPI(mountApp, unmountApp, i => i.exposed)
|
||||||
const app = _createApp(comp)
|
const app = _createApp(comp)
|
||||||
const mount = app.mount
|
const mount = app.mount
|
||||||
app.mount = (container, ...args: any[]) => {
|
app.mount = (container, ...args: any[]) => {
|
||||||
|
|
Loading…
Reference in New Issue