@vue/runtime-core 3.2.11 → 3.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +106 -428
- package/dist/runtime-core.cjs.prod.js +43 -144
- package/dist/runtime-core.esm-bundler.js +109 -432
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toRaw, ref, pauseTracking, resetTracking, reactive, computed, isRef, shallowReactive, trigger, ReactiveEffect, isProxy, shallowReadonly, track, EffectScope, markRaw, proxyRefs, isReactive, isReadonly } from '@vue/reactivity';
|
|
2
2
|
export { EffectScope, ReactiveEffect, computed, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { extend, isFunction as isFunction$1,
|
|
3
|
+
import { extend, EMPTY_OBJ, toHandlerKey, isFunction as isFunction$1, toNumber, hyphenate, camelize, isArray, isOn, hasOwn, isModelListener, isObject as isObject$1, remove, isString, invokeArrayFns, isPromise as isPromise$1, NOOP, def, isReservedProp, EMPTY_ARR, capitalize, toRawType, makeMap, NO, getGlobalThis, normalizeClass, normalizeStyle, isGloballyWhitelisted, hasChanged, isSet, isMap, isPlainObject } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
/* eslint-disable no-restricted-globals */
|
|
@@ -186,338 +186,6 @@ function devtoolsComponentEmit(component, event, params) {
|
|
|
186
186
|
devtools.emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
const deprecationData = {
|
|
190
|
-
["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
|
|
191
|
-
message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
|
|
192
|
-
`option have been removed. Use createApp(RootComponent).mount() instead.`,
|
|
193
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
|
|
194
|
-
},
|
|
195
|
-
["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
|
|
196
|
-
message: `Vue detected directives on the mount container. ` +
|
|
197
|
-
`In Vue 3, the container is no longer considered part of the template ` +
|
|
198
|
-
`and will not be processed/replaced.`,
|
|
199
|
-
link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
|
|
200
|
-
},
|
|
201
|
-
["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
|
|
202
|
-
message: `Vue.extend() has been removed in Vue 3. ` +
|
|
203
|
-
`Use defineComponent() instead.`,
|
|
204
|
-
link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
|
|
205
|
-
},
|
|
206
|
-
["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
|
|
207
|
-
message: `Vue.prototype is no longer available in Vue 3. ` +
|
|
208
|
-
`Use app.config.globalProperties instead.`,
|
|
209
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
|
|
210
|
-
},
|
|
211
|
-
["GLOBAL_SET" /* GLOBAL_SET */]: {
|
|
212
|
-
message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
|
|
213
|
-
`Simply use native JavaScript mutations.`
|
|
214
|
-
},
|
|
215
|
-
["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
|
|
216
|
-
message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
217
|
-
`Simply use native JavaScript mutations.`
|
|
218
|
-
},
|
|
219
|
-
["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
|
|
220
|
-
message: `Vue.observable() has been removed. ` +
|
|
221
|
-
`Use \`import { reactive } from "vue"\` from Composition API instead.`,
|
|
222
|
-
link: `https://v3.vuejs.org/api/basic-reactivity.html`
|
|
223
|
-
},
|
|
224
|
-
["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
|
|
225
|
-
message: `Vue.util has been removed. Please refactor to avoid its usage ` +
|
|
226
|
-
`since it was an internal API even in Vue 2.`
|
|
227
|
-
},
|
|
228
|
-
["CONFIG_SILENT" /* CONFIG_SILENT */]: {
|
|
229
|
-
message: `config.silent has been removed because it is not good practice to ` +
|
|
230
|
-
`intentionally suppress warnings. You can use your browser console's ` +
|
|
231
|
-
`filter features to focus on relevant messages.`
|
|
232
|
-
},
|
|
233
|
-
["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
|
|
234
|
-
message: `config.devtools has been removed. To enable devtools for ` +
|
|
235
|
-
`production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
|
|
236
|
-
link: `https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags`
|
|
237
|
-
},
|
|
238
|
-
["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
|
|
239
|
-
message: `config.keyCodes has been removed. ` +
|
|
240
|
-
`In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
|
|
241
|
-
link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
|
|
242
|
-
},
|
|
243
|
-
["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
|
|
244
|
-
message: `config.productionTip has been removed.`,
|
|
245
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
|
|
246
|
-
},
|
|
247
|
-
["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
|
|
248
|
-
message: () => {
|
|
249
|
-
let msg = `config.ignoredElements has been removed.`;
|
|
250
|
-
if (isRuntimeOnly()) {
|
|
251
|
-
msg += ` Pass the "isCustomElement" option to @vue/compiler-dom instead.`;
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
msg += ` Use config.isCustomElement instead.`;
|
|
255
|
-
}
|
|
256
|
-
return msg;
|
|
257
|
-
},
|
|
258
|
-
link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
|
|
259
|
-
},
|
|
260
|
-
["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
|
|
261
|
-
// this warning is only relevant in the full build when using runtime
|
|
262
|
-
// compilation, so it's put in the runtime compatConfig list.
|
|
263
|
-
message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
|
|
264
|
-
`"preserve". To suppress this warning, provide an explicit value for ` +
|
|
265
|
-
`\`config.compilerOptions.whitespace\`.`
|
|
266
|
-
},
|
|
267
|
-
["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
|
|
268
|
-
message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
|
|
269
|
-
`Use custom merge functions instead.`
|
|
270
|
-
},
|
|
271
|
-
["INSTANCE_SET" /* INSTANCE_SET */]: {
|
|
272
|
-
message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
|
|
273
|
-
`Simply use native JavaScript mutations.`
|
|
274
|
-
},
|
|
275
|
-
["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
|
|
276
|
-
message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
|
|
277
|
-
`Simply use native JavaScript mutations.`
|
|
278
|
-
},
|
|
279
|
-
["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
|
|
280
|
-
message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
|
|
281
|
-
link: `https://v3.vuejs.org/api/application-api.html#unmount`
|
|
282
|
-
},
|
|
283
|
-
["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
|
|
284
|
-
message: `vm.$on/$once/$off() have been removed. ` +
|
|
285
|
-
`Use an external event emitter library instead.`,
|
|
286
|
-
link: `https://v3.vuejs.org/guide/migration/events-api.html`
|
|
287
|
-
},
|
|
288
|
-
["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
|
|
289
|
-
message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
|
|
290
|
-
`use the "vnode" prefix instead of "hook:". For example, @${event} ` +
|
|
291
|
-
`should be changed to @vnode-${event.slice(5)}. ` +
|
|
292
|
-
`From JavaScript, use Composition API to dynamically register lifecycle ` +
|
|
293
|
-
`hooks.`,
|
|
294
|
-
link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
|
|
295
|
-
},
|
|
296
|
-
["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
|
|
297
|
-
message: `vm.$children has been removed. Consider refactoring your logic ` +
|
|
298
|
-
`to avoid relying on direct access to child components.`,
|
|
299
|
-
link: `https://v3.vuejs.org/guide/migration/children.html`
|
|
300
|
-
},
|
|
301
|
-
["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
|
|
302
|
-
message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
|
|
303
|
-
`included in vm.$attrs and it is no longer necessary to separately use ` +
|
|
304
|
-
`v-on="$listeners" if you are already using v-bind="$attrs". ` +
|
|
305
|
-
`(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
|
|
306
|
-
link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
|
|
307
|
-
},
|
|
308
|
-
["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
|
|
309
|
-
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
|
310
|
-
link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
|
|
311
|
-
},
|
|
312
|
-
["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
|
|
313
|
-
message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
|
|
314
|
-
`relying on class/style fallthrough from parent. In Vue 3, class/style ` +
|
|
315
|
-
`are now included in $attrs and will no longer fallthrough when ` +
|
|
316
|
-
`inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
|
|
317
|
-
`component root it should render the same end result. ` +
|
|
318
|
-
`If you are binding $attrs to a non-root element and expecting ` +
|
|
319
|
-
`class/style to fallthrough on root, you will need to now manually bind ` +
|
|
320
|
-
`them on root via :class="$attrs.class".`,
|
|
321
|
-
link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
|
|
322
|
-
},
|
|
323
|
-
["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
|
|
324
|
-
message: `The "data" option can no longer be a plain object. ` +
|
|
325
|
-
`Always use a function.`,
|
|
326
|
-
link: `https://v3.vuejs.org/guide/migration/data-option.html`
|
|
327
|
-
},
|
|
328
|
-
["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
|
|
329
|
-
message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
|
|
330
|
-
`In Vue 3, data keys are merged shallowly and will override one another.`,
|
|
331
|
-
link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
|
|
332
|
-
},
|
|
333
|
-
["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
|
|
334
|
-
message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
|
335
|
-
},
|
|
336
|
-
["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
|
|
337
|
-
message: `\`destroyed\` has been renamed to \`unmounted\`.`
|
|
338
|
-
},
|
|
339
|
-
["WATCH_ARRAY" /* WATCH_ARRAY */]: {
|
|
340
|
-
message: `"watch" option or vm.$watch on an array value will no longer ` +
|
|
341
|
-
`trigger on array mutation unless the "deep" option is specified. ` +
|
|
342
|
-
`If current usage is intended, you can disable the compat behavior and ` +
|
|
343
|
-
`suppress this warning with:` +
|
|
344
|
-
`\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
|
|
345
|
-
link: `https://v3.vuejs.org/guide/migration/watch.html`
|
|
346
|
-
},
|
|
347
|
-
["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
|
|
348
|
-
message: (key) => `props default value function no longer has access to "this". The compat ` +
|
|
349
|
-
`build only offers access to this.$options.` +
|
|
350
|
-
`(found in prop "${key}")`,
|
|
351
|
-
link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
|
|
352
|
-
},
|
|
353
|
-
["CUSTOM_DIR" /* CUSTOM_DIR */]: {
|
|
354
|
-
message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
|
|
355
|
-
`Use "${newHook}" instead.`,
|
|
356
|
-
link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
|
|
357
|
-
},
|
|
358
|
-
["V_FOR_REF" /* V_FOR_REF */]: {
|
|
359
|
-
message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
|
|
360
|
-
`Consider using function refs or refactor to avoid ref usage altogether.`,
|
|
361
|
-
link: `https://v3.vuejs.org/guide/migration/array-refs.html`
|
|
362
|
-
},
|
|
363
|
-
["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
|
|
364
|
-
message: `Using keyCode as v-on modifier is no longer supported. ` +
|
|
365
|
-
`Use kebab-case key name modifiers instead.`,
|
|
366
|
-
link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
|
|
367
|
-
},
|
|
368
|
-
["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
|
|
369
|
-
message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
|
|
370
|
-
`${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
|
|
371
|
-
`use \`null\` or \`undefined\` instead. If the usage is intended, ` +
|
|
372
|
-
`you can disable the compat behavior and suppress this warning with:` +
|
|
373
|
-
`\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
|
|
374
|
-
link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
|
|
375
|
-
},
|
|
376
|
-
["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
|
|
377
|
-
message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
|
|
378
|
-
`${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
|
|
379
|
-
`Always use explicit "true" or "false" values for enumerated attributes. ` +
|
|
380
|
-
`If the usage is intended, ` +
|
|
381
|
-
`you can disable the compat behavior and suppress this warning with:` +
|
|
382
|
-
`\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
|
|
383
|
-
link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
|
|
384
|
-
},
|
|
385
|
-
["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
|
|
386
|
-
message: `` // this feature cannot be runtime-detected
|
|
387
|
-
},
|
|
388
|
-
["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
|
|
389
|
-
message: `<TransitionGroup> no longer renders a root <span> element by ` +
|
|
390
|
-
`default if no "tag" prop is specified. If you do not rely on the span ` +
|
|
391
|
-
`for styling, you can disable the compat behavior and suppress this ` +
|
|
392
|
-
`warning with:` +
|
|
393
|
-
`\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
|
|
394
|
-
link: `https://v3.vuejs.org/guide/migration/transition-group.html`
|
|
395
|
-
},
|
|
396
|
-
["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
|
|
397
|
-
message: (comp) => {
|
|
398
|
-
const name = getComponentName(comp);
|
|
399
|
-
return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
|
|
400
|
-
`in Vue 3. Plain functions will be treated as functional components in ` +
|
|
401
|
-
`non-compat build. If you have already migrated all async component ` +
|
|
402
|
-
`usage and intend to use plain functions for functional components, ` +
|
|
403
|
-
`you can disable the compat behavior and suppress this ` +
|
|
404
|
-
`warning with:` +
|
|
405
|
-
`\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
|
|
406
|
-
},
|
|
407
|
-
link: `https://v3.vuejs.org/guide/migration/async-components.html`
|
|
408
|
-
},
|
|
409
|
-
["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
|
|
410
|
-
message: (comp) => {
|
|
411
|
-
const name = getComponentName(comp);
|
|
412
|
-
return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
|
|
413
|
-
`option has been removed. NOTE: Before migrating to use plain ` +
|
|
414
|
-
`functions for functional components, first make sure that all async ` +
|
|
415
|
-
`components usage have been migrated and its compat behavior has ` +
|
|
416
|
-
`been disabled.`);
|
|
417
|
-
},
|
|
418
|
-
link: `https://v3.vuejs.org/guide/migration/functional-components.html`
|
|
419
|
-
},
|
|
420
|
-
["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
|
|
421
|
-
message: (comp) => {
|
|
422
|
-
const configMsg = `opt-in to ` +
|
|
423
|
-
`Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
|
|
424
|
-
if (comp.props &&
|
|
425
|
-
(isArray(comp.props)
|
|
426
|
-
? comp.props.includes('modelValue')
|
|
427
|
-
: hasOwn(comp.props, 'modelValue'))) {
|
|
428
|
-
return (`Component delcares "modelValue" prop, which is Vue 3 usage, but ` +
|
|
429
|
-
`is running under Vue 2 compat v-model behavior. You can ${configMsg}`);
|
|
430
|
-
}
|
|
431
|
-
return (`v-model usage on component has changed in Vue 3. Component that expects ` +
|
|
432
|
-
`to work with v-model should now use the "modelValue" prop and emit the ` +
|
|
433
|
-
`"update:modelValue" event. You can update the usage and then ${configMsg}`);
|
|
434
|
-
},
|
|
435
|
-
link: `https://v3.vuejs.org/guide/migration/v-model.html`
|
|
436
|
-
},
|
|
437
|
-
["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
|
|
438
|
-
message: `Vue 3's render function API has changed. ` +
|
|
439
|
-
`You can opt-in to the new API with:` +
|
|
440
|
-
`\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
|
|
441
|
-
`\n (This can also be done per-component via the "compatConfig" option.)`,
|
|
442
|
-
link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
|
|
443
|
-
},
|
|
444
|
-
["FILTERS" /* FILTERS */]: {
|
|
445
|
-
message: `filters have been removed in Vue 3. ` +
|
|
446
|
-
`The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
|
447
|
-
`Use method calls or computed properties instead.`,
|
|
448
|
-
link: `https://v3.vuejs.org/guide/migration/filters.html`
|
|
449
|
-
},
|
|
450
|
-
["PRIVATE_APIS" /* PRIVATE_APIS */]: {
|
|
451
|
-
message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
|
|
452
|
-
`If you are seeing this warning only due to a dependency, you can ` +
|
|
453
|
-
`suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
const instanceWarned = Object.create(null);
|
|
457
|
-
const warnCount = Object.create(null);
|
|
458
|
-
function warnDeprecation(key, instance, ...args) {
|
|
459
|
-
if (!(process.env.NODE_ENV !== 'production')) {
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
instance = instance || getCurrentInstance();
|
|
463
|
-
// check user config
|
|
464
|
-
const config = getCompatConfigForKey(key, instance);
|
|
465
|
-
if (config === 'suppress-warning') {
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
const dupKey = key + args.join('');
|
|
469
|
-
let compId = instance && formatComponentName(instance, instance.type);
|
|
470
|
-
if (compId === 'Anonymous' && instance) {
|
|
471
|
-
compId = instance.uid;
|
|
472
|
-
}
|
|
473
|
-
// skip if the same warning is emitted for the same component type
|
|
474
|
-
const componentDupKey = dupKey + compId;
|
|
475
|
-
if (componentDupKey in instanceWarned) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
instanceWarned[componentDupKey] = true;
|
|
479
|
-
// same warning, but different component. skip the long message and just
|
|
480
|
-
// log the key and count.
|
|
481
|
-
if (dupKey in warnCount) {
|
|
482
|
-
warn(`(deprecation ${key}) (${++warnCount[dupKey] + 1})`);
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
warnCount[dupKey] = 0;
|
|
486
|
-
const { message, link } = deprecationData[key];
|
|
487
|
-
warn(`(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`);
|
|
488
|
-
if (!isCompatEnabled(key, instance, true)) {
|
|
489
|
-
console.error(`^ The above deprecation's compat behavior is disabled and will likely ` +
|
|
490
|
-
`lead to runtime errors.`);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
const globalCompatConfig = {
|
|
494
|
-
MODE: 2
|
|
495
|
-
};
|
|
496
|
-
function getCompatConfigForKey(key, instance) {
|
|
497
|
-
const instanceConfig = instance && instance.type.compatConfig;
|
|
498
|
-
if (instanceConfig && key in instanceConfig) {
|
|
499
|
-
return instanceConfig[key];
|
|
500
|
-
}
|
|
501
|
-
return globalCompatConfig[key];
|
|
502
|
-
}
|
|
503
|
-
function isCompatEnabled(key, instance, enableForBuiltIn = false) {
|
|
504
|
-
// skip compat for built-in components
|
|
505
|
-
if (!enableForBuiltIn && instance && instance.type.__isBuiltIn) {
|
|
506
|
-
return false;
|
|
507
|
-
}
|
|
508
|
-
const rawMode = getCompatConfigForKey('MODE', instance) || 2;
|
|
509
|
-
const val = getCompatConfigForKey(key, instance);
|
|
510
|
-
const mode = isFunction$1(rawMode)
|
|
511
|
-
? rawMode(instance && instance.type)
|
|
512
|
-
: rawMode;
|
|
513
|
-
if (mode === 2) {
|
|
514
|
-
return val !== false;
|
|
515
|
-
}
|
|
516
|
-
else {
|
|
517
|
-
return val === true || val === 'suppress-warning';
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
189
|
function emit(instance, event, ...rawArgs) {
|
|
522
190
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
523
191
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
@@ -743,12 +411,12 @@ function markAttrsAccessed() {
|
|
|
743
411
|
function renderComponentRoot(instance) {
|
|
744
412
|
const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
|
|
745
413
|
let result;
|
|
414
|
+
let fallthroughAttrs;
|
|
746
415
|
const prev = setCurrentRenderingInstance(instance);
|
|
747
416
|
if ((process.env.NODE_ENV !== 'production')) {
|
|
748
417
|
accessedAttrs = false;
|
|
749
418
|
}
|
|
750
419
|
try {
|
|
751
|
-
let fallthroughAttrs;
|
|
752
420
|
if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
|
|
753
421
|
// withProxy is a proxy with a different `has` trap only for
|
|
754
422
|
// runtime-compiled render functions using `with` block.
|
|
@@ -779,97 +447,92 @@ function renderComponentRoot(instance) {
|
|
|
779
447
|
? attrs
|
|
780
448
|
: getFunctionalFallthrough(attrs);
|
|
781
449
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
450
|
+
}
|
|
451
|
+
catch (err) {
|
|
452
|
+
blockStack.length = 0;
|
|
453
|
+
handleError(err, instance, 1 /* RENDER_FUNCTION */);
|
|
454
|
+
result = createVNode(Comment);
|
|
455
|
+
}
|
|
456
|
+
// attr merging
|
|
457
|
+
// in dev mode, comments are preserved, and it's possible for a template
|
|
458
|
+
// to have comments along side the root element which makes it a fragment
|
|
459
|
+
let root = result;
|
|
460
|
+
let setRoot = undefined;
|
|
461
|
+
if ((process.env.NODE_ENV !== 'production') &&
|
|
462
|
+
result.patchFlag > 0 &&
|
|
463
|
+
result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
|
|
464
|
+
[root, setRoot] = getChildRoot(result);
|
|
465
|
+
}
|
|
466
|
+
if (fallthroughAttrs && inheritAttrs !== false) {
|
|
467
|
+
const keys = Object.keys(fallthroughAttrs);
|
|
468
|
+
const { shapeFlag } = root;
|
|
469
|
+
if (keys.length) {
|
|
470
|
+
if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
|
|
471
|
+
if (propsOptions && keys.some(isModelListener)) {
|
|
472
|
+
// If a v-model listener (onUpdate:xxx) has a corresponding declared
|
|
473
|
+
// prop, it indicates this component expects to handle v-model and
|
|
474
|
+
// it should not fallthrough.
|
|
475
|
+
// related: #1543, #1643, #1989
|
|
476
|
+
fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
|
|
477
|
+
}
|
|
478
|
+
root = cloneVNode(root, fallthroughAttrs);
|
|
479
|
+
}
|
|
480
|
+
else if ((process.env.NODE_ENV !== 'production') && !accessedAttrs && root.type !== Comment) {
|
|
481
|
+
const allAttrs = Object.keys(attrs);
|
|
482
|
+
const eventAttrs = [];
|
|
483
|
+
const extraAttrs = [];
|
|
484
|
+
for (let i = 0, l = allAttrs.length; i < l; i++) {
|
|
485
|
+
const key = allAttrs[i];
|
|
486
|
+
if (isOn(key)) {
|
|
487
|
+
// ignore v-model handlers when they fail to fallthrough
|
|
488
|
+
if (!isModelListener(key)) {
|
|
489
|
+
// remove `on`, lowercase first letter to reflect event casing
|
|
490
|
+
// accurately
|
|
491
|
+
eventAttrs.push(key[2].toLowerCase() + key.slice(3));
|
|
823
492
|
}
|
|
824
493
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
`${extraAttrs.join(', ')}) ` +
|
|
828
|
-
`were passed to component but could not be automatically inherited ` +
|
|
829
|
-
`because component renders fragment or text root nodes.`);
|
|
830
|
-
}
|
|
831
|
-
if (eventAttrs.length) {
|
|
832
|
-
warn(`Extraneous non-emits event listeners (` +
|
|
833
|
-
`${eventAttrs.join(', ')}) ` +
|
|
834
|
-
`were passed to component but could not be automatically inherited ` +
|
|
835
|
-
`because component renders fragment or text root nodes. ` +
|
|
836
|
-
`If the listener is intended to be a component custom event listener only, ` +
|
|
837
|
-
`declare it using the "emits" option.`);
|
|
494
|
+
else {
|
|
495
|
+
extraAttrs.push(key);
|
|
838
496
|
}
|
|
839
497
|
}
|
|
498
|
+
if (extraAttrs.length) {
|
|
499
|
+
warn(`Extraneous non-props attributes (` +
|
|
500
|
+
`${extraAttrs.join(', ')}) ` +
|
|
501
|
+
`were passed to component but could not be automatically inherited ` +
|
|
502
|
+
`because component renders fragment or text root nodes.`);
|
|
503
|
+
}
|
|
504
|
+
if (eventAttrs.length) {
|
|
505
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
506
|
+
`${eventAttrs.join(', ')}) ` +
|
|
507
|
+
`were passed to component but could not be automatically inherited ` +
|
|
508
|
+
`because component renders fragment or text root nodes. ` +
|
|
509
|
+
`If the listener is intended to be a component custom event listener only, ` +
|
|
510
|
+
`declare it using the "emits" option.`);
|
|
511
|
+
}
|
|
840
512
|
}
|
|
841
513
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
849
|
-
warn(`Runtime directive used on component with non-element root node. ` +
|
|
850
|
-
`The directives will not function as intended.`);
|
|
851
|
-
}
|
|
852
|
-
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
853
|
-
}
|
|
854
|
-
// inherit transition data
|
|
855
|
-
if (vnode.transition) {
|
|
856
|
-
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
857
|
-
warn(`Component inside <Transition> renders non-element root node ` +
|
|
858
|
-
`that cannot be animated.`);
|
|
859
|
-
}
|
|
860
|
-
root.transition = vnode.transition;
|
|
861
|
-
}
|
|
862
|
-
if ((process.env.NODE_ENV !== 'production') && setRoot) {
|
|
863
|
-
setRoot(root);
|
|
514
|
+
}
|
|
515
|
+
// inherit directives
|
|
516
|
+
if (vnode.dirs) {
|
|
517
|
+
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
518
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
519
|
+
`The directives will not function as intended.`);
|
|
864
520
|
}
|
|
865
|
-
|
|
866
|
-
|
|
521
|
+
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
522
|
+
}
|
|
523
|
+
// inherit transition data
|
|
524
|
+
if (vnode.transition) {
|
|
525
|
+
if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {
|
|
526
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
527
|
+
`that cannot be animated.`);
|
|
867
528
|
}
|
|
529
|
+
root.transition = vnode.transition;
|
|
868
530
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
531
|
+
if ((process.env.NODE_ENV !== 'production') && setRoot) {
|
|
532
|
+
setRoot(root);
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
result = root;
|
|
873
536
|
}
|
|
874
537
|
setCurrentRenderingInstance(prev);
|
|
875
538
|
return result;
|
|
@@ -1404,8 +1067,8 @@ function normalizeSuspenseChildren(vnode) {
|
|
|
1404
1067
|
function normalizeSuspenseSlot(s) {
|
|
1405
1068
|
let block;
|
|
1406
1069
|
if (isFunction$1(s)) {
|
|
1407
|
-
const
|
|
1408
|
-
if (
|
|
1070
|
+
const trackBlock = isBlockTreeEnabled && s._c;
|
|
1071
|
+
if (trackBlock) {
|
|
1409
1072
|
// disableTracking: false
|
|
1410
1073
|
// allow block tracking for compiled slots
|
|
1411
1074
|
// (see ./componentRenderContext.ts)
|
|
@@ -1413,7 +1076,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
1413
1076
|
openBlock();
|
|
1414
1077
|
}
|
|
1415
1078
|
s = s();
|
|
1416
|
-
if (
|
|
1079
|
+
if (trackBlock) {
|
|
1417
1080
|
s._d = true;
|
|
1418
1081
|
block = currentBlock;
|
|
1419
1082
|
closeBlock();
|
|
@@ -5568,7 +5231,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
5568
5231
|
return Component;
|
|
5569
5232
|
}
|
|
5570
5233
|
if ((process.env.NODE_ENV !== 'production') && warnMissing && !res) {
|
|
5571
|
-
|
|
5234
|
+
const extra = type === COMPONENTS
|
|
5235
|
+
? `\nIf this is a native custom element, make sure to exclude it from ` +
|
|
5236
|
+
`component resolution via compilerOptions.isCustomElement.`
|
|
5237
|
+
: ``;
|
|
5238
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
5572
5239
|
}
|
|
5573
5240
|
return res;
|
|
5574
5241
|
}
|
|
@@ -6428,17 +6095,19 @@ function exposePropsOnRenderContext(instance) {
|
|
|
6428
6095
|
function exposeSetupStateOnRenderContext(instance) {
|
|
6429
6096
|
const { ctx, setupState } = instance;
|
|
6430
6097
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
6431
|
-
if (!setupState.__isScriptSetup
|
|
6432
|
-
|
|
6433
|
-
`
|
|
6434
|
-
|
|
6098
|
+
if (!setupState.__isScriptSetup) {
|
|
6099
|
+
if (key[0] === '$' || key[0] === '_') {
|
|
6100
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
6101
|
+
`which are reserved prefixes for Vue internals.`);
|
|
6102
|
+
return;
|
|
6103
|
+
}
|
|
6104
|
+
Object.defineProperty(ctx, key, {
|
|
6105
|
+
enumerable: true,
|
|
6106
|
+
configurable: true,
|
|
6107
|
+
get: () => setupState[key],
|
|
6108
|
+
set: NOOP
|
|
6109
|
+
});
|
|
6435
6110
|
}
|
|
6436
|
-
Object.defineProperty(ctx, key, {
|
|
6437
|
-
enumerable: true,
|
|
6438
|
-
configurable: true,
|
|
6439
|
-
get: () => setupState[key],
|
|
6440
|
-
set: NOOP
|
|
6441
|
-
});
|
|
6442
6111
|
});
|
|
6443
6112
|
}
|
|
6444
6113
|
|
|
@@ -7207,11 +6876,19 @@ function flushJobs(seen) {
|
|
|
7207
6876
|
// 2. If a component is unmounted during a parent component's update,
|
|
7208
6877
|
// its update can be skipped.
|
|
7209
6878
|
queue.sort((a, b) => getId(a) - getId(b));
|
|
6879
|
+
// conditional usage of checkRecursiveUpdate must be determined out of
|
|
6880
|
+
// try ... catch block since Rollup by default de-optimizes treeshaking
|
|
6881
|
+
// inside try-catch. This can leave all warning code unshaked. Although
|
|
6882
|
+
// they would get eventually shaken by a minifier like terser, some minifiers
|
|
6883
|
+
// would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
|
|
6884
|
+
const check = (process.env.NODE_ENV !== 'production')
|
|
6885
|
+
? (job) => checkRecursiveUpdates(seen, job)
|
|
6886
|
+
: NOOP;
|
|
7210
6887
|
try {
|
|
7211
6888
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
7212
6889
|
const job = queue[flushIndex];
|
|
7213
6890
|
if (job && job.active !== false) {
|
|
7214
|
-
if ((process.env.NODE_ENV !== 'production') &&
|
|
6891
|
+
if ((process.env.NODE_ENV !== 'production') && check(job)) {
|
|
7215
6892
|
continue;
|
|
7216
6893
|
}
|
|
7217
6894
|
// console.log(`running:`, job.id)
|
|
@@ -7903,7 +7580,7 @@ function isMemoSame(cached, memo) {
|
|
|
7903
7580
|
}
|
|
7904
7581
|
|
|
7905
7582
|
// Core API ------------------------------------------------------------------
|
|
7906
|
-
const version = "3.2.
|
|
7583
|
+
const version = "3.2.12";
|
|
7907
7584
|
const _ssrUtils = {
|
|
7908
7585
|
createComponentInstance,
|
|
7909
7586
|
setupComponent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.2.
|
|
36
|
-
"@vue/reactivity": "3.2.
|
|
35
|
+
"@vue/shared": "3.2.12",
|
|
36
|
+
"@vue/reactivity": "3.2.12"
|
|
37
37
|
}
|
|
38
38
|
}
|