MCPcopy
hub / github.com/vuejs/core / validateCompatConfig

Function validateCompatConfig

packages/runtime-core/src/compat/compatConfig.ts:516–552  ·  view source on GitHub ↗
(
  config: CompatConfig,
  instance?: ComponentInternalInstance,
)

Source from the content-addressed store, hash-verified

514
515// dev only
516export function validateCompatConfig(
517 config: CompatConfig,
518 instance?: ComponentInternalInstance,
519): void {
520 if (seenConfigObjects.has(config)) {
521 return
522 }
523 seenConfigObjects.add(config)
524
525 for (const key of Object.keys(config)) {
526 if (
527 key !== 'MODE' &&
528 !(key in deprecationData) &&
529 !(key in warnedInvalidKeys)
530 ) {
531 if (key.startsWith('COMPILER_')) {
532 if (isRuntimeOnly()) {
533 warn(
534 `Deprecation config "${key}" is compiler-specific and you are ` +
535 `running a runtime-only build of Vue. This deprecation should be ` +
536 `configured via compiler options in your build setup instead.\n` +
537 `Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`,
538 )
539 }
540 } else {
541 warn(`Invalid deprecation config "${key}".`)
542 }
543 warnedInvalidKeys[key] = true
544 }
545 }
546
547 if (instance && config[DeprecationTypes.OPTIONS_DATA_MERGE] != null) {
548 warn(
549 `Deprecation config "${DeprecationTypes.OPTIONS_DATA_MERGE}" can only be configured globally.`,
550 )
551 }
552}
553
554export function getCompatConfigForKey(
555 key: DeprecationTypes | 'MODE',

Callers 2

finishComponentSetupFunction · 0.90
configureCompatFunction · 0.85

Calls 3

isRuntimeOnlyFunction · 0.90
warnFunction · 0.90
hasMethod · 0.80

Tested by

no test coverage detected