Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.3
Choose a base ref
...
head repository: vuejs/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.4
Choose a head ref

Commits on Nov 25, 2020

  1. chore: changelog [ci skip]

    yyx990803 committed Nov 25, 2020
    Copy the full SHA
    fc53677 View commit details

Commits on Nov 26, 2020

  1. Copy the full SHA
    a764814 View commit details
  2. Copy the full SHA
    73cdb9d View commit details
  3. Copy the full SHA
    426a6c9 View commit details
  4. Copy the full SHA
    cf7f1db View commit details
  5. Copy the full SHA
    ce4915d View commit details

Commits on Nov 27, 2020

  1. Copy the full SHA
    735af1c View commit details
  2. Copy the full SHA
    ef59a30 View commit details
  3. Copy the full SHA
    7cd85be View commit details
  4. Copy the full SHA
    53f4885 View commit details
  5. Copy the full SHA
    3470308 View commit details
  6. fix: allow hmr in all builds

    close #2571
    yyx990803 committed Nov 27, 2020
    Copy the full SHA
    46d80f4 View commit details
  7. Copy the full SHA
    55d99d7 View commit details
  8. Copy the full SHA
    a5d6f80 View commit details
  9. Copy the full SHA
    5b62662 View commit details
  10. Copy the full SHA
    0ff2a4f View commit details
  11. Copy the full SHA
    6e46a57 View commit details
  12. Copy the full SHA
    2ab8c41 View commit details
  13. Copy the full SHA
    3532b2b View commit details
  14. fix(attr-fallthrough): ensure consistent attr fallthrough for root fr…

    …agments with comments
    
    fix #2549
    yyx990803 committed Nov 27, 2020
    Copy the full SHA
    3bc2914 View commit details
  15. Copy the full SHA
    a76e58e View commit details

Commits on Nov 28, 2020

  1. fix(compiler-sfc): should not remove import statements with no specif…

    …ier when compiling script setup
    yyx990803 committed Nov 28, 2020
    Copy the full SHA
    43eab92 View commit details

Commits on Nov 30, 2020

  1. Copy the full SHA
    29d256c View commit details
  2. feat(sfc): allow sfcs to recursively self-reference in template via n…

    …ame inferred from filename
    
    e.g. A file named `FooBar.vue` can refer to itself as `<FooBar/>`. This gets rid of the need for the `name` option.
    yyx990803 committed Nov 30, 2020
    Copy the full SHA
    67d1aac View commit details
  3. Copy the full SHA
    421205d View commit details
  4. Copy the full SHA
    2a9ba0c View commit details
  5. Copy the full SHA
    bf16a57 View commit details
  6. Copy the full SHA
    5f2a853 View commit details
  7. Copy the full SHA
    e41b46c View commit details
  8. Copy the full SHA
    9db7095 View commit details
  9. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3cd30c5 View commit details
  10. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e4f09c1 View commit details
  11. Copy the full SHA
    7a1a782 View commit details
  12. Copy the full SHA
    cd92836 View commit details
  13. fix(v-model): mutate original array for v-model multi checkbox (#2663)

    Note: this change will break non-deep `watch` on the `v-model` bound array since the array is no longer replaced. This can be considered part of the Array watch changes in v3 as detailed at https://v3.vuejs.org/guide/migration/watch.html
    
    This is unfortunate but unavoidable since the issue that it fixes is more important: `v-model` should definitely work with a non-ref reactive array.
    
    fix #2662
    HcySunYang authored Nov 30, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    87581cd View commit details
  14. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    64d4681 View commit details

Commits on Dec 1, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fb6b9f8 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5a19bb5 View commit details
  3. chore: fix setRef usage

    yyx990803 committed Dec 1, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4307610 View commit details
  4. chore: fix snapshot

    yyx990803 committed Dec 1, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    11a76eb View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    83a79a8 View commit details
  6. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f2b0a8e View commit details
  7. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    085bbd5 View commit details
  8. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    48f00c0 View commit details
  9. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fe5428d View commit details

Commits on Dec 2, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5ad6ed3 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eaf8a67 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    20a704f View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e2618a6 View commit details
  5. build(deps): bump @babel/types from 7.12.1 to 7.12.7 (#2658)

    Bumps [@babel/types](https://github.com/babel/babel/tree/HEAD/packages/babel-types) from 7.12.1 to 7.12.7.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.12.7/packages/babel-types)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    
    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    dependabot-preview[bot] authored Dec 2, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3f94533 View commit details
Showing with 1,540 additions and 523 deletions.
  1. +52 −1 CHANGELOG.md
  2. +5 −5 package.json
  3. +3 −3 packages/compiler-core/__tests__/__snapshots__/scopeId.spec.ts.snap
  4. +19 −0 packages/compiler-core/__tests__/transform.spec.ts
  5. +2 −2 packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap
  6. +13 −13 packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap
  7. +11 −3 packages/compiler-core/__tests__/transforms/transformElement.spec.ts
  8. +13 −1 packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts
  9. +41 −1 packages/compiler-core/__tests__/transforms/vOn.spec.ts
  10. +24 −6 packages/compiler-core/__tests__/transforms/vSlot.spec.ts
  11. +2 −2 packages/compiler-core/package.json
  12. +6 −5 packages/compiler-core/src/options.ts
  13. +21 −5 packages/compiler-core/src/transform.ts
  14. +10 −1 packages/compiler-core/src/transforms/transformElement.ts
  15. +5 −3 packages/compiler-core/src/transforms/transformExpression.ts
  16. +26 −15 packages/compiler-core/src/transforms/transformSlotOutlet.ts
  17. +2 −1 packages/compiler-core/src/transforms/transformText.ts
  18. +6 −4 packages/compiler-core/src/transforms/vFor.ts
  19. +4 −3 packages/compiler-core/src/transforms/vIf.ts
  20. +8 −3 packages/compiler-core/src/transforms/vOn.ts
  21. +5 −2 packages/compiler-core/src/transforms/vSlot.ts
  22. +3 −3 packages/compiler-dom/package.json
  23. +11 −3 packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
  24. +9 −4 packages/compiler-sfc/__tests__/compileScript.spec.ts
  25. +12 −0 packages/compiler-sfc/__tests__/parse.spec.ts
  26. +6 −6 packages/compiler-sfc/package.json
  27. +7 −5 packages/compiler-sfc/src/compileScript.ts
  28. +20 −20 packages/compiler-sfc/src/parse.ts
  29. +94 −14 packages/compiler-ssr/__tests__/ssrComponent.spec.ts
  30. +15 −3 packages/compiler-ssr/__tests__/ssrElement.spec.ts
  31. +1 −1 packages/compiler-ssr/__tests__/ssrInjectCssVars.spec.ts
  32. +5 −5 packages/compiler-ssr/__tests__/ssrScopeId.spec.ts
  33. +2 −2 packages/compiler-ssr/__tests__/ssrSuspense.spec.ts
  34. +33 −1 packages/compiler-ssr/__tests__/ssrVModel.spec.ts
  35. +3 −3 packages/compiler-ssr/package.json
  36. +4 −3 packages/compiler-ssr/src/ssrCodegenTransform.ts
  37. +4 −1 packages/compiler-ssr/src/transforms/ssrTransformComponent.ts
  38. +25 −1 packages/compiler-ssr/src/transforms/ssrTransformElement.ts
  39. +41 −0 packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts
  40. +14 −5 packages/compiler-ssr/src/transforms/ssrVFor.ts
  41. +14 −4 packages/compiler-ssr/src/transforms/ssrVIf.ts
  42. +28 −11 packages/compiler-ssr/src/transforms/ssrVModel.ts
  43. +6 −0 packages/reactivity/__tests__/collections/Map.spec.ts
  44. +6 −0 packages/reactivity/__tests__/collections/Set.spec.ts
  45. +5 −0 packages/reactivity/__tests__/collections/WeakMap.spec.ts
  46. +6 −0 packages/reactivity/__tests__/collections/WeakSet.spec.ts
  47. +10 −0 packages/reactivity/__tests__/readonly.spec.ts
  48. +2 −2 packages/reactivity/package.json
  49. +2 −1 packages/reactivity/src/baseHandlers.ts
  50. +4 −4 packages/reactivity/src/collectionHandlers.ts
  51. +5 −1 packages/reactivity/src/ref.ts
  52. +45 −0 packages/runtime-core/__tests__/apiAsyncComponent.spec.ts
  53. +15 −3 packages/runtime-core/__tests__/apiOptions.spec.ts
  54. +49 −0 packages/runtime-core/__tests__/apiSetupHelpers.spec.ts
  55. +61 −3 packages/runtime-core/__tests__/apiWatch.spec.ts
  56. +12 −1 packages/runtime-core/__tests__/componentEmits.spec.ts
  57. +32 −0 packages/runtime-core/__tests__/components/Suspense.spec.ts
  58. +34 −2 packages/runtime-core/__tests__/components/Teleport.spec.ts
  59. +29 −1 packages/runtime-core/__tests__/helpers/renderSlot.spec.ts
  60. +11 −5 packages/runtime-core/__tests__/rendererAttrsFallthrough.spec.ts
  61. +44 −1 packages/runtime-core/__tests__/rendererComponent.spec.ts
  62. +1 −1 packages/runtime-core/__tests__/vnode.spec.ts
  63. +3 −3 packages/runtime-core/package.json
  64. +11 −4 packages/runtime-core/src/apiAsyncComponent.ts
  65. +1 −1 packages/runtime-core/src/apiInject.ts
  66. +14 −6 packages/runtime-core/src/apiSetupHelpers.ts
  67. +1 −1 packages/runtime-core/src/apiWatch.ts
  68. +13 −6 packages/runtime-core/src/component.ts
  69. +4 −3 packages/runtime-core/src/componentEmits.ts
  70. +2 −2 packages/runtime-core/src/componentOptions.ts
  71. +11 −1 packages/runtime-core/src/componentPublicInstance.ts
  72. +31 −22 packages/runtime-core/src/componentRenderUtils.ts
  73. +1 −1 packages/runtime-core/src/components/BaseTransition.ts
  74. +1 −1 packages/runtime-core/src/components/KeepAlive.ts
  75. +5 −6 packages/runtime-core/src/components/Suspense.ts
  76. +7 −1 packages/runtime-core/src/components/Teleport.ts
  77. +2 −2 packages/runtime-core/src/customFormatter.ts
  78. +23 −6 packages/runtime-core/src/helpers/renderSlot.ts
  79. +6 −0 packages/runtime-core/src/helpers/resolveAssets.ts
  80. +1 −1 packages/runtime-core/src/hmr.ts
  81. +2 −2 packages/runtime-core/src/hydration.ts
  82. +27 −44 packages/runtime-core/src/renderer.ts
  83. +4 −4 packages/runtime-core/src/vnode.ts
  84. +15 −9 packages/runtime-dom/__tests__/directives/vModel.spec.ts
  85. +17 −0 packages/runtime-dom/__tests__/patchProps.spec.ts
  86. +3 −3 packages/runtime-dom/package.json
  87. +38 −26 packages/runtime-dom/src/components/Transition.ts
  88. +16 −6 packages/runtime-dom/src/directives/vModel.ts
  89. +1 −2 packages/runtime-dom/src/directives/vShow.ts
  90. +31 −19 packages/runtime-dom/src/modules/props.ts
  91. +3 −3 packages/runtime-test/package.json
  92. +4 −4 packages/server-renderer/package.json
  93. +1 −1 packages/shared/package.json
  94. +99 −60 packages/shared/src/patchFlags.ts
  95. +9 −0 packages/shared/src/slotFlags.ts
  96. +1 −1 packages/size-check/package.json
  97. +1 −1 packages/template-explorer/package.json
  98. +2 −2 packages/template-explorer/src/index.ts
  99. +2 −1 packages/vue/__tests__/Transition.spec.ts
  100. +10 −9 packages/vue/__tests__/TransitionGroup.spec.ts
  101. +4 −4 packages/vue/package.json
  102. +2 −1 rollup.config.js
  103. +25 −2 test-dts/ref.test-d.ts
  104. +78 −53 yarn.lock
53 changes: 52 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
## [3.0.4](https://github.com/vuejs/vue-next/compare/v3.0.3...v3.0.4) (2020-12-02)


### Bug Fixes

* **async-component:** forward refs on async component wrapper ([64d4681](https://github.com/vuejs/vue-next/commit/64d4681e4b9d88e17cd1515014866d43d0424d14)), closes [#2671](https://github.com/vuejs/vue-next/issues/2671)
* **attr-fallthrough:** ensure consistent attr fallthrough for root fragments with comments ([3bc2914](https://github.com/vuejs/vue-next/commit/3bc2914e32b030b1247659f871f6055827154087)), closes [#2549](https://github.com/vuejs/vue-next/issues/2549)
* **build:** enable safari10 option for terser ([#2472](https://github.com/vuejs/vue-next/issues/2472)) ([20a704f](https://github.com/vuejs/vue-next/commit/20a704fc043b29c3c9baac602211c595ede728cf)), closes [#2470](https://github.com/vuejs/vue-next/issues/2470)
* **compiler-core:** fix scope var reference check for v-on expressions ([9db7095](https://github.com/vuejs/vue-next/commit/9db70959621c7df44807324a3b1a41caa2b261eb)), closes [#2564](https://github.com/vuejs/vue-next/issues/2564)
* **compiler-core:** fix unintended imports in esm-bundler builds ([55d99d7](https://github.com/vuejs/vue-next/commit/55d99d729e147fae515c12148590f0100508c49d)), closes [#2258](https://github.com/vuejs/vue-next/issues/2258) [#2515](https://github.com/vuejs/vue-next/issues/2515)
* **compiler-core:** transform kebab case props to camelcase on slots ([#2490](https://github.com/vuejs/vue-next/issues/2490)) ([ef59a30](https://github.com/vuejs/vue-next/commit/ef59a30cabd12f6f14fee210a7fe49bccd3fd86c)), closes [#2488](https://github.com/vuejs/vue-next/issues/2488)
* **compiler-core/v-on:** handle falsy values when caching v-on handlers ([e4f09c1](https://github.com/vuejs/vue-next/commit/e4f09c1419352c18a60a5930d9526d916d1323d3)), closes [#2605](https://github.com/vuejs/vue-next/issues/2605)
* **compiler-sfc:** fix parsing error when `lang=""` is used on plain element ([#2569](https://github.com/vuejs/vue-next/issues/2569)) ([5f2a853](https://github.com/vuejs/vue-next/commit/5f2a8533acc332528faedb2d1b6ecdae104087a4)), closes [#2566](https://github.com/vuejs/vue-next/issues/2566)
* **compiler-sfc:** named imports from .vue file should not be treated as constant ([085bbd5](https://github.com/vuejs/vue-next/commit/085bbd5fe07c52056e9f7151fbaed8f6a2e442b3)), closes [#2699](https://github.com/vuejs/vue-next/issues/2699)
* **compiler-sfc:** should not remove import statements with no specifier when compiling script setup ([43eab92](https://github.com/vuejs/vue-next/commit/43eab923ea651079181490d191966ff28988e9c8))
* **compiler-ssr:** generate correct children for transition-group ([a5d6f80](https://github.com/vuejs/vue-next/commit/a5d6f8091e3761447b7fec0e3d1346eb83402a0a)), closes [#2510](https://github.com/vuejs/vue-next/issues/2510)
* **compiler-ssr:** handle v-model checkbox with true-value binding ([fe5428d](https://github.com/vuejs/vue-next/commit/fe5428db1207747886957b831d46d71ecb6fadaa))
* **compiler-ssr:** should not render key/ref bindings in ssr ([5b62662](https://github.com/vuejs/vue-next/commit/5b6266284da01008e2f68ed353a622adc5704261))
* **provide:** support symbols in applyOptions ([#2616](https://github.com/vuejs/vue-next/issues/2616)) ([7a1a782](https://github.com/vuejs/vue-next/commit/7a1a782642a13d5fcc6b8c738a5ce8f8c657e1b5)), closes [#2615](https://github.com/vuejs/vue-next/issues/2615)
* **reactivity:** ensure readonly on plain arrays doesn't track array methods. ([#2506](https://github.com/vuejs/vue-next/issues/2506)) ([3470308](https://github.com/vuejs/vue-next/commit/34703082fd5afacee774ee92c11753119032ed1a)), closes [#2493](https://github.com/vuejs/vue-next/issues/2493)
* **reactivity:** ensure add/set on reactive collections return the proxy ([#2534](https://github.com/vuejs/vue-next/issues/2534)) ([6e46a57](https://github.com/vuejs/vue-next/commit/6e46a574eddb5fa43c8a4ce10c620ecdf1caf3b8)), closes [#2530](https://github.com/vuejs/vue-next/issues/2530)
* **runtime-core:** ensure keep-alive deep-watches include/explude props ([#2551](https://github.com/vuejs/vue-next/issues/2551)) ([421205d](https://github.com/vuejs/vue-next/commit/421205d0ad1ab187ff72be754e38c7228230eb60)), closes [#2550](https://github.com/vuejs/vue-next/issues/2550)
* **runtime-core:** ensure watchers are always registered to correct instance owner ([#2495](https://github.com/vuejs/vue-next/issues/2495)) ([735af1c](https://github.com/vuejs/vue-next/commit/735af1c7b7e764c410b8dd671eaaa9a72f09ea3f)), closes [#2381](https://github.com/vuejs/vue-next/issues/2381)
* **runtime-core:** fix emit listener check on kebab-case events ([#2542](https://github.com/vuejs/vue-next/issues/2542)) ([3532b2b](https://github.com/vuejs/vue-next/commit/3532b2b0213268a285cacce9b38f806e6af29a61)), closes [#2540](https://github.com/vuejs/vue-next/issues/2540)
* **runtime-core:** handle static node move in production ([bf16a57](https://github.com/vuejs/vue-next/commit/bf16a57fc3d23118c670918348f02457cfcc44d6))
* **runtime-core:** remove static node in production mode ([#2556](https://github.com/vuejs/vue-next/issues/2556)) ([2a9ba0c](https://github.com/vuejs/vue-next/commit/2a9ba0c8e961ed6c68a8008ccbef85ff2cabeeb2)), closes [#2553](https://github.com/vuejs/vue-next/issues/2553)
* **runtime-core:** should pause tracking when initializing legacy options ([#2524](https://github.com/vuejs/vue-next/issues/2524)) ([0ff2a4f](https://github.com/vuejs/vue-next/commit/0ff2a4f1c1847a4e173dcab810e6438143a4272c)), closes [#2521](https://github.com/vuejs/vue-next/issues/2521)
* **runtime-core:** skip functional components in public $parent chain traversal ([53f4885](https://github.com/vuejs/vue-next/commit/53f4885d9e06f1b1b0b33abc8f1c20766cbb2d1a)), closes [#2437](https://github.com/vuejs/vue-next/issues/2437)
* **runtime-dom:** attribute should be removed with nullish values ([#2679](https://github.com/vuejs/vue-next/issues/2679)) ([fb6b9f8](https://github.com/vuejs/vue-next/commit/fb6b9f8e8ff35ca4d8723a9f96e36266de0dd947)), closes [#2677](https://github.com/vuejs/vue-next/issues/2677)
* **script-setup:** ensure useContext() return valid context ([73cdb9d](https://github.com/vuejs/vue-next/commit/73cdb9d4208f887fe08349657122e39175d7166c))
* **slots:** dynamically named slots should be keyed by name ([2ab8c41](https://github.com/vuejs/vue-next/commit/2ab8c41a1a43952fb229587a9da48d9a1214ab9e)), closes [#2535](https://github.com/vuejs/vue-next/issues/2535)
* **slots:** should render fallback content when slot content contains no valid nodes ([#2485](https://github.com/vuejs/vue-next/issues/2485)) ([ce4915d](https://github.com/vuejs/vue-next/commit/ce4915d8bed12f4cdb5fa8ca39bda98d0d3aabb7)), closes [#2347](https://github.com/vuejs/vue-next/issues/2347) [#2461](https://github.com/vuejs/vue-next/issues/2461)
* **suspense:** fix nested async child toggle inside already resovled suspense ([cf7f1db](https://github.com/vuejs/vue-next/commit/cf7f1dbc9be8d50ad220e3630c38f5a9a217d693)), closes [#2215](https://github.com/vuejs/vue-next/issues/2215)
* **teleport:** Teleport into SVG elements ([#2648](https://github.com/vuejs/vue-next/issues/2648)) ([cd92836](https://github.com/vuejs/vue-next/commit/cd928362232747a51d1fd4790bb20adcdd59d187)), closes [#2652](https://github.com/vuejs/vue-next/issues/2652)
* **transition:** avoid invoking stale transition end callbacks ([eaf8a67](https://github.com/vuejs/vue-next/commit/eaf8a67c7219e1b79d6abca44a1d7f1b341b58b0)), closes [#2482](https://github.com/vuejs/vue-next/issues/2482)
* **transition:** respect rules in *-leave-from transition class ([#2597](https://github.com/vuejs/vue-next/issues/2597)) ([e2618a6](https://github.com/vuejs/vue-next/commit/e2618a632d4add2819ffb8b575af0da189dc3204)), closes [#2593](https://github.com/vuejs/vue-next/issues/2593)
* **types:** fix ToRefs type on union value types ([e315d84](https://github.com/vuejs/vue-next/commit/e315d84936c82bee8f2cf2369c61b5aaec38f328)), closes [#2687](https://github.com/vuejs/vue-next/issues/2687)
* **v-model:** avoid mutation when using Set models + fix multi select Set model update ([f2b0a8e](https://github.com/vuejs/vue-next/commit/f2b0a8e81d15eb8017c7fca5c1dff0e5f6a5573e))
* **v-model:** respect checkbox true-value/false-value on initial render ([48f00c0](https://github.com/vuejs/vue-next/commit/48f00c0f1b574a235be40c560d2cf373be97615e)), closes [#2694](https://github.com/vuejs/vue-next/issues/2694)
* **v-show:** ensure v-show conflict with inline string style binding ([3cd30c5](https://github.com/vuejs/vue-next/commit/3cd30c5245da0733f9eb6f29d220f39c46518162)), closes [#2583](https://github.com/vuejs/vue-next/issues/2583)
* allow hmr in all builds ([46d80f4](https://github.com/vuejs/vue-next/commit/46d80f4d585195446e7f8cf4ba42d00a98e9ee5d)), closes [#2571](https://github.com/vuejs/vue-next/issues/2571)


### Features

* **sfc:** allow sfcs to recursively self-reference in template via name inferred from filename ([67d1aac](https://github.com/vuejs/vue-next/commit/67d1aac6ae683a3a7291dff15071d1eeacb7d22a))



## [3.0.3](https://github.com/vuejs/vue-next/compare/v3.0.2...v3.0.3) (2020-11-25)


@@ -14,7 +63,9 @@
* **types:** ensure correct type for toRef and toRefs on existing refs ([8e20375](https://github.com/vuejs/vue-next/commit/8e2037537219219d5ab6456e8a29bd0235eac311))


### Features
### Experimental Features

> Note: support for experimental features in SFCs have been updated according to changes in ongoing RFCs. This release may break existing usage of such experimental features.
* **compiler-sfc:** compileScript inline render function mode ([886ed76](https://github.com/vuejs/vue-next/commit/886ed7681dd203c07ff3b504538328f43e14d9b0))
* **compiler-sfc:** new script setup implementation ([556560f](https://github.com/vuejs/vue-next/commit/556560fae31d9e406cfae656089657b6332686c1))
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "3.0.3",
"version": "3.0.4",
"workspaces": [
"packages/*"
],
@@ -45,12 +45,12 @@
"@babel/types": "^7.12.0",
"@ls-lint/ls-lint": "^1.9.2",
"@microsoft/api-extractor": "^7.9.15",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.2.1",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@types/hash-sum": "^1.0.0",
"@types/jest": "^26.0.0",
"@types/jest": "^26.0.16",
"@types/node": "^14.10.1",
"@types/puppeteer": "^2.0.0",
"@typescript-eslint/parser": "^4.1.1",
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
default: _withId(() => [
_createVNode(\\"div\\")
]),
_: 1
_: 1 /* STABLE */
}))
})"
`;
@@ -41,7 +41,7 @@ const _withId = /*#__PURE__*/_withScopeId(\\"test\\")
export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
const _component_Child = _resolveComponent(\\"Child\\")
return (_openBlock(), _createBlock(_component_Child, null, _createSlots({ _: 2 }, [
return (_openBlock(), _createBlock(_component_Child, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
(_ctx.ok)
? {
name: \\"foo\\",
@@ -76,7 +76,7 @@ export const render = /*#__PURE__*/_withId((_ctx, _cache) => {
bar: _withId(() => [
_createVNode(\\"div\\")
]),
_: 1
_: 1 /* STABLE */
}))
})"
`;
19 changes: 19 additions & 0 deletions packages/compiler-core/__tests__/transform.spec.ts
Original file line number Diff line number Diff line change
@@ -342,5 +342,24 @@ describe('compiler: transform', () => {
)
)
})

test('multiple children w/ single root + comments', () => {
const ast = transformWithCodegen(`<!--foo--><div/><!--bar-->`)
expect(ast.codegenNode).toMatchObject(
createBlockMatcher(
FRAGMENT,
undefined,
[
{ type: NodeTypes.COMMENT },
{ type: NodeTypes.ELEMENT, tag: `div` },
{ type: NodeTypes.COMMENT }
] as any,
genFlagText([
PatchFlags.STABLE_FRAGMENT,
PatchFlags.DEV_ROOT_FRAGMENT
])
)
)
})
})
})
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ export function render(_ctx, _cache) {
return (_openBlock(), _createBlock(\\"div\\", null, [
_createVNode(\\"div\\", null, [
_createVNode(\\"div\\", {
onClick: _cache[1] || (_cache[1] = (...args) => (_ctx.foo(...args)))
onClick: _cache[1] || (_cache[1] = (...args) => (_ctx.foo && _ctx.foo(...args)))
})
])
]))
@@ -247,7 +247,7 @@ return function render(_ctx, _cache) {
default: _withCtx(({ foo }) => [
_createTextVNode(_toDisplayString(_ctx.foo), 1 /* TEXT */)
]),
_: 1
_: 1 /* STABLE */
}))
}
}"
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_component_Comp, null, {
[_ctx.one]: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
[_ctx.two]: _withCtx(({ bar }) => [_toDisplayString(_ctx.foo), _toDisplayString(bar)]),
_: 2
_: 2 /* DYNAMIC */
}, 1024 /* DYNAMIC_SLOTS */))
}"
`;
@@ -24,7 +24,7 @@ return function render(_ctx, _cache) {
default: _withCtx(() => [
_createVNode(\\"div\\")
]),
_: 1
_: 1 /* STABLE */
}))
}"
`;
@@ -35,7 +35,7 @@ exports[`compiler: transform component slots named slot with v-for w/ prefixIden
return function render(_ctx, _cache) {
const _component_Comp = _resolveComponent(\\"Comp\\")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 }, [
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
_renderList(_ctx.list, (name) => {
return {
name: name,
@@ -52,7 +52,7 @@ exports[`compiler: transform component slots named slot with v-if + prefixIdenti
return function render(_ctx, _cache) {
const _component_Comp = _resolveComponent(\\"Comp\\")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 }, [
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
(_ctx.ok)
? {
name: \\"one\\",
@@ -72,7 +72,7 @@ return function render(_ctx, _cache) {
const _component_Comp = _resolveComponent(\\"Comp\\")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 }, [
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
ok
? {
name: \\"one\\",
@@ -101,7 +101,7 @@ return function render(_ctx, _cache) {
const _component_Comp = _resolveComponent(\\"Comp\\")
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 }, [
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
ok
? {
name: \\"one\\",
@@ -128,7 +128,7 @@ return function render(_ctx, _cache) {
\\"bar\\",
_createVNode(\\"span\\")
]),
_: 1
_: 1 /* STABLE */
}))
}
}"
@@ -145,14 +145,14 @@ return function render(_ctx, _cache) {
default: _withCtx(({ foo }) => [
_createVNode(_component_Inner, null, {
default: _withCtx(({ bar }) => [_toDisplayString(foo), _toDisplayString(bar), _toDisplayString(_ctx.baz)]),
_: 2
_: 2 /* DYNAMIC */
}, 1024 /* DYNAMIC_SLOTS */),
\\" \\",
_toDisplayString(foo),
_toDisplayString(_ctx.bar),
_toDisplayString(_ctx.baz)
]),
_: 1
_: 1 /* STABLE */
}))
}"
`;
@@ -165,7 +165,7 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_component_Comp, null, {
[_ctx.named]: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
_: 2
_: 2 /* DYNAMIC */
}, 1024 /* DYNAMIC_SLOTS */))
}"
`;
@@ -178,7 +178,7 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_component_Comp, null, {
named: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
_: 1
_: 1 /* STABLE */
}))
}"
`;
@@ -191,7 +191,7 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_component_Comp, null, {
default: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
_: 1
_: 1 /* STABLE */
}))
}"
`;
@@ -205,7 +205,7 @@ return function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_component_Comp, null, {
one: _withCtx(({ foo }) => [_toDisplayString(foo), _toDisplayString(_ctx.bar)]),
two: _withCtx(({ bar }) => [_toDisplayString(_ctx.foo), _toDisplayString(bar)]),
_: 1
_: 1 /* STABLE */
}))
}"
`;
Original file line number Diff line number Diff line change
@@ -70,6 +70,14 @@ describe('compiler: element transform', () => {
expect(root.components).toContain(`Foo`)
})

test('resolve implcitly self-referencing component', () => {
const { root } = parseWithElementTransform(`<Example/>`, {
filename: `/foo/bar/Example.vue?vue&type=template`
})
expect(root.helpers).toContain(RESOLVE_COMPONENT)
expect(root.components).toContain(`_self`)
})

test('static props', () => {
const { node } = parseWithElementTransform(`<div id="foo" class="bar" />`)
expect(node).toMatchObject({
@@ -321,13 +329,13 @@ describe('compiler: element transform', () => {
fallback: {
type: NodeTypes.JS_FUNCTION_EXPRESSION
},
_: `[1]`
_: `[1 /* STABLE */]`
})
: createObjectMatcher({
default: {
type: NodeTypes.JS_FUNCTION_EXPRESSION
},
_: `[1]`
_: `[1 /* STABLE */]`
})
})
}
@@ -381,7 +389,7 @@ describe('compiler: element transform', () => {
default: {
type: NodeTypes.JS_FUNCTION_EXPRESSION
},
_: `[1]`
_: `[1 /* STABLE */]`
})
})
}
Original file line number Diff line number Diff line change
@@ -95,7 +95,9 @@ describe('compiler: transform <slot> outlets', () => {
})

test('default slot outlet with props', () => {
const ast = parseWithSlots(`<slot foo="bar" :baz="qux" />`)
const ast = parseWithSlots(
`<slot foo="bar" :baz="qux" :foo-bar="foo-bar" />`
)
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
@@ -124,6 +126,16 @@ describe('compiler: transform <slot> outlets', () => {
content: `qux`,
isStatic: false
}
},
{
key: {
content: `fooBar`,
isStatic: true
},
value: {
content: `foo-bar`,
isStatic: false
}
}
]
}
Loading