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 GenericComponent,
|
||||
type GenericComponentInstance,
|
||||
getComponentPublicInstance,
|
||||
validateComponentName,
|
||||
} from './component'
|
||||
import type {
|
||||
|
@ -280,6 +279,7 @@ export function createAppAPI<HostElement, Comp = Component>(
|
|||
// hydrate?: RootHydrateFunction,
|
||||
mount: AppMountFn<HostElement>,
|
||||
unmount: AppUnmountFn,
|
||||
getPublicInstance: (instance: GenericComponentInstance) => any,
|
||||
render?: RootRenderFunction,
|
||||
): CreateAppFunction<HostElement, Comp> {
|
||||
return function createApp(rootComponent, rootProps = null) {
|
||||
|
@ -409,7 +409,7 @@ export function createAppAPI<HostElement, Comp = Component>(
|
|||
// for devtools and telemetry
|
||||
rootContainer.__vue_app__ = app
|
||||
|
||||
return getComponentPublicInstance(instance)
|
||||
return getPublicInstance(instance)
|
||||
} else if (__DEV__) {
|
||||
warn(
|
||||
`App has already been mounted.\n` +
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
type Data,
|
||||
type LifecycleHook,
|
||||
createComponentInstance,
|
||||
getComponentPublicInstance,
|
||||
setupComponent,
|
||||
} from './component'
|
||||
import {
|
||||
|
@ -2445,7 +2446,12 @@ function baseCreateRenderer(
|
|||
return {
|
||||
render,
|
||||
hydrate,
|
||||
createApp: createAppAPI(mountApp, unmountApp, render),
|
||||
createApp: createAppAPI(
|
||||
mountApp,
|
||||
unmountApp,
|
||||
getComponentPublicInstance,
|
||||
render,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ export const createVaporApp: CreateAppFunction<
|
|||
ParentNode,
|
||||
VaporComponent
|
||||
> = comp => {
|
||||
if (!_createApp) _createApp = createAppAPI(mountApp, unmountApp)
|
||||
if (!_createApp)
|
||||
_createApp = createAppAPI(mountApp, unmountApp, i => i.exposed)
|
||||
const app = _createApp(comp)
|
||||
const mount = app.mount
|
||||
app.mount = (container, ...args: any[]) => {
|
||||
|
|
Loading…
Reference in New Issue