watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
moduleNameMapper: {
+ '@vue/compat': '<rootDir>/packages/vue-compat/src',
'^@vue/(.*?)$': '<rootDir>/packages/$1/src',
vue: '<rootDir>/packages/vue/src'
},
+import Vue from '@vue/compat'
+
+test('should work', async () => {
+ const el = document.createElement('div')
+ el.innerHTML = `{{ msg }}`
+ new Vue({
+ el,
+ data() {
+ return {
+ msg: 'hello'
+ }
+ }
+ })
+ expect('global app bootstrapping API has changed').toHaveBeenWarned()
+ expect(el.innerHTML).toBe('hello')
+})
-import { isArray } from '@vue/shared/src'
+import { isArray } from '@vue/shared'
import { ObjectDirective, DirectiveHook } from '../directives'
import { DeprecationTypes, warnDeprecation } from './deprecations'
[DeprecationTypes.INSTANCE_MOUNT]: {
message:
- `The global app boostrapping API has changed: vm.$mount() and the "el" ` +
+ `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
`option have been removed. Use createApp(RootComponent).mount() instead.`,
link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
},
if (hasNoRender) {
instance.render = emptyRender
}
- setupComponent(instance, __NODE_JS__)
+ setupComponent(instance)
vnode.component = instance
// $mount & $destroy
}
instance.render = null
;(component as ComponentOptions).template = container.innerHTML
- finishComponentSetup(instance, __NODE_JS__, true /* skip options */)
+ finishComponentSetup(instance, false, true /* skip options */)
}
// clear content before mounting
"types": ["jest", "puppeteer", "node"],
"rootDir": ".",
"paths": {
+ "@vue/compat": ["packages/vue-compat/src"],
"@vue/*": ["packages/*/src"],
"vue": ["packages/vue/src"]
}