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.2.41
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.2.42
Choose a head ref

Commits on Oct 20, 2022

  1. Copy the full SHA
    bc167b5 View commit details
  2. fix(types): ensure createBlock() helper accepts Teleport and Supsense…

    … types (fix: #2855) (#5458)
    
    Co-authored-by: Carlos Rodrigues <carlos@hypermob.co.uk>
    LinusBorg and pikax authored Oct 20, 2022
    Copy the full SHA
    e5fc7dc View commit details

Commits on Oct 21, 2022

  1. fix(reactivity): enable trigger when use str to set length of arr (#6810

    )
    
    Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
    bcq028 and antfu authored Oct 21, 2022
    Copy the full SHA
    e6224f4 View commit details

Commits on Oct 22, 2022

  1. fix(runtime-core): ensure props definition objects are not mutated du…

    …ring props normalization (close: #6915) (#6916)
    LinusBorg authored Oct 22, 2022
    Copy the full SHA
    54b6ba3 View commit details
  2. Copy the full SHA
    b0b74a1 View commit details

Commits on Oct 26, 2022

  1. Copy the full SHA
    cbc3e67 View commit details
  2. Copy the full SHA
    8e792d9 View commit details
  3. Copy the full SHA
    d9de6ca View commit details
  4. fix(compiler-ssr): fix invalid codegen when v-slot name is explicit e…

    …mpty attr (#3326)
    
    squashed from fix by @tjk
    yyx990803 committed Oct 26, 2022
    Copy the full SHA
    09bb3e9 View commit details
  5. Copy the full SHA
    e816812 View commit details
  6. Copy the full SHA
    183e4e6 View commit details
  7. Copy the full SHA
    83f7e6f View commit details
  8. Copy the full SHA
    506a42a View commit details
  9. Copy the full SHA
    eab7604 View commit details
  10. Copy the full SHA
    41d9c47 View commit details
  11. chore: fix snapshot

    yyx990803 committed Oct 26, 2022
    Copy the full SHA
    bb06819 View commit details
  12. Copy the full SHA
    018b850 View commit details
  13. fix(runtime-core): in operator returning false for built-in insta…

    …nce properties in `exposeProxy` (#6138)
    
    fix #6137
    DrJume authored Oct 26, 2022
    Copy the full SHA
    32b5124 View commit details
  14. Copy the full SHA
    0e09761 View commit details
  15. ci: bump actions versions

    yyx990803 committed Oct 26, 2022
    1
    Copy the full SHA
    e3bc21f View commit details

Commits on Oct 27, 2022

  1. ci: fix pnpm action version

    yyx990803 committed Oct 27, 2022
    Copy the full SHA
    830454a View commit details

Commits on Oct 28, 2022

  1. Copy the full SHA
    bbb66d7 View commit details
  2. fix:spell checker (#6982)

    Co-authored-by: hakim <hakim.lu@yunlsp.com>
    HakimLu and hakim authored Oct 28, 2022
    Copy the full SHA
    3bed82b View commit details

Commits on Nov 1, 2022

  1. fix(runtime-dom): ensure customElement handles empty props correctly. (

    …#6182)
    
    fix Scoped attribute in Vue file affects the use of web component #6163,#6895
    LinusBorg authored Nov 1, 2022
    Copy the full SHA
    f67bb50 View commit details

Commits on Nov 8, 2022

  1. Copy the full SHA
    c4f213b View commit details
  2. fix(types): export Raw type (#6380)

    fix #7048
    sxzz authored Nov 8, 2022
    Copy the full SHA
    e9172db View commit details
  3. Copy the full SHA
    97aadd8 View commit details
  4. Copy the full SHA
    b72a4af View commit details
  5. fix(runtime-core): do not throw on unknown directives (#6671)

    fix #6340
    
    This commit improves the case when a directive is not found in a template.
    As `resolveDirective` returns `undefined`, some code was failing with the following error:
    
    ```
    TypeError: Cannot read properties of undefined (reading 'deep')
    ```
    cexbrayat authored Nov 8, 2022
    Copy the full SHA
    0455378 View commit details
  6. fix(ssr): remove css number value check (#6636)

    Previously this prevented custom properties and vendor-prefixed properties to be rendered correctly.
    
    fix #6625
    btea authored Nov 8, 2022
    Copy the full SHA
    79e7c1e View commit details
  7. Copy the full SHA
    168c857 View commit details
  8. chore: prettier

    yyx990803 committed Nov 8, 2022
    Copy the full SHA
    f55cfe6 View commit details
  9. Copy the full SHA
    2a9996c View commit details
  10. Copy the full SHA
    640cfce View commit details
  11. Copy the full SHA
    bcfe480 View commit details
  12. Copy the full SHA
    99b6697 View commit details
  13. Copy the full SHA
    9768949 View commit details
  14. 1
    Copy the full SHA
    a0c7f27 View commit details
  15. chore: fix snapshot

    yyx990803 committed Nov 8, 2022
    Copy the full SHA
    1c292e1 View commit details
  16. 1
    Copy the full SHA
    50e2253 View commit details
  17. Copy the full SHA
    e4de623 View commit details
  18. Copy the full SHA
    e049772 View commit details
  19. chore: run prettier

    yyx990803 committed Nov 8, 2022
    Copy the full SHA
    4c3203b View commit details
  20. Copy the full SHA
    bdaf83a View commit details
  21. Copy the full SHA
    9906e3a View commit details
  22. ci: disable format-check on ci

    this causes too many unintended fails on PR merges
    the task should just be manually run periodically
    yyx990803 committed Nov 8, 2022
    1
    Copy the full SHA
    b3916db View commit details
  23. Copy the full SHA
    fdc5902 View commit details
  24. Copy the full SHA
    4a00fdd View commit details
  25. Copy the full SHA
    8d1f526 View commit details
  26. Copy the full SHA
    6861d23 View commit details
Showing with 1,882 additions and 604 deletions.
  1. +19 −16 .github/workflows/ci.yml
  2. +1 −0 .prettierignore
  3. +48 −0 CHANGELOG.md
  4. +2 −1 package.json
  5. +11 −0 packages/compiler-core/__tests__/parse.spec.ts
  6. +26 −0 packages/compiler-core/__tests__/transforms/transformElement.spec.ts
  7. +39 −0 packages/compiler-core/__tests__/transforms/vIf.spec.ts
  8. +15 −0 packages/compiler-core/__tests__/transforms/vOn.spec.ts
  9. +52 −1 packages/compiler-core/__tests__/transforms/vSlot.spec.ts
  10. +2 −2 packages/compiler-core/package.json
  11. +2 −1 packages/compiler-core/src/index.ts
  12. +8 −3 packages/compiler-core/src/parse.ts
  13. +14 −12 packages/compiler-core/src/transforms/transformElement.ts
  14. +1 −1 packages/compiler-core/src/transforms/transformExpression.ts
  15. +2 −2 packages/compiler-core/src/transforms/vIf.ts
  16. +3 −3 packages/compiler-core/src/transforms/vOn.ts
  17. +19 −12 packages/compiler-core/src/utils.ts
  18. +3 −3 packages/compiler-dom/package.json
  19. +91 −24 packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
  20. +22 −3 packages/compiler-sfc/__tests__/__snapshots__/compileScriptPropsTransform.spec.ts.snap
  21. +4 −4 packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap
  22. +123 −3 packages/compiler-sfc/__tests__/compileScript.spec.ts
  23. +18 −0 packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts
  24. +16 −0 packages/compiler-sfc/__tests__/compileTemplate.spec.ts
  25. +14 −6 packages/compiler-sfc/__tests__/cssVars.spec.ts
  26. +11 −1 packages/compiler-sfc/__tests__/parse.spec.ts
  27. +6 −6 packages/compiler-sfc/package.json
  28. +269 −167 packages/compiler-sfc/src/compileScript.ts
  29. +5 −1 packages/compiler-sfc/src/cssVars.ts
  30. +9 −10 packages/compiler-sfc/src/parse.ts
  31. +5 −0 packages/compiler-ssr/__tests__/ssrComponent.spec.ts
  32. +3 −3 packages/compiler-ssr/package.json
  33. +4 −2 packages/compiler-ssr/src/transforms/ssrTransformComponent.ts
  34. +28 −7 packages/reactivity-transform/__tests__/__snapshots__/reactivityTransform.spec.ts.snap
  35. +29 −0 packages/reactivity-transform/__tests__/reactivityTransform.spec.ts
  36. +3 −3 packages/reactivity-transform/package.json
  37. +80 −32 packages/reactivity-transform/src/reactivityTransform.ts
  38. +16 −0 packages/reactivity/__tests__/effect.spec.ts
  39. +2 −2 packages/reactivity/package.json
  40. +3 −2 packages/reactivity/src/effect.ts
  41. +1 −0 packages/reactivity/src/index.ts
  42. +3 −3 packages/reactivity/src/reactive.ts
  43. +3 −4 packages/reactivity/src/ref.ts
  44. +6 −1 packages/runtime-core/__tests__/apiExpose.spec.ts
  45. +17 −0 packages/runtime-core/__tests__/apiWatch.spec.ts
  46. +22 −0 packages/runtime-core/__tests__/componentEmits.spec.ts
  47. +19 −0 packages/runtime-core/__tests__/componentProps.spec.ts
  48. +106 −16 packages/runtime-core/__tests__/components/BaseTransition.spec.ts
  49. +18 −1 packages/runtime-core/__tests__/directives.spec.ts
  50. +3 −3 packages/runtime-core/package.json
  51. +5 −2 packages/runtime-core/src/apiCreateApp.ts
  52. +20 −7 packages/runtime-core/src/apiDefineComponent.ts
  53. +5 −1 packages/runtime-core/src/apiSetupHelpers.ts
  54. +21 −5 packages/runtime-core/src/apiWatch.ts
  55. +3 −0 packages/runtime-core/src/component.ts
  56. +2 −1 packages/runtime-core/src/componentEmits.ts
  57. +56 −11 packages/runtime-core/src/componentOptions.ts
  58. +1 −1 packages/runtime-core/src/componentProps.ts
  59. +15 −7 packages/runtime-core/src/componentPublicInstance.ts
  60. +5 −1 packages/runtime-core/src/components/BaseTransition.ts
  61. +3 −1 packages/runtime-core/src/components/KeepAlive.ts
  62. +22 −20 packages/runtime-core/src/directives.ts
  63. +3 −3 packages/runtime-core/src/h.ts
  64. +4 −2 packages/runtime-core/src/index.ts
  65. +4 −1 packages/runtime-core/src/vnode.ts
  66. +19 −5 packages/runtime-dom/__tests__/customElement.spec.ts
  67. +3 −3 packages/runtime-dom/package.json
  68. +24 −10 packages/runtime-dom/src/apiCustomElement.ts
  69. +22 −9 packages/runtime-dom/src/components/Transition.ts
  70. +1 −1 packages/runtime-dom/types/jsx.d.ts
  71. +3 −3 packages/runtime-test/package.json
  72. +5 −3 packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts
  73. +30 −0 packages/server-renderer/__tests__/ssrWatch.spec.ts
  74. +4 −4 packages/server-renderer/package.json
  75. +7 −0 packages/server-renderer/src/render.ts
  76. +7 −0 packages/server-renderer/src/renderToStream.ts
  77. +6 −0 packages/server-renderer/src/renderToString.ts
  78. +2 −2 packages/sfc-playground/package.json
  79. +12 −1 packages/sfc-playground/src/App.vue
  80. +28 −1 packages/shared/__tests__/normalizeProp.spec.ts
  81. +1 −1 packages/shared/package.json
  82. +0 −15 packages/shared/src/domAttrConfig.ts
  83. +12 −12 packages/shared/src/normalizeProp.ts
  84. +2 −2 packages/shared/src/typeUtils.ts
  85. +1 −1 packages/size-check/package.json
  86. +1 −1 packages/template-explorer/package.json
  87. +2 −2 packages/vue-compat/package.json
  88. +4 −2 packages/vue/macros.d.ts
  89. +6 −6 packages/vue/package.json
  90. +27 −27 pnpm-lock.yaml
  91. +20 −0 test-dts/compiler.test-d.ts
  92. +9 −1 test-dts/componentTypeExtensions.test-d.tsx
  93. +62 −0 test-dts/defineComponent.test-d.tsx
  94. +63 −0 test-dts/defineCustomElement.test-d.ts
  95. +1 −2 test-dts/h.test-d.ts
  96. +73 −62 test-dts/reactivity.test-d.ts
  97. +13 −3 test-dts/setupHelpers.test-d.ts
  98. +17 −1 test-dts/watch.test-d.ts
35 changes: 19 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -14,15 +14,15 @@ jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v2
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'pnpm'

- run: pnpm install
@@ -33,15 +33,15 @@ jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v2
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'pnpm'

- run: pnpm install
@@ -52,22 +52,25 @@ jobs:
lint-and-test-dts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v2
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'pnpm'

- run: pnpm install

- name: Run eslint
run: pnpm run lint

# - name: Run prettier
# run: pnpm run format-check

- name: Run type declaration tests
run: pnpm run test-dts

@@ -76,15 +79,15 @@ jobs:
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v2
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'pnpm'

- run: pnpm install
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
## [3.2.42](https://github.com/vuejs/core/compare/v3.2.41...v3.2.42) (2022-11-09)


### Bug Fixes

* **compiler-core/v-on:** only apply case preservation on native elements ([#6902](https://github.com/vuejs/core/issues/6902)) ([5bfe438](https://github.com/vuejs/core/commit/5bfe438ef391522bddbe43cd2669061c6a88b03a)), closes [#6900](https://github.com/vuejs/core/issues/6900)
* **compiler-core/v-on:** support inline handler with return type annotation ([#6769](https://github.com/vuejs/core/issues/6769)) ([bcfe480](https://github.com/vuejs/core/commit/bcfe480d75d822111c0d3e5fcbc7e10e073d53dc)), closes [#6378](https://github.com/vuejs/core/issues/6378)
* **compiler-core:** avoid duplicate keys in codegen with `v-if` ([#6689](https://github.com/vuejs/core/issues/6689)) ([640cfce](https://github.com/vuejs/core/commit/640cfce4ff808fdfc419058f39a2ff4874a25899)), closes [#6641](https://github.com/vuejs/core/issues/6641)
* **compiler-core:** fix parsing error on comments between v-if in prod ([dd3354c](https://github.com/vuejs/core/commit/dd3354c4c709c0d76e651bb9202158434619cb6a)), closes [#6843](https://github.com/vuejs/core/issues/6843)
* **compiler-core:** keep whitespaces between interpolation and comment ([#6828](https://github.com/vuejs/core/issues/6828)) ([4887618](https://github.com/vuejs/core/commit/48876182dbe5ef88a65a0aa7377e882c735b6104)), closes [#6352](https://github.com/vuejs/core/issues/6352)
* **compiler-sfc:** add semicolon after `defineProps` statement ([#6461](https://github.com/vuejs/core/issues/6461)) ([b72a4af](https://github.com/vuejs/core/commit/b72a4af38a402447d19b4616d09935c390d0702f)), closes [#6428](https://github.com/vuejs/core/issues/6428)
* **compiler-sfc:** allow type annotation for defineEmits variable ([#5394](https://github.com/vuejs/core/issues/5394)) ([eab7604](https://github.com/vuejs/core/commit/eab76046e3b1779dd7a856b6b974e928075d6a1e)), closes [#5393](https://github.com/vuejs/core/issues/5393)
* **compiler-sfc:** check import source during binding analysation ([#6826](https://github.com/vuejs/core/issues/6826)) ([4a00fdd](https://github.com/vuejs/core/commit/4a00fddfed16caee7a1e07756b9c110bc928c17a)), closes [#6825](https://github.com/vuejs/core/issues/6825)
* **compiler-sfc:** fix binding analysis for aliased late import ([8d1f526](https://github.com/vuejs/core/commit/8d1f526174db277ae5aa9297a43f20a43e991294))
* **compiler-sfc:** fix macro usage in multi-variable declaration ([#6778](https://github.com/vuejs/core/issues/6778)) ([99b6697](https://github.com/vuejs/core/commit/99b6697fb44dd1094ea0bf372c1d05214ffb92a2)), closes [#6757](https://github.com/vuejs/core/issues/6757)
* **compiler-sfc:** handle method shorthand syntax in withDefaults ([#6972](https://github.com/vuejs/core/issues/6972)) ([8a882ce](https://github.com/vuejs/core/commit/8a882ce0a10bfa5482d6b8a9b68fd49cff4f6937)), closes [#6971](https://github.com/vuejs/core/issues/6971)
* **compiler-sfc:** only escape parsing-breaking characters in v-bind css var names ([#6816](https://github.com/vuejs/core/issues/6816)) ([57c9013](https://github.com/vuejs/core/commit/57c901383792176fd7267b7d34d845088dbeff63)), closes [#6803](https://github.com/vuejs/core/issues/6803)
* **compiler-sfc:** require <template> or <script> in SFC ([#6781](https://github.com/vuejs/core/issues/6781)) ([a0c7f27](https://github.com/vuejs/core/commit/a0c7f271a2efb2bacf0889a9ac259263b5526112)), closes [#6676](https://github.com/vuejs/core/issues/6676)
* **compiler-sfc:** resolve computed object key ([#6963](https://github.com/vuejs/core/issues/6963)) ([910fa76](https://github.com/vuejs/core/commit/910fa7677f4ef690b612fae4a069b2293672c439))
* **compiler-sfc:** support using extends interface with defineProps() ([#4512](https://github.com/vuejs/core/issues/4512)) ([83f7e6f](https://github.com/vuejs/core/commit/83f7e6f8a688e823274379fe79f58b90ea58892d)), closes [#4498](https://github.com/vuejs/core/issues/4498)
* **compiler-ssr:** fix invalid codegen when v-slot name is explicit empty attr ([#3326](https://github.com/vuejs/core/issues/3326)) ([09bb3e9](https://github.com/vuejs/core/commit/09bb3e996ef17967022243a519d7dcc2921dd049))
* **compiler/runtime-dom:** ignore comments in inline styles ([#6808](https://github.com/vuejs/core/issues/6808)) ([50e2253](https://github.com/vuejs/core/commit/50e225305721a95515e8aa7dca68ebd5fe9fe025)), closes [#6807](https://github.com/vuejs/core/issues/6807)
* **compiler:** avoid namespace collisions when transforming template refs in inline mode ([#6975](https://github.com/vuejs/core/issues/6975)) ([2c27556](https://github.com/vuejs/core/commit/2c27556fe5fa8ba991dd55c766a92d3a50fbf8e6)), closes [#6964](https://github.com/vuejs/core/issues/6964)
* **hmr:** fix hmr for components managed by keep-alive ([#6809](https://github.com/vuejs/core/issues/6809)) ([bdaf83a](https://github.com/vuejs/core/commit/bdaf83aae7b5651965870a0646da5ae4e5d96944)), closes [#6222](https://github.com/vuejs/core/issues/6222)
* **reactivity-transform:** add semicolon after statements ([#6303](https://github.com/vuejs/core/issues/6303)) ([c4f213b](https://github.com/vuejs/core/commit/c4f213b42535da3558d406da9b33dd1f9455aeaf))
* **reactivity-transform:** respect user defined symbols that conflict with macros ([#6840](https://github.com/vuejs/core/issues/6840)) ([7663a79](https://github.com/vuejs/core/commit/7663a79a295800da7c889fcd2e8e1e6d775263db)), closes [#6838](https://github.com/vuejs/core/issues/6838)
* **reactivity:** enable trigger when use str to set length of arr ([#6810](https://github.com/vuejs/core/issues/6810)) ([e6224f4](https://github.com/vuejs/core/commit/e6224f4256be2fdac3651ade87f9f91ccf6def71))
* **runtime-core:** `in` operator returning `false` for built-in instance properties in `exposeProxy` ([#6138](https://github.com/vuejs/core/issues/6138)) ([32b5124](https://github.com/vuejs/core/commit/32b51249bff70d1e03a3f9193f5a42461974daa6)), closes [#6137](https://github.com/vuejs/core/issues/6137)
* **runtime-core:** custom-element: ensure number casting of camelCase props. (fix: [#5374](https://github.com/vuejs/core/issues/5374)) ([#5377](https://github.com/vuejs/core/issues/5377)) ([b0b74a1](https://github.com/vuejs/core/commit/b0b74a160c08941fa9a7a5460f36a1f2fccbf423))
* **runtime-core:** do not throw on unknown directives ([#6671](https://github.com/vuejs/core/issues/6671)) ([0455378](https://github.com/vuejs/core/commit/04553786e4391b3bfa02f50c2a5baa8d2fe8c7a4)), closes [#6340](https://github.com/vuejs/core/issues/6340)
* **runtime-core:** ensure props definition objects are not mutated during props normalization (close: [#6915](https://github.com/vuejs/core/issues/6915)) ([#6916](https://github.com/vuejs/core/issues/6916)) ([54b6ba3](https://github.com/vuejs/core/commit/54b6ba32cafcc41fa9b7b85f1f1a306923204177))
* **runtime-core:** watching multiple values - handle `undefined` as initial values (fix: [#5032](https://github.com/vuejs/core/issues/5032)) ([#5033](https://github.com/vuejs/core/issues/5033)) ([bc167b5](https://github.com/vuejs/core/commit/bc167b5c6c7c5756f3b7720a7d3ddcdb2c7f717f))
* **runtime-dom:** ensure customElement handles empty props correctly. ([#6182](https://github.com/vuejs/core/issues/6182)) ([f67bb50](https://github.com/vuejs/core/commit/f67bb500b6071bc0e55a89709a495a27da73badd)), closes [#6163](https://github.com/vuejs/core/issues/6163) [#6895](https://github.com/vuejs/core/issues/6895)
* **sfc/types:** improve the type inference using withDefaults ([#6764](https://github.com/vuejs/core/issues/6764)) ([168c857](https://github.com/vuejs/core/commit/168c8572475c82902f9cb0480f85b5d3100ffa0d)), closes [#6552](https://github.com/vuejs/core/issues/6552)
* **shared:** fix parsing of multi-line inline style ([#6777](https://github.com/vuejs/core/issues/6777)) ([9768949](https://github.com/vuejs/core/commit/9768949ce0cbe91cffb708cf005807413d60c031))
* **ssr:** remove css number value check ([#6636](https://github.com/vuejs/core/issues/6636)) ([79e7c1e](https://github.com/vuejs/core/commit/79e7c1ee43b39afef3ce316dff0e7e3b6cd7220c)), closes [#6625](https://github.com/vuejs/core/issues/6625)
* **transition/keep-alive:** fix unmount bug for component with out-in transition ([#6839](https://github.com/vuejs/core/issues/6839)) ([64e6d92](https://github.com/vuejs/core/commit/64e6d9221d353598b5f61c158c978d80e3b4628c)), closes [#6835](https://github.com/vuejs/core/issues/6835)
* **types/reactivity-transform:** fix type when initial value is not used ([#6821](https://github.com/vuejs/core/issues/6821)) ([fdc5902](https://github.com/vuejs/core/commit/fdc5902cce0d077c722dfd422850ca69fd51be8e)), closes [#6820](https://github.com/vuejs/core/issues/6820)
* **types:** `$watch` callback parameters type ([#6136](https://github.com/vuejs/core/issues/6136)) ([41d9c47](https://github.com/vuejs/core/commit/41d9c47300888fce9d4ff6a02f69d8a912cded8f)), closes [#6135](https://github.com/vuejs/core/issues/6135)
* **types:** ensure createBlock() helper accepts Teleport and Supsense types (fix: [#2855](https://github.com/vuejs/core/issues/2855)) ([#5458](https://github.com/vuejs/core/issues/5458)) ([e5fc7dc](https://github.com/vuejs/core/commit/e5fc7dcc02f2dd3fa8172958259049031626375f))
* **types:** export `Raw` type ([#6380](https://github.com/vuejs/core/issues/6380)) ([e9172db](https://github.com/vuejs/core/commit/e9172db68b86fad2e0bb1de9e5d0dddbe3c2a25e)), closes [#7048](https://github.com/vuejs/core/issues/7048)
* **types:** should unwrap tuple correctly ([#3820](https://github.com/vuejs/core/issues/3820)) ([e816812](https://github.com/vuejs/core/commit/e816812f10b9e3a375eef8dffd617d7f08b23c00)), closes [#3819](https://github.com/vuejs/core/issues/3819)
* **types:** stricter type condition for `EventHandlers` ([#6855](https://github.com/vuejs/core/issues/6855)) ([bad3f3c](https://github.com/vuejs/core/commit/bad3f3ce46aad1f5fec47d1d02aee26af393bcff)), closes [#6899](https://github.com/vuejs/core/issues/6899)
* **types:** support inferring injected properties in options api ([#6804](https://github.com/vuejs/core/issues/6804)) ([e4de623](https://github.com/vuejs/core/commit/e4de623ea7289665ac8e827d8aa4783de1d6d380)), closes [#3031](https://github.com/vuejs/core/issues/3031) [#5931](https://github.com/vuejs/core/issues/5931)
* **v-model:** fix trim modifier on events with non-string args ( ([#5770](https://github.com/vuejs/core/issues/5770)) ([018b850](https://github.com/vuejs/core/commit/018b8503994c2dae3c42dd03ea50d062956be970)), closes [#5765](https://github.com/vuejs/core/issues/5765)



## [3.2.41](https://github.com/vuejs/core/compare/v3.2.40...v3.2.41) (2022-10-14)


3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "3.2.41",
"version": "3.2.42",
"packageManager": "pnpm@7.1.0",
"scripts": {
"dev": "node scripts/dev.js",
@@ -10,6 +10,7 @@
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli",
"lint": "eslint --cache --ext .ts packages/*/{src,__tests__}/**.ts",
"format": "prettier --write --cache --parser typescript \"packages/**/*.ts?(x)\"",
"format-check": "prettier --check --cache --parser typescript \"packages/**/*.ts?(x)\"",
"test": "run-s \"test-unit {@}\" \"test-e2e {@}\"",
"test-unit": "jest --filter ./scripts/filter-unit.js",
"test-e2e": "node scripts/build.js vue -f global -d && jest --filter ./scripts/filter-e2e.js --runInBand",
11 changes: 11 additions & 0 deletions packages/compiler-core/__tests__/parse.spec.ts
Original file line number Diff line number Diff line change
@@ -1980,6 +1980,17 @@ foo
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})

it('should NOT remove whitespaces w/ newline between interpolation and comment', () => {
const ast = parse(`<!-- foo --> \n {{msg}}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.COMMENT)
expect(ast.children[1]).toMatchObject({
type: NodeTypes.TEXT,
content: ' '
})
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})

it('should NOT remove whitespaces w/o newline between elements', () => {
const ast = parse(`<div/> <div/> <div/>`)
expect(ast.children.length).toBe(5)
Original file line number Diff line number Diff line change
@@ -1063,6 +1063,32 @@ describe('compiler: element transform', () => {
})
})

test('script setup inline mode template ref (binding does not exist but props with the same name exist)', () => {
const { node } = parseWithElementTransform(`<input ref="msg"/>`, {
inline: true,
bindingMetadata: {
msg: BindingTypes.PROPS,
ref: BindingTypes.SETUP_CONST
}
})
expect(node.props).toMatchObject({
type: NodeTypes.JS_OBJECT_EXPRESSION,
properties: [
{
type: NodeTypes.JS_PROPERTY,
key: {
content: 'ref',
isStatic: true
},
value: {
content: 'msg',
isStatic: true
}
}
]
})
})

test('HYDRATE_EVENTS', () => {
// ignore click events (has dedicated fast path)
const { node } = parseWithElementTransform(`<div @click="foo" />`, {
39 changes: 39 additions & 0 deletions packages/compiler-core/__tests__/transforms/vIf.spec.ts
Original file line number Diff line number Diff line change
@@ -628,6 +628,24 @@ describe('compiler: v-if', () => {
expect(branch1.props).toMatchObject(createObjectMatcher({ key: `[0]` }))
})

// #6631
test('avoid duplicate keys', () => {
const {
node: { codegenNode }
} = parseWithIfTransform(`<div v-if="ok" key="custom_key" v-bind="obj"/>`)
const branch1 = codegenNode.consequent as VNodeCall
expect(branch1.props).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: MERGE_PROPS,
arguments: [
createObjectMatcher({
key: 'custom_key'
}),
{ content: `obj` }
]
})
})

test('with spaces between branches', () => {
const {
node: { codegenNode }
@@ -694,6 +712,27 @@ describe('compiler: v-if', () => {
expect(b1.children[3].type).toBe(NodeTypes.ELEMENT)
expect((b1.children[3] as ElementNode).tag).toBe(`p`)
})

// #6843
test('should parse correctly with comments: true in prod', () => {
__DEV__ = false
parseWithIfTransform(
`
<template v-if="ok">
<!--comment1-->
<div v-if="ok2">
<!--comment2-->
</div>
<!--comment3-->
<b v-else/>
<!--comment4-->
<p/>
</template>
`,
{ comments: true }
)
__DEV__ = true
})
})

test('v-on with v-if', () => {
15 changes: 15 additions & 0 deletions packages/compiler-core/__tests__/transforms/vOn.spec.ts
Original file line number Diff line number Diff line change
@@ -271,6 +271,21 @@ describe('compiler: transform v-on', () => {
})
})

test('should NOT wrap as function if expression is already function expression (with Typescript)', () => {
const { node } = parseWithVOn(`<div @click="(e: any): any => foo(e)"/>`)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
{
key: { content: `onClick` },
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `(e: any): any => foo(e)`
}
}
]
})
})

test('should NOT wrap as function if expression is already function expression (with newlines)', () => {
const { node } = parseWithVOn(
`<div @click="
53 changes: 52 additions & 1 deletion packages/compiler-core/__tests__/transforms/vSlot.spec.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ import {
VNodeCall,
SlotsExpression,
ObjectExpression,
SimpleExpressionNode
SimpleExpressionNode,
RenderSlotCall
} from '../../src'
import { transformElement } from '../../src/transforms/transformElement'
import { transformOn } from '../../src/transforms/vOn'
@@ -788,6 +789,56 @@ describe('compiler: transform component slots', () => {
const { slots } = parseWithSlots(`<Comp><Comp><slot/></Comp></Comp>`)
expect(slots).toMatchObject(toMatch)
})

// # fix: #6900
test('consistent behavior of @xxx:modelValue and @xxx:model-value', () => {
const { root: rootUpper } = parseWithSlots(
`<div><slot @foo:modelValue="handler" /></div>`
)
const slotNodeUpper = (rootUpper.codegenNode! as VNodeCall)
.children as ElementNode[]
const propertiesObjUpper = (
slotNodeUpper[0].codegenNode! as RenderSlotCall
).arguments[2]
expect(propertiesObjUpper).toMatchObject({
properties: [
{
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'onFoo:modelValue'
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `handler`,
isStatic: false
}
}
]
})

const { root } = parseWithSlots(
`<div><slot @foo:model-Value="handler" /></div>`
)
const slotNode = (root.codegenNode! as VNodeCall)
.children as ElementNode[]
const propertiesObj = (slotNode[0].codegenNode! as RenderSlotCall)
.arguments[2]
expect(propertiesObj).toMatchObject({
properties: [
{
key: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'onFoo:modelValue'
},
value: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: `handler`,
isStatic: false
}
}
]
})
})
})

describe('errors', () => {
4 changes: 2 additions & 2 deletions packages/compiler-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-core",
"version": "3.2.41",
"version": "3.2.42",
"description": "@vue/compiler-core",
"main": "index.js",
"module": "dist/compiler-core.esm-bundler.js",
@@ -32,7 +32,7 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
"dependencies": {
"@vue/shared": "3.2.41",
"@vue/shared": "3.2.42",
"@babel/parser": "^7.16.4",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
Loading