Skip to content

Commit 9f18645

Browse files
committed
amendment to RFC-0009 global-api-change: specify config.optionMergeStrategies behavior change
1 parent 7eb78c2 commit 9f18645

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

active-rfcs/0009-global-api-change.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ An app instance exposes a subset of the current global APIs. The rule of thumb i
9191

9292
- Global configuration
9393
- `Vue.config` -> `app.config`
94-
- `config.productionTip`: removed. ([details](#remove-config-productiontip))
95-
- `config.ignoredElements` -> `config.isCustomElement`. ([details](#config-ignoredelements-config-iscustomelement))
94+
- `config.productionTip`: removed. ([details](#remove-configproductiontip))
95+
- `config.ignoredElements` -> `config.isCustomElement`. ([details](#configignoredelements---configiscustomelement))
96+
- `config.keyCodes`: removed. ([details](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0014-drop-keycode-support.md))
97+
- `config.optionMergeStrategies`: see [details](#configoptionmergestrategies-behavior-change) for behavior adjustments.
9698
- Asset registration APIs
9799
- `Vue.component` -> `app.component`
98100
- `Vue.directive` -> `app.directive`
@@ -193,6 +195,13 @@ app.config.isCustomElement = tag => tag.startsWith('ion-')
193195

194196
- This will be a new top-level option in the Vue CLI config.
195197

198+
## `config.optionMergeStrategies` Behavior Change
199+
200+
While still supported, due to Vue 3's internal implementation changes, built-in options no longer need merge strategies, so they are no longer exposed. The default `app.config.optionMergeStrategies` is now an empty object. This means:
201+
202+
- Users must now always provide their own merge strategy functions instead of reusing built-in strategies (e.g. you can no longer do `config.optionMergeStrategies.custom = config.optionMergeStrategies.props`)
203+
- It is no longer possible to overwrite merge strategies for built-in options.
204+
196205
## Attaching Globally Shared Instance Properties
197206

198207
In 2.x, it was possible to inject globally shared instance properties by simply attaching them to `Vue.prototype`.
@@ -230,4 +239,5 @@ N/A
230239
- The transformation is straightforward (as seen in the basic example).
231240
- Moved methods can be replaced with stubs that emit warnings to guide migration.
232241
- A codemod can also be provided.
233-
- For `config.ingoredElements`, a compat shim can be easily provided.
242+
- `config.ingoredElements` can be supported in the compat build.
243+
- `config.optionMergeStrategies` built-in strategies can be supported in the compat build.

0 commit comments

Comments
 (0)