]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: Merge branch 'main' into minor
authorEvan You <yyx990803@gmail.com>
Mon, 4 Dec 2023 15:17:41 +0000 (23:17 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 4 Dec 2023 15:17:41 +0000 (23:17 +0800)
22 files changed:
1  2 
CHANGELOG.md
package.json
packages/compiler-core/__tests__/transforms/transformElement.spec.ts
packages/compiler-core/package.json
packages/compiler-core/src/transforms/transformElement.ts
packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
packages/compiler-sfc/__tests__/compileScript.spec.ts
packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap
packages/compiler-sfc/__tests__/compileTemplate.spec.ts
packages/compiler-sfc/__tests__/parse.spec.ts
packages/compiler-sfc/package.json
packages/compiler-sfc/src/parse.ts
packages/compiler-sfc/src/script/defineEmits.ts
packages/compiler-sfc/src/script/defineProps.ts
packages/compiler-sfc/src/script/resolveType.ts
packages/compiler-sfc/src/style/cssVars.ts
packages/reactivity/src/collectionHandlers.ts
packages/reactivity/src/ref.ts
packages/sfc-playground/src/App.vue
packages/vue-compat/package.json
pnpm-lock.yaml
scripts/dev.js

diff --cc CHANGELOG.md
index ec08f21693394624410afab06a82def26ddf8175,7ee102778943c1872734dd82b84845c3d75acc5a..53b685c392c3597092cb97efaad655181f7777e9
@@@ -1,59 -1,34 +1,90 @@@
+ ## [3.3.10](https://github.com/vuejs/core/compare/v3.3.9...v3.3.10) (2023-12-04)
+ ### Bug Fixes
+ * **app:** prevent template from being cached between apps with different options ([#9724](https://github.com/vuejs/core/issues/9724)) ([ec71585](https://github.com/vuejs/core/commit/ec715854ca12520b2afc9e9b3981cbae05ae5206)), closes [#9618](https://github.com/vuejs/core/issues/9618)
+ * **compiler-sfc:** avoid passing forEach index to genMap ([f12db7f](https://github.com/vuejs/core/commit/f12db7fb564a534cef2e5805cc9f54afe5d72fbf))
+ * **compiler-sfc:** deindent pug/jade templates ([6345197](https://github.com/vuejs/core/commit/634519720a21fb5a6871454e1cadad7053a568b8)), closes [#3231](https://github.com/vuejs/core/issues/3231) [#3842](https://github.com/vuejs/core/issues/3842) [#7723](https://github.com/vuejs/core/issues/7723)
+ * **compiler-sfc:** fix :where and :is selector in scoped mode with multiple selectors ([#9735](https://github.com/vuejs/core/issues/9735)) ([c3e2c55](https://github.com/vuejs/core/commit/c3e2c556b532656b50b8ab5cd2d9eabc26622d63)), closes [#9707](https://github.com/vuejs/core/issues/9707)
+ * **compiler-sfc:** generate more treeshaking friendly code ([#9507](https://github.com/vuejs/core/issues/9507)) ([8d74ca0](https://github.com/vuejs/core/commit/8d74ca0e6fa2738ca6854b7e879ff59419f948c7)), closes [#9500](https://github.com/vuejs/core/issues/9500)
+ * **compiler-sfc:** support inferring generic types ([#8511](https://github.com/vuejs/core/issues/8511)) ([eb5e307](https://github.com/vuejs/core/commit/eb5e307c0be62002e62c4c800d0dfacb39b0d4ca)), closes [#8482](https://github.com/vuejs/core/issues/8482)
+ * **compiler-sfc:** support resolving components from props ([#8785](https://github.com/vuejs/core/issues/8785)) ([7cbcee3](https://github.com/vuejs/core/commit/7cbcee3d831241a8bd3588ae92d3f27e3641e25f))
+ * **compiler-sfc:** throw error when failing to load TS during type resolution ([#8883](https://github.com/vuejs/core/issues/8883)) ([4936d2e](https://github.com/vuejs/core/commit/4936d2e11a8d0ca3704bfe408548cb26bb3fd5e9))
+ * **cssVars:** cssVar names should be double-escaped when generating code for ssr ([#8824](https://github.com/vuejs/core/issues/8824)) ([5199a12](https://github.com/vuejs/core/commit/5199a12f8855cd06f24bf355708b5a2134f63176)), closes [#7823](https://github.com/vuejs/core/issues/7823)
+ * **deps:** update compiler to ^7.23.4 ([#9681](https://github.com/vuejs/core/issues/9681)) ([31f6ebc](https://github.com/vuejs/core/commit/31f6ebc4df84490ed29fb75e7bf4259200eb51f0))
+ * **runtime-core:** Suspense get anchor properly in Transition ([#9309](https://github.com/vuejs/core/issues/9309)) ([65f3fe2](https://github.com/vuejs/core/commit/65f3fe273127a8b68e1222fbb306d28d85f01757)), closes [#8105](https://github.com/vuejs/core/issues/8105)
+ * **runtime-dom:** set width/height with units as attribute ([#8781](https://github.com/vuejs/core/issues/8781)) ([bfc1838](https://github.com/vuejs/core/commit/bfc1838f31199de3f189198a3c234fa7bae91386))
+ * **ssr:** avoid computed being accidentally cached before server render ([#9688](https://github.com/vuejs/core/issues/9688)) ([30d5d93](https://github.com/vuejs/core/commit/30d5d93a92b2154406ec04f8aca6b217fa01177c)), closes [#5300](https://github.com/vuejs/core/issues/5300)
+ * **types:** expose emits as props in functional components ([#9234](https://github.com/vuejs/core/issues/9234)) ([887e54c](https://github.com/vuejs/core/commit/887e54c347ea9eac4c721b5e2288f054873d1d30))
+ * **types:** fix reactive collection types ([#8960](https://github.com/vuejs/core/issues/8960)) ([ad27473](https://github.com/vuejs/core/commit/ad274737015c36906d76f3189203093fa3a2e4e7)), closes [#8904](https://github.com/vuejs/core/issues/8904)
+ * **types:** improve return type withKeys and withModifiers ([#9734](https://github.com/vuejs/core/issues/9734)) ([43c3cfd](https://github.com/vuejs/core/commit/43c3cfdec5ae5d70fa2a21e857abc2d73f1a0d07))
+ ### Performance Improvements
+ * optimize on* prop check ([38aaa8c](https://github.com/vuejs/core/commit/38aaa8c88648c54fe2616ad9c0961288092fcb44))
+ * **runtime-dom:** cache modifier wrapper functions ([da4a4fb](https://github.com/vuejs/core/commit/da4a4fb5e8eee3c6d31f24ebd79a9d0feca56cb2)), closes [#8882](https://github.com/vuejs/core/issues/8882)
+ * **v-on:** constant handlers with modifiers should not be treated as dynamic ([4d94ebf](https://github.com/vuejs/core/commit/4d94ebfe75174b340d2b794e699cad1add3600a9))
 +# [3.4.0-alpha.3](https://github.com/vuejs/core/compare/v3.4.0-alpha.2...v3.4.0-alpha.3) (2023-11-28)
 +
 +
 +### Bug Fixes
 +
 +* **deps:** update compiler to ^7.23.4 ([#9681](https://github.com/vuejs/core/issues/9681)) ([31f6ebc](https://github.com/vuejs/core/commit/31f6ebc4df84490ed29fb75e7bf4259200eb51f0))
 +* **parser:** directive arg should be undefined on shorthands with no arg ([e49dffc](https://github.com/vuejs/core/commit/e49dffc9ece86bddf094b9ad4ad15eb4856d6277))
 +
 +
 +### Features
 +
 +* **dx:** link errors to docs in prod build ([#9165](https://github.com/vuejs/core/issues/9165)) ([9f8ba98](https://github.com/vuejs/core/commit/9f8ba9821fe166f77e63fa940e9e7e13ec3344fa))
 +
 +
 +
 +# [3.4.0-alpha.2](https://github.com/vuejs/core/compare/v3.3.9...v3.4.0-alpha.2) (2023-11-27)
 +
 +
 +### Bug Fixes
 +
 +* avoid confusing breakage in @vitejs/plugin-vue ([ceec69c](https://github.com/vuejs/core/commit/ceec69c8ccb96c433a4a506ad2e85e276998bade))
 +* **compiler-core:** fix line/column tracking when fast forwarding ([2e65ea4](https://github.com/vuejs/core/commit/2e65ea481f74db8649df8110a031cbdc98f98c84))
 +* **compiler-sfc:** fix ast reuse for ssr ([fb619cf](https://github.com/vuejs/core/commit/fb619cf9a440239f0ba88e327d10001a6a3c8171))
 +* **compiler-sfc:** support `:is` and `:where` selector in scoped css rewrite ([#8929](https://github.com/vuejs/core/issues/8929)) ([c6083dc](https://github.com/vuejs/core/commit/c6083dcad31f3e9292c687fada9e32f287e2317f))
 +* **compiler-sfc:** use correct compiler when re-parsing in ssr mode ([678378a](https://github.com/vuejs/core/commit/678378afd559481badb486b243722b6287862e09))
 +
 +
 +* feat!: remove reactivity transform (#9321) ([79b8a09](https://github.com/vuejs/core/commit/79b8a0905bf363bf82edd2096fef10c3db6d9c3c)), closes [#9321](https://github.com/vuejs/core/issues/9321)
 +
 +
 +### Features
 +
 +* **compiler-core:** support specifying root namespace when parsing ([40f72d5](https://github.com/vuejs/core/commit/40f72d5e50b389cb11b7ca13461aa2a75ddacdb4))
 +* **compiler-core:** support v-bind shorthand for key and value with the same name ([#9451](https://github.com/vuejs/core/issues/9451)) ([26399aa](https://github.com/vuejs/core/commit/26399aa6fac1596b294ffeba06bb498d86f5508c))
 +* **compiler:** improve parsing tolerance for language-tools ([41ff68e](https://github.com/vuejs/core/commit/41ff68ea579d933333392146625560359acb728a))
 +* **reactivity:** expose last result for computed getter ([#9497](https://github.com/vuejs/core/issues/9497)) ([48b47a1](https://github.com/vuejs/core/commit/48b47a1ab63577e2dbd91947eea544e3ef185b85))
 +
 +
 +### Performance Improvements
 +
 +* avoid sfc source map unnecessary serialization and parsing ([f15d2f6](https://github.com/vuejs/core/commit/f15d2f6cf69c0c39f8dfb5c33122790c68bf92e2))
 +* **codegen:** optimize line / column calculation during codegen ([3be53d9](https://github.com/vuejs/core/commit/3be53d9b974dae1a10eb795cade71ae765e17574))
 +* **codegen:** optimize source map generation ([c11002f](https://github.com/vuejs/core/commit/c11002f16afd243a2b15b546816e73882eea9e4d))
 +* **compiler-sfc:** remove magic-string trim on script ([e8e3ec6](https://github.com/vuejs/core/commit/e8e3ec6ca7392e43975c75b56eaaa711d5ea9410))
 +* **compiler-sfc:** use faster source map addMapping ([50cde7c](https://github.com/vuejs/core/commit/50cde7cfbcc49022ba88f5f69fa9b930b483c282))
 +* optimize away isBuiltInType ([66c0ed0](https://github.com/vuejs/core/commit/66c0ed0a3c1c6f37dafc6b1c52b75c6bf60e3136))
 +* optimize makeMap ([ae6fba9](https://github.com/vuejs/core/commit/ae6fba94954bac6430902f77b0d1113a98a75b18))
 +* optimize position cloning ([2073236](https://github.com/vuejs/core/commit/20732366b9b3530d33b842cf1fc985919afb9317))
 +
 +
 +### BREAKING CHANGES
 +
 +* Reactivity Transform was marked deprecated in 3.3 and is now removed in 3.4. This change does not require a major due to the feature being experimental. Users who wish to continue using the feature can do so via the external plugin at https://vue-macros.dev/features/reactivity-transform.html
 +
 +
 +
  ## [3.3.9](https://github.com/vuejs/core/compare/v3.3.8...v3.3.9) (2023-11-25)
  
  
diff --cc package.json
index d4e6e7270544234844835b35c0e2faae9707e046,1afd51ffde4488cb691ddf0e6702542bdf9743d1..27327e2243d9f6180fdfb4f237c606ef8b830d4b
@@@ -66,9 -66,7 +66,9 @@@
      "@rollup/plugin-replace": "^5.0.4",
      "@rollup/plugin-terser": "^0.4.4",
      "@types/hash-sum": "^1.0.2",
-     "@types/node": "^20.10.0",
 +    "@types/minimist": "^1.2.5",
+     "@types/node": "^20.10.3",
 +    "@types/semver": "^7.5.5",
      "@typescript-eslint/parser": "^6.13.0",
      "@vitest/coverage-istanbul": "^0.34.6",
      "@vue/consolidate": "0.17.3",
index 0991102a7e745f884bdf4291508b03a520b2b09d,91a66d199453e93841b2cb1917a4213b3a318143..511dd4a234f58a9b7ee5f497a3e160245dd10ddf
@@@ -32,9 -32,8 +32,9 @@@
    },
    "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
    "dependencies": {
-     "@babel/parser": "^7.23.4",
+     "@babel/parser": "^7.23.5",
      "@vue/shared": "workspace:*",
 +    "entities": "^4.5.0",
      "estree-walker": "^2.0.2",
      "source-map-js": "^1.0.2"
    },
Simple merge
index 84e7c0d066b93b2caf6fcf85584893fb6b69a1aa,1c75450213d73dc727e415c6a55b50768c66908b..a7d36fded43c0efcb1a22f5b21394ce93159d572
@@@ -349,14 -395,16 +362,14 @@@ function generateSourceMap
        const generatedLine = index + 1
        for (let i = 0; i < line.length; i++) {
          if (!/\s/.test(line[i])) {
 -          map.addMapping({
 +          map._mappings.add({
 +            originalLine,
-             originalColumn: i,
++            originalColumn: i + columnOffset,
 +            generatedLine,
 +            generatedColumn: i,
              source: filename,
 -            original: {
 -              line: originalLine,
 -              column: i + columnOffset
 -            },
 -            generated: {
 -              line: generatedLine,
 -              column: i
 -            }
 +            // @ts-ignore
 +            name: null
            })
          }
        }
index 9d7c1dd4880d482c8a09b7016e717b28db322531,abf623f551ca801f4bf6100c232d40d6100502f9..595f06970dc768af100a09f00adc1c20d649e09c
@@@ -1,14 -1,9 +1,14 @@@
 -import { toRaw, ReactiveFlags, toReactive, toReadonly } from './reactive'
 -import { track, trigger, ITERATE_KEY, MAP_KEY_ITERATE_KEY } from './effect'
 -import { TrackOpTypes, TriggerOpTypes } from './operations'
 +import { toRaw, toReactive, toReadonly } from './reactive'
 +import {
 +  track,
 +  trigger,
 +  ITERATE_KEY,
 +  MAP_KEY_ITERATE_KEY
 +} from './reactiveEffect'
 +import { ReactiveFlags, TrackOpTypes, TriggerOpTypes } from './constants'
  import { capitalize, hasOwn, hasChanged, toRawType, isMap } from '@vue/shared'
  
export type CollectionTypes = IterableCollections | WeakCollections
+ type CollectionTypes = IterableCollections | WeakCollections
  
  type IterableCollections = Map<any, any> | Set<any>
  type WeakCollections = WeakMap<any, any> | WeakSet<any>
index 705d442dcfd03e92b4de65460b4d4eb9d6d75bae,9f7ebdad8222c2ec0d2de5e395cc084dfd16f5ca..56dc7667c99eb8234ba0301a8b7d2f29e466e166
@@@ -16,10 -17,7 +16,9 @@@ import 
    isShallow
  } from './reactive'
  import type { ShallowReactiveMarker } from './reactive'
- import { CollectionTypes } from './collectionHandlers'
  import { createDep, Dep } from './dep'
 +import { ComputedRefImpl } from './computed'
 +import { getDepFromReactive } from './reactiveEffect'
  
  declare const RefSymbol: unique symbol
  export declare const RawSymbol: unique symbol
Simple merge
Simple merge
diff --cc pnpm-lock.yaml
index 6d5ef1d4f1b454451fade20b88a73bdbaa2f68bd,67072a042fec321ebda867331cc3b3d9b6deca1b..b59db1df68fe20c3bc992df33ddb2d1d60bac651
@@@ -35,15 -35,9 +35,15 @@@ importers
        '@types/hash-sum':
          specifier: ^1.0.2
          version: 1.0.2
 +      '@types/minimist':
 +        specifier: ^1.2.5
 +        version: 1.2.5
        '@types/node':
-         specifier: ^20.10.0
-         version: 20.10.0
+         specifier: ^20.10.3
+         version: 20.10.3
 +      '@types/semver':
 +        specifier: ^7.5.5
 +        version: 7.5.5
        '@typescript-eslint/parser':
          specifier: ^6.13.0
          version: 6.13.0(eslint@8.54.0)(typescript@5.2.2)
          specifier: ^9.0.3
          version: 9.0.3
        postcss-modules:
 -        specifier: ^4.3.1
 -        version: 4.3.1(postcss@8.4.32)
 +        specifier: ^6.0.0
-         version: 6.0.0(postcss@8.4.31)
++        version: 6.0.0(postcss@8.4.32)
        postcss-selector-parser:
          specifier: ^6.0.13
          version: 6.0.13
@@@ -1523,12 -1556,8 +1540,12 @@@ packages
      resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==}
      dev: true
  
-   /@types/node@20.10.0:
-     resolution: {integrity: sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==}
 +  /@types/minimist@1.2.5:
 +    resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==}
 +    dev: true
 +
+   /@types/node@20.10.3:
+     resolution: {integrity: sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==}
      dependencies:
        undici-types: 5.26.5
      dev: true
        safer-buffer: 2.1.2
      dev: true
  
-   /icss-utils@5.1.0(postcss@8.4.31):
 -  /icss-replace-symbols@1.1.0:
 -    resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==}
 -    dev: true
 -
+   /icss-utils@5.1.0(postcss@8.4.32):
      resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==}
      engines: {node: ^10 || ^12 || >= 14}
      peerDependencies:
      peerDependencies:
        postcss: ^8.1.0
      dependencies:
-       icss-utils: 5.1.0(postcss@8.4.31)
-       postcss: 8.4.31
+       icss-utils: 5.1.0(postcss@8.4.32)
+       postcss: 8.4.32
      dev: true
  
-   /postcss-modules@6.0.0(postcss@8.4.31):
 -  /postcss-modules@4.3.1(postcss@8.4.32):
 -    resolution: {integrity: sha512-ItUhSUxBBdNamkT3KzIZwYNNRFKmkJrofvC2nWab3CPKhYBQ1f27XXh1PAPE27Psx58jeelPsxWB/+og+KEH0Q==}
++  /postcss-modules@6.0.0(postcss@8.4.32):
 +    resolution: {integrity: sha512-7DGfnlyi/ju82BRzTIjWS5C4Tafmzl3R79YP/PASiocj+aa6yYphHhhKUOEoXQToId5rgyFgJ88+ccOUydjBXQ==}
      peerDependencies:
        postcss: ^8.0.0
      dependencies:
        generic-names: 4.0.0
-       icss-utils: 5.1.0(postcss@8.4.31)
 -      icss-replace-symbols: 1.1.0
++      icss-utils: 5.1.0(postcss@8.4.32)
        lodash.camelcase: 4.3.0
-       postcss: 8.4.31
-       postcss-modules-extract-imports: 3.0.0(postcss@8.4.31)
-       postcss-modules-local-by-default: 4.0.3(postcss@8.4.31)
-       postcss-modules-scope: 3.0.0(postcss@8.4.31)
-       postcss-modules-values: 4.0.0(postcss@8.4.31)
+       postcss: 8.4.32
+       postcss-modules-extract-imports: 3.0.0(postcss@8.4.32)
+       postcss-modules-local-by-default: 4.0.3(postcss@8.4.32)
+       postcss-modules-scope: 3.0.0(postcss@8.4.32)
+       postcss-modules-values: 4.0.0(postcss@8.4.32)
        string-hash: 1.1.3
      dev: true
  
        rollup: 4.1.4
        typescript: 5.2.2
      optionalDependencies:
--      '@babel/code-frame': 7.22.13
++      '@babel/code-frame': 7.23.5
      dev: true
  
    /rollup-plugin-esbuild@6.1.0(esbuild@0.19.5)(rollup@4.1.4):
diff --cc scripts/dev.js
Simple merge