( config: CompatConfig, instance?: ComponentInternalInstance, )
| 514 | |
| 515 | // dev only |
| 516 | export 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 | |
| 554 | export function getCompatConfigForKey( |
| 555 | key: DeprecationTypes | 'MODE', |
no test coverage detected