Détail du package

@vue/compat

vuejs1.2mMIT3.5.13

Vue 3 compatibility build for Vue 2

vue

readme

Overview

@vue/compat (aka "the migration build") is a build of Vue 3 that provides configurable Vue 2 compatible behavior.

The migration build runs in Vue 2 mode by default - most public APIs behave exactly like Vue 2, with only a few exceptions. Usage of features that have changed or been deprecated in Vue 3 will emit runtime warnings. A feature's compatibility can also be enabled/disabled on a per-component basis.

Intended Use Cases

  • Upgrading a Vue 2 application to Vue 3 (with limitations)
  • Migrating a library to support Vue 3
  • For experienced Vue 2 developers who have not tried Vue 3 yet, the migration build can be used in place of Vue 3 to help learn the difference between versions.

Known Limitations

While we've tried hard to make the migration build mimic Vue 2 behavior as much as possible, there are some limitations that may prevent your app from being eligible for upgrading:

  • Dependencies that rely on Vue 2 internal APIs or undocumented behavior. The most common case is usage of private properties on VNodes. If your project relies on component libraries like Vuetify, Quasar or ElementUI, it is best to wait for their Vue 3 compatible versions.

  • Internet Explorer 11 support: Vue 3 has officially dropped the plan for IE11 support. If you still need to support IE11 or below, you will have to stay on Vue 2.

  • Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing vue-server-renderer with @vue/server-renderer. Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with Vite. If you are using Nuxt.js, it is probably better to wait for Nuxt 3.

Expectations

Please note that the migration build aims to cover only publicly documented Vue 2 APIs and behavior. If your application fails to run under the migration build due to reliance on undocumented behavior, it is unlikely that we'll tweak the migration build to cater to your specific case. Consider refactoring to remove reliance on the behavior in question instead.

A word of caution: if your application is large and complex, migration will likely be a challenge even with the migration build. If your app is unfortunately not suitable for upgrade, do note that we are planning to backport Composition API and some other Vue 3 features to the 2.7 release (estimated late Q3 2021).

If you do get your app running on the migration build, you can ship it to production before the migration is complete. Although there is a small performance/size overhead, it should not noticeably affect production UX. You may have to do so when you have dependencies that rely on Vue 2 behavior, and cannot be upgraded/replaced.

The migration build will be provided starting with 3.1, and will continue to be published alongside the 3.2 release line. We do plan to eventually stop publishing the migration build in a future minor version (no earlier than EOY 2021), so you should still aim to switch to the standard build before then.

Upgrade Workflow

The following workflow walks through the steps of migrating an actual Vue 2 app (Vue HackerNews 2.0) to Vue 3. The full commits can be found here. Note that the actual steps required for your project may vary, and these steps should be treated as general guidance rather than strict instructions.

Preparations

Installation

  1. Upgrade tooling if applicable.

    • If using custom webpack setup: Upgrade vue-loader to ^16.0.0.
    • If using vue-cli: upgrade to the latest @vue/cli-service with vue upgrade
    • (Alternative) migrate to Vite + vite-plugin-vue2. [Example commit]
  2. In package.json, update vue to 3.1, install @vue/compat of the same version, and replace vue-template-compiler (if present) with @vue/compiler-sfc:

    "dependencies": {
    -  "vue": "^2.6.12",
    +  "vue": "^3.1.0",
    +  "@vue/compat": "^3.1.0"
       ...
    },
    "devDependencies": {
    -  "vue-template-compiler": "^2.6.12"
    +  "@vue/compiler-sfc": "^3.1.0"
    }
    

    Example commit

  3. In the build setup, alias vue to @vue/compat and enable compat mode via Vue compiler options.

    Example Configs

    <summary>vue-cli</summary> js // vue.config.js module.exports = { chainWebpack: config => { config.resolve.alias.set('vue', '@vue/compat') config.module .rule('vue') .use('vue-loader') .tap(options => { return { ...options, compilerOptions: { compatConfig: { MODE: 2, }, }, } }) }, }
    <summary>Plain webpack</summary> js // webpack.config.js module.exports = { resolve: { alias: { vue: '@vue/compat', }, }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: { compilerOptions: { compatConfig: { MODE: 2, }, }, }, }, ], }, }
    <summary>Vite</summary> js // vite.config.js export default { resolve: { alias: { vue: '@vue/compat', }, }, plugins: [ vue({ template: { compilerOptions: { compatConfig: { MODE: 2, }, }, }, }), ], }
  4. At this point, your application may encounter some compile-time errors / warnings (e.g. use of filters). Fix them first. If all compiler warnings are gone, you can also set the compiler to Vue 3 mode.

    Example commit

  5. After fixing the errors, the app should be able to run if it is not subject to the limitations mentioned above.

    You will likely see a LOT of warnings from both the command line and the browser console. Here are some general tips:

    • You can filter for specific warnings in the browser console. It's a good idea to use the filter and focus on fixing one item at a time. You can also use negated filters like -GLOBAL_MOUNT.

    • You can suppress specific deprecations via compat configuration.

    • Some warnings may be caused by a dependency that you use (e.g. vue-router). You can check this from the warning's component trace or stack trace (expanded on click). Focus on fixing the warnings that originate from your own source code first.

    • If you are using vue-router, note <transition> and <keep-alive> will not work with <router-view> until you upgrade to vue-router v4.

  6. Update <transition> class names. This is the only feature that does not have a runtime warning. You can do a project-wide search for .*-enter and .*-leave CSS class names.

    Example commit

  7. Update app entry to use new global mounting API.

    Example commit

  8. Upgrade vuex to v4.

    Example commit

  9. Upgrade vue-router to v4. If you also use vuex-router-sync, you can replace it with a store getter.

    After the upgrade, to use <transition> and <keep-alive> with <router-view> requires using the new scoped-slot based syntax.

    Example commit

  10. Pick off individual warnings. Note some features have conflicting behavior between Vue 2 and Vue 3 - for example, the render function API, or the functional component vs. async component change. To migrate to Vue 3 API without affecting the rest of the application, you can opt-in to Vue 3 behavior on a per-component basis with the compatConfig option.

    Example commit

  11. When all warnings are fixed, you can remove the migration build and switch to Vue 3 proper. Note you may not be able to do so if you still have dependencies that rely on Vue 2 behavior.

    Example commit

Compat Configuration

Global Config

Compat features can be disabled individually:

import { configureCompat } from 'vue'

// disable compat for certain features
configureCompat({
  FEATURE_ID_A: false,
  FEATURE_ID_B: false,
})

Alternatively, the entire application can default to Vue 3 behavior, with only certain compat features enabled:

import { configureCompat } from 'vue'

// default everything to Vue 3 behavior, and only enable compat
// for certain features
configureCompat({
  MODE: 3,
  FEATURE_ID_A: true,
  FEATURE_ID_B: true,
})

Per-Component Config

A component can use the compatConfig option, which expects the same options as the global configureCompat method:

export default {
  compatConfig: {
    MODE: 3, // opt-in to Vue 3 behavior for this component only
    FEATURE_ID_A: true, // features can also be toggled at component level
  },
  // ...
}

Compiler-specific Config

Features that start with COMPILER_ are compiler-specific: if you are using the full build (with in-browser compiler), they can be configured at runtime. However if using a build setup, they must be configured via the compilerOptions in the build config instead (see example configs above).

Feature Reference

Compatibility Types

  • ✔ Fully compatible
  • ◐ Partially Compatible with caveats
  • ⨂ Incompatible (warning only)
  • ⭘ Compat only (no warning)

Incompatible

Should be fixed upfront or will likely lead to errors

ID Type Description Docs
GLOBAL_MOUNT_CONTAINER Mounted application does not replace the element it's mounted to link
CONFIG_DEVTOOLS production devtools is now a build-time flag link
COMPILER_V_IF_V_FOR_PRECEDENCE v-if and v-for precedence when used on the same element has changed link
COMPILER_V_IF_SAME_KEY v-if branches can no longer have the same key link
COMPILER_V_FOR_TEMPLATE_KEY_PLACEMENT <template v-for> key should now be placed on <template> link
COMPILER_SFC_FUNCTIONAL <template functional> is no longer supported in SFCs link

Partially Compatible with Caveats

ID Type Description Docs
CONFIG_IGNORED_ELEMENTS config.ignoredElements is now config.compilerOptions.isCustomElement (only in browser compiler build). If using build setup, isCustomElement must be passed via build configuration. link
COMPILER_INLINE_TEMPLATE inline-template removed (compat only supported in browser compiler build) link
PROPS_DEFAULT_THIS props default factory no longer have access to this (in compat mode, this is not a real instance - it only exposes props, $options and injections) link
INSTANCE_DESTROY $destroy instance method removed (in compat mode, only supported on root instance)
GLOBAL_PRIVATE_UTIL Vue.util is private and no longer available
CONFIG_PRODUCTION_TIP config.productionTip no longer necessary link
CONFIG_SILENT config.silent removed

Compat only (no warning)

ID Type Description Docs
TRANSITION_CLASSES Transition enter/leave classes changed link

Fully Compatible

ID Type Description Docs
GLOBAL_MOUNT new Vue() -> createApp link
GLOBAL_EXTEND Vue.extend removed (use defineComponent or extends option) link
GLOBAL_PROTOTYPE Vue.prototype -> app.config.globalProperties link
GLOBAL_SET Vue.set removed (no longer needed)
GLOBAL_DELETE Vue.delete removed (no longer needed)
GLOBAL_OBSERVABLE Vue.observable removed (use reactive) link
CONFIG_KEY_CODES config.keyCodes removed link
CONFIG_WHITESPACE In Vue 3 whitespace defaults to "condense"
INSTANCE_SET vm.$set removed (no longer needed)
INSTANCE_DELETE vm.$delete removed (no longer needed)
INSTANCE_EVENT_EMITTER vm.$on, vm.$off, vm.$once removed link
INSTANCE_EVENT_HOOKS Instance no longer emits hook:x events link
INSTANCE_CHILDREN vm.$children removed link
INSTANCE_LISTENERS vm.$listeners removed link
INSTANCE_SCOPED_SLOTS vm.$scopedSlots removed; vm.$slots now exposes functions link
INSTANCE_ATTRS_CLASS_STYLE $attrs now includes class and style link
OPTIONS_DATA_FN data must be a function in all cases link
OPTIONS_DATA_MERGE data from mixin or extension is now shallow merged link
OPTIONS_BEFORE_DESTROY beforeDestroy -> beforeUnmount
OPTIONS_DESTROYED destroyed -> unmounted
WATCH_ARRAY watching an array no longer triggers on mutation unless deep link
V_ON_KEYCODE_MODIFIER v-on no longer supports keyCode modifiers link
CUSTOM_DIR Custom directive hook names changed link
ATTR_FALSE_VALUE No longer removes attribute if binding value is boolean false link
ATTR_ENUMERATED_COERCION No longer special case enumerated attributes link
TRANSITION_GROUP_ROOT <transition-group> no longer renders a root element by default link
COMPONENT_ASYNC Async component API changed (now requires defineAsyncComponent) link
COMPONENT_FUNCTIONAL Functional component API changed (now must be plain functions) link
COMPONENT_V_MODEL Component v-model reworked link
RENDER_FUNCTION Render function API changed link
FILTERS Filters removed (this option affects only runtime filter APIs) link
COMPILER_IS_ON_ELEMENT is usage is now restricted to <component> only link
COMPILER_V_BIND_SYNC v-bind.sync replaced by v-model with arguments link
COMPILER_V_BIND_PROP v-bind.prop modifier removed
COMPILER_V_BIND_OBJECT_ORDER v-bind="object" is now order sensitive link
COMPILER_V_ON_NATIVE v-on.native modifier removed link
COMPILER_V_FOR_REF ref in v-for (compiler support)
COMPILER_NATIVE_TEMPLATE <template> with no special directives now renders as native element
COMPILER_FILTERS filters (compiler support)

changelog

3.5.13 (2024-11-15)

Bug Fixes

  • compiler-core: handle v-memo + v-for with functional key (#12014) (99009ee), closes #12013
  • compiler-dom: properly stringify template string style (#12392) (2d78539), closes #12391
  • custom-element: avoid triggering mutationObserver when relecting props (352bc88), closes #12214 #12215
  • deps: update dependency postcss to ^8.4.48 (#12356) (b5ff930)
  • hydration: the component vnode's el should be updated when a mismatch occurs. (#12255) (a20a4cb), closes #12253
  • reactivty: avoid unnecessary watcher effect removal from inactive scope (2193284), closes #5783 #5806
  • reactivity: release nested effects/scopes on effect scope stop (#12373) (bee2f5e), closes #12370
  • runtime-dom: set css vars before user onMounted hooks (2d5c5e2), closes #11533
  • runtime-dom: set css vars on update to handle child forcing reflow in onMount (#11561) (c4312f9)
  • ssr: avoid updating subtree of async component if it is resolved (#12363) (da7ad5e), closes #12362
  • ssr: ensure v-text updates correctly with custom directives in SSR output (#12311) (1f75d4e), closes #12309
  • ssr: handle initial selected state for select with v-model + v-for option (#12399) (4f8d807), closes #12395
  • teleport: handle deferred teleport update before mounted (#12168) (8bff142), closes #12161
  • templateRef: set ref on cached async component which wrapped in KeepAlive (#12290) (983eb50), closes #4999 #5004
  • test: update snapshot (#12169) (828d4a4)
  • Transition: fix transition memory leak edge case (#12182) (660132d), closes #12181
  • transition: reflow before leave-active class after leave-from (#12288) (4b479db), closes #2593
  • types: defineEmits w/ interface declaration (#12343) (1022eab), closes #8457
  • v-once: setting hasOnce to current block only when in v-once (#12374) (37300fc), closes #12371

Performance Improvements

  • reactivity: do not track inner key `__v_skip`` (#11690) (d637bd6)
  • runtime-core: use feature flag for call to resolveMergedOptions (#12163) (1755ac0)

3.5.12 (2024-10-11)

Bug Fixes

Performance Improvements

  • reactivity: avoid unnecessary recursion in removeSub (#12135) (ec917cf)

3.5.11 (2024-10-03)

Bug Fixes

  • compiler-sfc: do not skip TSSatisfiesExpression when transforming props destructure (#12062) (2328b05), closes #12061
  • reactivity: prevent overwriting next property during batch processing (#12075) (d3f5e6e), closes #12072
  • scheduler: job ordering when the post queue is flushing (#12090) (577edca)
  • types: correctly infer TypeProps when it is any (#12073) (57315ab), closes #12058
  • types: should not intersect PublicProps with Props (#12077) (6f85894)
  • types: infer the first generic type of Ref correctly (#12094) (c97bb84)

3.5.10 (2024-09-27)

Bug Fixes

  • custom-element: properly set kebab-case props on Vue custom elements (ea3efa0), closes #12030 #12032
  • reactivity: fix nested batch edge case (93c95dd)
  • reactivity: only clear notified flags for computed in first batch iteration (aa9ef23), closes #12045
  • types/ref: handle nested refs in UnwrapRef (#12049) (e2c19c2), closes #12044

3.5.9 (2024-09-26)

Bug Fixes

3.5.8 (2024-09-22)

Bug Fixes

  • reactivity: do not remove dep from depsMap when cleaning up deps of computed (#11995) (0267a58)

3.5.7 (2024-09-20)

Bug Fixes

Performance Improvements

  • hydration: avoid observer if element is in viewport (#11639) (e075dfa)

3.5.6 (2024-09-16)

Bug Fixes

  • compile-dom: should be able to stringify mathML (#11891) (85c138c)
  • compiler-sfc: preserve old behavior when using withDefaults with desutructure (8492c3c), closes #11930
  • reactivity: avoid exponential perf cost and reduce call stack depth for deeply chained computeds (#11944) (c74bb8c), closes #11928
  • reactivity: rely on dirty check only when computed has deps (#11931) (aa5dafd), closes #11929
  • watch: once option should be ignored by watchEffect (#11884) (49fa673)
  • watch: unwatch should be callable during SSR (#11925) (2d6adf7), closes #11924

3.5.5 (2024-09-13)

Bug Fixes

  • compiler-core: fix handling of delimiterOpen in VPre (#11915) (706d4ac), closes #11913
  • compiler-dom: fix stringify static edge for partially eligible chunks in cached parent (1d99d61), closes #11879 #11890
  • compiler-dom: should ignore leading newline in <textarea> per spec (3c4bf76)
  • compiler-sfc: nested css supports atrule and comment (#11899) (0e7bc71), closes #11896
  • custom-element: handle nested customElement mount w/ shadowRoot false (#11861) (f2d8019), closes #11851 #11871
  • hmr: reload async child wrapped in Suspense + KeepAlive (#11907) (10a2c60), closes #11868
  • hydration: fix mismatch of leading newline in <textarea> and <pre> (a5f3c2e), closes #11873 #11874
  • reactivity: properly clean up deps, fix memory leak (8ea5d6d), closes #11901
  • runtime-core: properly update async component nested in KeepAlive (#11917) (7fe6c79), closes #11916
  • TransitionGroup: not warn unkeyed text children with whitespece preserve (#11888) (7571f20), closes #11885

3.5.4 (2024-09-10)

Bug Fixes

  • compiler-sfc: correct scoped injection for nesting selector (#11854) (b1de75e), closes #10567
  • reactivity: fix markRaw error on already marked object (#11864) (67d6596), closes #11862
  • Revert "fix: Revert "fix(reactivity): self-referencing computed should refresh"" (e596378)
  • runtime-core: handle shallow reactive arrays in renderList correctly (#11870) (ced59ab), closes #11869
  • types: correctly infer TypeEmits with both tuple and function syntax (#11840) (dad6738), closes #11836

Performance Improvements

  • reactivity: trigger deps directly instead of storing in an array first (#11695) (f80d447)

3.5.3 (2024-09-06)

Bug Fixes

  • hydration: check __asyncHydrate presence for vue3-lazy-hydration compat (#11825) (8e6c337), closes #11793
  • Revert "fix(reactivity): self-referencing computed should refresh" (35c760f)
  • ssr: respect app.config.warnHandler during ssr (bf3d9a2), closes #11830
  • Transition: handle KeepAlive child unmount in Transition out-in mode (#11833) (6b7901d), closes #11775
  • useId: make generated IDs selector compatible (babfb4c), closes #11828

3.5.2 (2024-09-05)

Bug Fixes

Features

  • compiler-core: parse modifiers as expression to provide location data (#11819) (3f13203)

3.5.1 (2024-09-04)

Bug Fixes

  • build: improve built-in components treeshakability (4eee630)
  • reactivity: handle non-array arguments in reactive concat method (#11794) (475977a), closes #11792
  • Transition: avoid applying transition hooks on comment vnode (#11788) (51912f8), closes #11782
  • types: avoid using intersection type in Readonly<...> to fix JSDoc emit (#11799) (7518bc1)
  • useTemplateRef: fix readonly warning when useTemplateRef has same variable name as template ref (bc63df0), closes #11795 #11802 #11804

3.5.0 (2024-09-03)

Aggregated Features List for 3.5 (alpha to stable)

Reactivity

  • reactivity: Refactor reactivity system to use version counting and doubly-linked list tracking (#10397) (05eb4e0)
  • reactivity: Optimize array tracking (#9511) (70196a4)
  • compiler-sfc: enable reactive props destructure by default (d2dac0e)
  • reactivity: onEffectCleanup API (2cc5615), closes #10173
  • reactivity: add failSilently argument for onScopeDispose (9a936aa)
  • reactivity/watch: base watch, getCurrentWatcher, and onWatcherCleanup (#9927) (205e5b5)
  • reactivity/watch: add pause/resume for ReactiveEffect, EffectScope, and WatchHandle (#9651) (267093c)
  • watch: support passing number to deep option to control the watch depth (#9572) (22f7d96)
  • types: export MultiWatchSources type (#9563) (998dca5)
  • types: allow computed getter and setter types to be unrelated (#11472) (a01675e), closes #7271

SSR

  • runtime-core: useId() and app.config.idPrefix (#11404) (73ef156)
  • hydration: lazy hydration strategies for async components (#11458) (d14a11c)
  • hydration: support suppressing hydration mismatch via data-allow-mismatch (94fb2b8)

Custom Element

  • custom-element: useHost() helper (775103a)
  • custom-element: useShadowRoot() helper (5a1a89b), closes #6113 #8195
  • custom-element: expose this.$host in Options API (1ef8f46)
  • custom-element: inject child components styles to custom element shadow root (#11517) (56c76a8), closes #4662 #7941 #7942
  • custom-element: support configurable app instance in defineCustomElement (6758c3c), closes #4356 #4635
  • custom-element: support css :host selector by applying css vars on host element (#8830) (03a9ea2), closes #8826
  • custom-element: support emit with options (e181bff), closes #7605
  • custom-element: support expose on customElement (#6256) (af838c1), closes #5540
  • custom-element: support nonce option for injected style tags (bb4a02a), closes #6530
  • custom-element: support passing custom-element-specific options via 2nd argument of defineCustomElement (60a88a2)
  • custom-element: support shadowRoot: false in defineCustomElement() (37d2ce5), closes #4314 #4404

Teleport

Misc

  • runtime-core: useTemplateRef() (3ba70e4)
  • runtime-core: add app.onUnmount() for registering cleanup functions (#4619) (582a3a3), closes #4516
  • runtime-core: add app.config.throwUnhandledErrorInProduction (f476b7f), closes #7876
  • runtime-dom: Trusted Types compatibility (#10844) (6d4eb94)
  • compiler-core: support Symbol global in template expressions (#9069) (a501a85)
  • types: export more emit related types (#11017) (189573d)
  • types: add loading prop to iframe (#11767) (d86fe0e)

Internals

  • reactivity: store value cache on CustomRefs impls (#11539) (e044b6e)
  • types: provide internal options for directly using user types in language tools (#10801) (75c8cf6)
  • types: provide internal options for using refs type in language tools (#11492) (5ffd1a8)

Bug Fixes

  • compiler-sfc: fix import usage check for kebab-case same name shorthand binding (0f7c0e5), closes #11745 #11754
  • cssVars: correctly escape double quotes in SSR (#11784) (7b5b6e0), closes #11779
  • deps: update dependency postcss to ^8.4.44 (#11774) (cb843e0)
  • hydration: escape css var name to avoid mismatch (#11739) (ca12e77), closes #11735
  • hydration: handle text nodes with 0 during hydration (#11772) (c756da2), closes #11771
  • reactivity: correctly handle method calls on user-extended arrays (#11760) (9817c80), closes #11759
  • runtime-dom: avoid unnecessary prop patch for checkbox (#11657) (c3ce9fe), closes #11647
  • runtime-dom: prevent unnecessary DOM update from v-model (#11656) (b1be9bd), closes #11647
  • server-renderer: Fix call to serverPrefetch in server renderer with an async setup (#10893) (6039e25)
  • server-renderer: render className during SSR (#11722) (52cdb0f)
  • types/defineModel: allow getter and setter types to be unrelated (#11699) (fe07f70), closes #11697

3.5.0-rc.1 (2024-08-29)

Bug Fixes

  • compiler-sfc: skip circular tsconfig project reference (#11680) (9c4c2e5), closes #11382
  • custom-element: handle keys set on custom elements (#11655) (f1d1831), closes #11641
  • deps: update dependency monaco-editor to ^0.51.0 (#11713) (434f8a9)
  • keep-alive: reset keep alive flag when the component is removed from include (#11718) (29c321b), closes #11717
  • reactivity: avoid infinite recursion when mutating ref wrapped in reactive (313e4bf), closes #11696
  • reactivity: ensure watcher with once: true are properly removed from effect scope (#11665) (fbc0c42)
  • runtime-dom: setting innerHTML when patching props should go through trusted types (d875de5)
  • types: GlobalDirective / GlobalComponents should not be records (42e8df6)

3.5.0-beta.3 (2024-08-20)

Bug Fixes

Features

  • reactivity: base watch, getCurrentWatcher, and onWatcherCleanup (#9927) (205e5b5)

Performance Improvements

  • runtime-core: use apply to avoid spreading. (#5985) (bb6babc)

3.5.0-beta.2 (2024-08-15)

Bug Fixes

  • build: revert entities to 4.5 to avoid runtime resolution errors (e9e0815), closes #11603
  • compiler-core: use ast-based check for function expressions when possible (5861229), closes #11615
  • compiler-sfc: fix prefixIdentifier default value (3d6f015)
  • compiler-sfc: handle keyof operator with index object (#11581) (fe00815)
  • custom-element: keep instance.isCE for backwards compat (e19fc27)
  • deps: update dependency postcss to ^8.4.41 (#11585) (4c4e12a)
  • keep-alive: ensure include/exclude regexp work with global flag (#11595) (3653bc0)
  • reactivity: ensure extended method arguments are not lost (#11574) (4085def), closes #11570
  • reactivity: sync watch should be executed correctly (#11589) (3bda3e8), closes #11577
  • types/computed: ensure type safety for WritableComputedRef (#11608) (5cf5a16)
  • types: add fallback stub for DOM types when DOM lib is absent (#11598) (fee6697)

Features

  • deprecated: remove deprecated parseExpressions option (#11597) (4e7d5db)

3.5.0-beta.1 (2024-08-08)

Bug Fixes

  • custom-element: delay mounting of custom elements with async parent (37ccb9b), closes #8127 #9341 #9351 #9351
  • custom-element: delete prop on attribute removal (506c4c5), closes #11276
  • custom-element: ignore scoped id (7f2c505)
  • custom-element: reflect prop default value on custom element (63689ed), closes #9006 #10537
  • custom-element: support early-set domProps for async custom elements (a07e7bf), closes #11081 #11082
  • types/custome-element: defineCustomElement props inference with array emits (#11384) (e94b01b), closes #11353
  • types: allow using InjectionKey as valid property key (321d807), closes #5089

Features

  • custom-element: expose this.$host in Options API (1ef8f46)
  • custom-element: inject child components styles to custom element shadow root (#11517) (56c76a8), closes #4662 #7941 #7942
  • custom-element: support configurable app instance in defineCustomElement (6758c3c), closes #4356 #4635
  • custom-element: support css :host selector by applying css vars on host element (#8830) (03a9ea2), closes #8826
  • custom-element: support emit with options (e181bff), closes #7605
  • custom-element: support for expose on customElement (#6256) (af838c1), closes #5540
  • custom-element: support nonce option for injected style tags (bb4a02a), closes #6530
  • custom-element: support passing custom-element-specific options via 2nd argument of defineCustomElement (60a88a2)
  • custom-element: support shadowRoot: false in defineCustomElement() (37d2ce5), closes #4314 #4404
  • custom-element: useHost() helper (775103a)
  • custom-element: useShadowRoot() helper (5a1a89b), closes #6113 #8195
  • hydration: allow fine tuning of lazy hydration strategy triggers (#11530) (261c8b1)
  • reactivity/watch: add pause/resume for ReactiveEffect, EffectScope, and WatchHandle (#9651) (267093c)
  • reactivity: store value cache on CustomRefs impls (#11539) (e044b6e)
  • runtime-dom: Trusted Types compatibility (#10844) (6d4eb94)
  • support specifying allowed keys via generic argument in useTemplateRef() (1fbfa69)
  • types: allow computed getter and setter types to be unrelated (#11472) (a01675e), closes #7271
  • types: export MultiWatchSources type (#9563) (998dca5)
  • types: provide internal options for using refs type in language tools (#11492) (5ffd1a8)
  • watch: support passing number to deep option to control the watch depth (#9572) (22f7d96)

3.5.0-alpha.5 (2024-07-31)

Features

  • hydration: support suppressing hydration mismatch via data-allow-mismatch (94fb2b8)
  • lazy hydration strategies for async components (#11458) (d14a11c)

3.5.0-alpha.4 (2024-07-24)

Bug Fixes

  • suspense/hydration: fix hydration timing of async component inside suspense (1b8e197), closes #6638
  • useId: properly mark async boundary for already resolved async component (cd28172)

3.5.0-alpha.3 (2024-07-19)

Bug Fixes

  • build: enable SSR branches in esm-browser builds (b14cd9a)
  • compiler-core: change node hoisting to caching per instance (#11067) (cd0ea0d), closes #5256 #9219 #10959
  • compiler-sfc: should properly walk desutructured props when reactive destructure is not enabled (0fd6193), closes #11325
  • types: respect props with default on instance type when using __typeProps (96e4738)

Features

3.5.0-alpha.2 (2024-05-04)

Bug Fixes

  • types: fix app.component() typing with inline defineComponent (908f70a), closes #10843
  • types: fix compat with generated types that rely on CreateComponentPublicInstance (c146186), closes #10842
  • types: props in defineOptions type should be optional (124c4ca), closes #10841

Features

  • runtime-core: add app.onUnmount() for registering cleanup functions (#4619) (582a3a3), closes #4516

3.5.0-alpha.1 (2024-04-29)

Bug Fixes

  • reactivity: fix call sequence of ontrigger in effect (#10501) (28841fe)

Features

  • compiler-sfc: enable reactive props destructure by default (d2dac0e)
  • reactivity: onEffectCleanup API (2cc5615), closes #10173
  • reactivity: add failSilently argument for onScopeDispose (9a936aa)
  • transition: support directly nesting Teleport inside Transition (#6548) (0e6e3c7), closes #5836
  • types: provide internal options for directly using user types in language tools (#10801) (75c8cf6)

Performance Improvements

Previous Changelogs

3.4.x (2023-10-28 - 2024-08-15)

See 3.4 changelog

3.3.x (2023-02-05 - 2023-12-29)

See 3.3 changelog

3.2.x (2021-07-16 - 2023-02-02)

See 3.2 changelog

3.1.x (2021-05-08 - 2021-07-16)

See 3.1 changelog

3.0.x (2019-12-20 - 2021-04-01)

See 3.0 changelog