From cffe8667eedf4ae87f5700f5f027603a52fbcff3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 9 Aug 2024 21:08:27 +0800 Subject: [PATCH 001/210] workflow: simplify size report action --- .github/workflows/size-data.yml | 20 ++++++-------------- .github/workflows/size-report.yml | 27 ++++++++------------------- 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/.github/workflows/size-data.yml b/.github/workflows/size-data.yml index f73a59607..3cd6cbfdf 100644 --- a/.github/workflows/size-data.yml +++ b/.github/workflows/size-data.yml @@ -37,22 +37,14 @@ jobs: - run: pnpm run size - - name: Upload Size Data - uses: actions/upload-artifact@v4 - with: - name: size-data - path: temp/size - - name: Save PR number & base branch if: ${{github.event_name == 'pull_request'}} run: | - echo ${{ github.event.number }} > ./number.txt - echo ${{ github.base_ref }} > ./base.txt + echo ${{ github.event.number }} > ./temp/size/number.txt + echo ${{ github.base_ref }} > ./temp/size/base.txt - - uses: actions/upload-artifact@v4 - if: ${{github.event_name == 'pull_request'}} + - name: Upload Size Data + uses: actions/upload-artifact@v4 with: - name: pr-info - path: | - number.txt - base.txt + name: size-data + path: temp/size diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml index c8258f8b9..fb47e968b 100644 --- a/.github/workflows/size-report.yml +++ b/.github/workflows/size-report.yml @@ -35,36 +35,25 @@ jobs: - name: Install dependencies run: pnpm install - - name: Download PR info + - name: Download Size Data uses: dawidd6/action-download-artifact@v6 with: - name: pr-info + name: size-data run_id: ${{ github.event.workflow_run.id }} - path: /tmp/pr-info + path: temp/size - name: Read PR Number id: pr-number - uses: juliangruber/read-file-action@v1 - with: - path: /tmp/pr-info/number.txt + run: echo "number=(cat ./temp/size/number.txt)" >> $GITHUB_OUTPUT - - name: Read PR base branch + - name: Read base branch id: pr-base - uses: juliangruber/read-file-action@v1 - with: - path: /tmp/pr-info/base.txt - - - name: Download Size Data - uses: dawidd6/action-download-artifact@v6 - with: - name: size-data - run_id: ${{ github.event.workflow_run.id }} - path: temp/size + run: echo "base=(cat ./temp/size/base.txt)" >> $GITHUB_OUTPUT - name: Download Previous Size Data uses: dawidd6/action-download-artifact@v6 with: - branch: ${{ steps.pr-base.outputs.content }} + branch: ${{ steps.pr-base.outputs.base }} workflow: size-data.yml event: push name: size-data @@ -84,7 +73,7 @@ jobs: uses: actions-cool/maintain-one-comment@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - number: ${{ steps.pr-number.outputs.content }} + number: ${{ steps.pr-number.outputs.number }} body: | ${{ steps.size-report.outputs.content }} From 63b7c01d0f2c1ade7a677d66e10e9a4798effa8e Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 9 Aug 2024 23:11:31 +0800 Subject: [PATCH 002/210] chore(deps): bump vitest to 2.0 --- package.json | 4 +- pnpm-lock.yaml | 365 +++++++++++++++-------------------------------- vitest.config.ts | 1 + 3 files changed, 115 insertions(+), 255 deletions(-) diff --git a/package.json b/package.json index a709ba4b5..240dad49a 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@types/node": "^20.14.14", "@types/semver": "^7.5.8", "@types/serve-handler": "^6.1.4", - "@vitest/coverage-istanbul": "^1.6.0", + "@vitest/coverage-istanbul": "^2.0.0", "@vue/consolidate": "1.0.0", "conventional-changelog-cli": "^5.0.0", "enquirer": "^2.4.1", @@ -108,7 +108,7 @@ "typescript": "~5.5.4", "typescript-eslint": "^8.0.0", "vite": "catalog:", - "vitest": "^1.6.0" + "vitest": "^2.0.0" }, "pnpm": { "peerDependencyRules": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69276fdde..75497dd7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,8 +66,8 @@ importers: specifier: ^6.1.4 version: 6.1.4 '@vitest/coverage-istanbul': - specifier: ^1.6.0 - version: 1.6.0(vitest@1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) + specifier: ^2.0.0 + version: 2.0.5(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -91,7 +91,7 @@ importers: version: 3.1.0(eslint@9.8.0)(typescript@5.5.4) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) + version: 0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -177,8 +177,8 @@ importers: specifier: 'catalog:' version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) vitest: - specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + specifier: ^2.0.0 + version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) packages/compiler-core: dependencies: @@ -843,10 +843,6 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -1032,9 +1028,6 @@ packages: cpu: [x64] os: [win32] - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - '@swc/core-darwin-arm64@1.7.6': resolution: {integrity: sha512-6lYHey84ZzsdtC7UuPheM4Rm0Inzxm6Sb8U6dmKc4eCx8JL0LfWG4LC5RsdsrTxnjTsbriWlnhZBffh8ijUHIQ==} engines: {node: '>=10'} @@ -1231,25 +1224,28 @@ packages: vite: ^5.0.0 vue: ^3.2.25 - '@vitest/coverage-istanbul@1.6.0': - resolution: {integrity: sha512-h/BwpXehkkS0qsNCS00QxiupAqVkNi0WT19BR0dQvlge5oHghoSVLx63fABYFoKxVb7Ue7+k6V2KokmQ1zdMpg==} + '@vitest/coverage-istanbul@2.0.5': + resolution: {integrity: sha512-BvjWKtp7fiMAeYUD0mO5cuADzn1gmjTm54jm5qUEnh/O08riczun8rI4EtQlg3bWoRo2lT3FO8DmjPDX9ZthPw==} peerDependencies: - vitest: 1.6.0 + vitest: 2.0.5 + + '@vitest/expect@2.0.5': + resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} - '@vitest/expect@1.6.0': - resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} + '@vitest/pretty-format@2.0.5': + resolution: {integrity: sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==} - '@vitest/runner@1.6.0': - resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} + '@vitest/runner@2.0.5': + resolution: {integrity: sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==} - '@vitest/snapshot@1.6.0': - resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} + '@vitest/snapshot@2.0.5': + resolution: {integrity: sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==} - '@vitest/spy@1.6.0': - resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} + '@vitest/spy@2.0.5': + resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==} - '@vitest/utils@1.6.0': - resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} + '@vitest/utils@2.0.5': + resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} '@vue/consolidate@1.0.0': resolution: {integrity: sha512-oTyUE+QHIzLw2PpV14GD/c7EohDyP64xCniWTcqcEmTd699eFqTIwOmtDYjcO1j3QgdXoJEoWv1/cCdLrRoOfg==} @@ -1270,10 +1266,6 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} @@ -1324,10 +1316,6 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} @@ -1358,8 +1346,9 @@ packages: assert-never@1.3.0: resolution: {integrity: sha512-9Z3vxQ+berkL/JJo0dK+EY3Lp0s3NtSnP3VCLsh5HDcZPrh0M+KQRK5sWhUeyPPH+/RCxZqOxLMR+YC6vlviEQ==} - assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} ast-types@0.13.4: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} @@ -1456,9 +1445,9 @@ packages: caniuse-lite@1.0.30001651: resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} - chai@4.5.0: - resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} - engines: {node: '>=4'} + chai@5.1.1: + resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==} + engines: {node: '>=12'} chalk-template@0.4.0: resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==} @@ -1483,8 +1472,9 @@ packages: character-parser@2.2.0: resolution: {integrity: sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==} - check-error@1.0.3: - resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} @@ -1556,9 +1546,6 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - confbox@0.1.7: - resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} - constantinople@4.0.1: resolution: {integrity: sha512-vCrqcSIq4//Gx74TXXCGnHpulY1dskqLTFGDmhrGxzeXL8lF8kvXv6mpNWlJj1uD4DW23D4ljAqbY4RRaaUZIw==} @@ -1700,8 +1687,8 @@ packages: decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} - deep-eql@4.1.4: - resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} deep-extend@0.6.0: @@ -1730,10 +1717,6 @@ packages: devtools-protocol@0.0.1312386: resolution: {integrity: sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==} - diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1982,9 +1965,6 @@ packages: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -2061,10 +2041,6 @@ packages: engines: {node: 20 || >=22} hasBin: true - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -2186,10 +2162,6 @@ packages: resolution: {integrity: sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==} engines: {node: '>=18'} - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2326,9 +2298,6 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-tokens@9.0.0: - resolution: {integrity: sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==} - js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -2413,10 +2382,6 @@ packages: resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} engines: {node: '>= 12.13.0'} - local-pkg@0.5.0: - resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} - engines: {node: '>=14'} - locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -2434,8 +2399,8 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} - loupe@2.3.7: - resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + loupe@3.1.1: + resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} lru-cache@10.1.0: resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==} @@ -2548,9 +2513,6 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - mlly@1.7.1: - resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} - monaco-editor@0.50.0: resolution: {integrity: sha512-8CclLCmrRRh+sul7C08BmPBP3P8wVWfBHomsTcndxg5NRCEPfu/mc2AGU8k37ajjDVXcXFc12ORAMUkmk+lkFA==} @@ -2644,10 +2606,6 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-limit@5.0.0: - resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} - engines: {node: '>=18'} - p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -2685,10 +2643,6 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - path-is-inside@1.0.2: resolution: {integrity: sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==} @@ -2721,8 +2675,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pathval@2.0.0: + resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + engines: {node: '>= 14.16'} pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} @@ -2739,9 +2694,6 @@ packages: engines: {node: '>=0.10'} hasBin: true - pkg-types@1.1.3: - resolution: {integrity: sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==} - postcss-modules-extract-imports@3.1.0: resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} engines: {node: ^10 || ^12 || >= 14} @@ -2795,10 +2747,6 @@ packages: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} - pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -2891,9 +2839,6 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-is@18.3.1: - resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - read-package-json-fast@3.0.2: resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -3167,9 +3112,6 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strip-literal@2.1.0: - resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} - supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3199,9 +3141,9 @@ packages: resolution: {integrity: sha512-bX655WZI/F7EoTDw9JvQURqAXiPHi8o8+yFxPF2lWYyz1aHnmMRuXWqL6YB6GmeO0o4DIYWHLgGNi/X64T+X4Q==} engines: {node: '>=14.18'} - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} + test-exclude@7.0.1: + resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} + engines: {node: '>=18'} text-decoder@1.1.1: resolution: {integrity: sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==} @@ -3215,12 +3157,16 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinypool@0.8.4: - resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} + tinypool@1.0.0: + resolution: {integrity: sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@1.2.0: + resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} - tinyspy@2.2.1: - resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} + tinyspy@3.0.0: + resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} engines: {node: '>=14.0.0'} to-fast-properties@2.0.0: @@ -3264,10 +3210,6 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - type-detect@4.1.0: - resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} - engines: {node: '>=4'} - type-fest@2.19.0: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} @@ -3290,9 +3232,6 @@ packages: engines: {node: '>=14.17'} hasBin: true - ufo@1.5.4: - resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} - uglify-js@3.19.1: resolution: {integrity: sha512-y/2wiW+ceTYR2TSSptAhfnEtpLaQ4Ups5zrjB2d3kuVxHj16j/QJwPl5PvuGy9uARb39J0+iKxcRPvtpsx4A4A==} engines: {node: '>=0.8.0'} @@ -3344,8 +3283,8 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - vite-node@1.6.0: - resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} + vite-node@2.0.5: + resolution: {integrity: sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -3380,15 +3319,15 @@ packages: terser: optional: true - vitest@1.6.0: - resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} + vitest@2.0.5: + resolution: {integrity: sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.6.0 - '@vitest/ui': 1.6.0 + '@vitest/browser': 2.0.5 + '@vitest/ui': 2.0.5 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -3515,10 +3454,6 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.1.1: - resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} - engines: {node: '>=12.20'} - zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} @@ -3840,10 +3775,6 @@ snapshots: '@istanbuljs/schema@0.1.3': {} - '@jest/schemas@29.6.3': - dependencies: - '@sinclair/typebox': 0.27.8 - '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -3996,8 +3927,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.20.0': optional: true - '@sinclair/typebox@0.27.8': {} - '@swc/core-darwin-arm64@1.7.6': optional: true @@ -4201,8 +4130,9 @@ snapshots: vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) vue: link:packages/vue - '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8))': + '@vitest/coverage-istanbul@2.0.5(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8))': dependencies: + '@istanbuljs/schema': 0.1.3 debug: 4.3.6 istanbul-lib-coverage: 3.2.2 istanbul-lib-instrument: 6.0.3 @@ -4210,40 +4140,44 @@ snapshots: istanbul-lib-source-maps: 5.0.6 istanbul-reports: 3.1.7 magicast: 0.3.4 - picocolors: 1.0.1 - test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + test-exclude: 7.0.1 + tinyrainbow: 1.2.0 + vitest: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color - '@vitest/expect@1.6.0': + '@vitest/expect@2.0.5': + dependencies: + '@vitest/spy': 2.0.5 + '@vitest/utils': 2.0.5 + chai: 5.1.1 + tinyrainbow: 1.2.0 + + '@vitest/pretty-format@2.0.5': dependencies: - '@vitest/spy': 1.6.0 - '@vitest/utils': 1.6.0 - chai: 4.5.0 + tinyrainbow: 1.2.0 - '@vitest/runner@1.6.0': + '@vitest/runner@2.0.5': dependencies: - '@vitest/utils': 1.6.0 - p-limit: 5.0.0 + '@vitest/utils': 2.0.5 pathe: 1.1.2 - '@vitest/snapshot@1.6.0': + '@vitest/snapshot@2.0.5': dependencies: + '@vitest/pretty-format': 2.0.5 magic-string: 0.30.11 pathe: 1.1.2 - pretty-format: 29.7.0 - '@vitest/spy@1.6.0': + '@vitest/spy@2.0.5': dependencies: - tinyspy: 2.2.1 + tinyspy: 3.0.0 - '@vitest/utils@1.6.0': + '@vitest/utils@2.0.5': dependencies: - diff-sequences: 29.6.3 + '@vitest/pretty-format': 2.0.5 estree-walker: 3.0.3 - loupe: 2.3.7 - pretty-format: 29.7.0 + loupe: 3.1.1 + tinyrainbow: 1.2.0 '@vue/consolidate@1.0.0': {} @@ -4260,10 +4194,6 @@ snapshots: dependencies: acorn: 8.12.1 - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - acorn@7.4.1: {} acorn@8.12.1: {} @@ -4312,8 +4242,6 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@5.2.0: {} - ansi-styles@6.2.1: {} anymatch@3.1.3: @@ -4335,7 +4263,7 @@ snapshots: assert-never@1.3.0: {} - assertion-error@1.1.0: {} + assertion-error@2.0.1: {} ast-types@0.13.4: dependencies: @@ -4438,15 +4366,13 @@ snapshots: caniuse-lite@1.0.30001651: {} - chai@4.5.0: + chai@5.1.1: dependencies: - assertion-error: 1.1.0 - check-error: 1.0.3 - deep-eql: 4.1.4 - get-func-name: 2.0.2 - loupe: 2.3.7 - pathval: 1.1.1 - type-detect: 4.1.0 + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.1.1 + pathval: 2.0.0 chalk-template@0.4.0: dependencies: @@ -4471,9 +4397,7 @@ snapshots: dependencies: is-regex: 1.1.4 - check-error@1.0.3: - dependencies: - get-func-name: 2.0.2 + check-error@2.1.1: {} chokidar@3.6.0: dependencies: @@ -4562,8 +4486,6 @@ snapshots: concat-map@0.0.1: {} - confbox@0.1.7: {} - constantinople@4.0.1: dependencies: '@babel/parser': 7.25.3 @@ -4699,9 +4621,7 @@ snapshots: decimal.js@10.4.3: {} - deep-eql@4.1.4: - dependencies: - type-detect: 4.1.0 + deep-eql@5.0.2: {} deep-extend@0.6.0: {} @@ -4725,8 +4645,6 @@ snapshots: devtools-protocol@0.0.1312386: {} - diff-sequences@29.6.3: {} - dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -4878,12 +4796,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)): + eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.4) eslint: 9.8.0 optionalDependencies: - vitest: 1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color - typescript @@ -5067,8 +4985,6 @@ snapshots: jsonfile: 6.1.0 universalify: 2.0.1 - fs.realpath@1.0.0: {} - fsevents@2.3.3: optional: true @@ -5157,15 +5073,6 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 2.0.0 - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - globals@11.12.0: {} globals@14.0.0: {} @@ -5273,11 +5180,6 @@ snapshots: index-to-position@0.1.2: {} - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - inherits@2.0.4: {} ini@1.3.8: {} @@ -5404,8 +5306,6 @@ snapshots: js-tokens@4.0.0: {} - js-tokens@9.0.0: {} - js-yaml@4.1.0: dependencies: argparse: 2.0.1 @@ -5517,11 +5417,6 @@ snapshots: loader-utils@3.3.1: {} - local-pkg@0.5.0: - dependencies: - mlly: 1.7.1 - pkg-types: 1.1.3 - locate-path@6.0.0: dependencies: p-locate: 5.0.0 @@ -5540,7 +5435,7 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 9.0.0 - loupe@2.3.7: + loupe@3.1.1: dependencies: get-func-name: 2.0.2 @@ -5629,13 +5524,6 @@ snapshots: mitt@3.0.1: {} - mlly@1.7.1: - dependencies: - acorn: 8.12.1 - pathe: 1.1.2 - pkg-types: 1.1.3 - ufo: 1.5.4 - monaco-editor@0.50.0: {} ms@2.0.0: {} @@ -5719,10 +5607,6 @@ snapshots: dependencies: yocto-queue: 0.1.0 - p-limit@5.0.0: - dependencies: - yocto-queue: 1.1.1 - p-locate@5.0.0: dependencies: p-limit: 3.1.0 @@ -5772,8 +5656,6 @@ snapshots: path-exists@4.0.0: {} - path-is-absolute@1.0.1: {} - path-is-inside@1.0.2: {} path-key@3.1.1: {} @@ -5798,7 +5680,7 @@ snapshots: pathe@1.1.2: {} - pathval@1.1.1: {} + pathval@2.0.0: {} pend@1.2.0: {} @@ -5808,12 +5690,6 @@ snapshots: pidtree@0.6.0: {} - pkg-types@1.1.3: - dependencies: - confbox: 0.1.7 - mlly: 1.7.1 - pathe: 1.1.2 - postcss-modules-extract-imports@3.1.0(postcss@8.4.41): dependencies: postcss: 8.4.41 @@ -5866,12 +5742,6 @@ snapshots: pretty-bytes@6.1.1: {} - pretty-format@29.7.0: - dependencies: - '@jest/schemas': 29.6.3 - ansi-styles: 5.2.0 - react-is: 18.3.1 - process-nextick-args@2.0.1: {} progress@2.0.3: {} @@ -6012,8 +5882,6 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-is@18.3.1: {} - read-package-json-fast@3.0.2: dependencies: json-parse-even-better-errors: 3.0.2 @@ -6319,10 +6187,6 @@ snapshots: strip-json-comments@3.1.1: {} - strip-literal@2.1.0: - dependencies: - js-tokens: 9.0.0 - supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -6355,11 +6219,11 @@ snapshots: dependencies: temp-dir: 3.0.0 - test-exclude@6.0.0: + test-exclude@7.0.1: dependencies: '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 + glob: 10.4.5 + minimatch: 9.0.5 text-decoder@1.1.1: dependencies: @@ -6371,9 +6235,11 @@ snapshots: tinybench@2.9.0: {} - tinypool@0.8.4: {} + tinypool@1.0.0: {} + + tinyrainbow@1.2.0: {} - tinyspy@2.2.1: {} + tinyspy@3.0.0: {} to-fast-properties@2.0.0: {} @@ -6413,8 +6279,6 @@ snapshots: dependencies: prelude-ls: 1.2.1 - type-detect@4.1.0: {} - type-fest@2.19.0: {} type-fest@4.24.0: {} @@ -6432,8 +6296,6 @@ snapshots: typescript@5.5.4: {} - ufo@1.5.4: {} - uglify-js@3.19.1: optional: true @@ -6481,12 +6343,12 @@ snapshots: vary@1.1.2: {} - vite-node@1.6.0(@types/node@20.14.14)(sass@1.77.8): + vite-node@2.0.5(@types/node@20.14.14)(sass@1.77.8): dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 - picocolors: 1.0.1 + tinyrainbow: 1.2.0 vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) transitivePeerDependencies: - '@types/node' @@ -6509,27 +6371,26 @@ snapshots: fsevents: 2.3.3 sass: 1.77.8 - vitest@1.6.0(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8): + vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8): dependencies: - '@vitest/expect': 1.6.0 - '@vitest/runner': 1.6.0 - '@vitest/snapshot': 1.6.0 - '@vitest/spy': 1.6.0 - '@vitest/utils': 1.6.0 - acorn-walk: 8.3.3 - chai: 4.5.0 + '@ampproject/remapping': 2.3.0 + '@vitest/expect': 2.0.5 + '@vitest/pretty-format': 2.0.5 + '@vitest/runner': 2.0.5 + '@vitest/snapshot': 2.0.5 + '@vitest/spy': 2.0.5 + '@vitest/utils': 2.0.5 + chai: 5.1.1 debug: 4.3.6 execa: 8.0.1 - local-pkg: 0.5.0 magic-string: 0.30.11 pathe: 1.1.2 - picocolors: 1.0.1 std-env: 3.7.0 - strip-literal: 2.1.0 tinybench: 2.9.0 - tinypool: 0.8.4 + tinypool: 1.0.0 + tinyrainbow: 1.2.0 vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) - vite-node: 1.6.0(@types/node@20.14.14)(sass@1.77.8) + vite-node: 2.0.5(@types/node@20.14.14)(sass@1.77.8) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.14.14 @@ -6638,6 +6499,4 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.1.1: {} - zod@3.23.8: {} diff --git a/vitest.config.ts b/vitest.config.ts index f63328ab4..0b6c014f4 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -23,6 +23,7 @@ export default defineConfig({ }, test: { globals: true, + pool: 'threads', setupFiles: 'scripts/setup-vitest.ts', environmentMatchGlobs: [ ['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom'], From 4085def1bae42d01ee3c22c731cc4a02096464ee Mon Sep 17 00:00:00 2001 From: edison Date: Sat, 10 Aug 2024 15:54:38 +0800 Subject: [PATCH 003/210] fix(reactivity): ensure extended method arguments are not lost (#11574) close #11570 --- .../__tests__/reactiveArray.spec.ts | 95 +++++++++++++++++++ .../reactivity/src/arrayInstrumentations.ts | 29 +++--- 2 files changed, 113 insertions(+), 11 deletions(-) diff --git a/packages/reactivity/__tests__/reactiveArray.spec.ts b/packages/reactivity/__tests__/reactiveArray.spec.ts index 6ea3c9539..960c16e0b 100644 --- a/packages/reactivity/__tests__/reactiveArray.spec.ts +++ b/packages/reactivity/__tests__/reactiveArray.spec.ts @@ -622,5 +622,100 @@ describe('reactivity/reactive/Array', () => { const firstItem = Array.from(deep.values())[0] expect(isReactive(firstItem)).toBe(true) }) + + test('extend methods', () => { + class Collection extends Array { + // @ts-expect-error + every(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.every(obj => obj.id === foo) + } + + // @ts-expect-error + filter(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.filter(obj => obj.id === foo) + } + + // @ts-expect-error + find(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.find(obj => obj.id === foo) + } + + // @ts-expect-error + findIndex(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.findIndex(obj => obj.id === bar) + } + + findLast(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + // @ts-expect-error our code is limited to es2016 but user code is not + return super.findLast(obj => obj.id === bar) + } + + findLastIndex(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.findIndex(obj => obj.id === bar) + } + + // @ts-expect-error + forEach(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + } + + // @ts-expect-error + map(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.map(obj => obj.value) + } + + // @ts-expect-error + some(foo: any, bar: any, baz: any) { + expect(foo).toBe('foo') + expect(bar).toBe('bar') + expect(baz).toBe('baz') + return super.some(obj => obj.id === baz) + } + } + + const state = reactive({ + things: new Collection(), + }) + + const foo = { id: 'foo', value: '1' } + const bar = { id: 'bar', value: '2' } + const baz = { id: 'baz', value: '3' } + state.things.push(foo) + state.things.push(bar) + state.things.push(baz) + + expect(state.things.every('foo', 'bar', 'baz')).toBe(false) + expect(state.things.filter('foo', 'bar', 'baz')).toEqual([foo]) + expect(state.things.find('foo', 'bar', 'baz')).toBe(foo) + expect(state.things.findIndex('foo', 'bar', 'baz')).toBe(1) + expect(state.things.findLast('foo', 'bar', 'baz')).toBe(bar) + expect(state.things.findLastIndex('foo', 'bar', 'baz')).toBe(1) + expect(state.things.forEach('foo', 'bar', 'baz')).toBeUndefined() + expect(state.things.map('foo', 'bar', 'baz')).toEqual(['1', '2', '3']) + expect(state.things.some('foo', 'bar', 'baz')).toBe(true) + }) }) }) diff --git a/packages/reactivity/src/arrayInstrumentations.ts b/packages/reactivity/src/arrayInstrumentations.ts index 69f08d6c5..58c31835d 100644 --- a/packages/reactivity/src/arrayInstrumentations.ts +++ b/packages/reactivity/src/arrayInstrumentations.ts @@ -47,42 +47,42 @@ export const arrayInstrumentations: Record = { fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, ) { - return apply(this, 'every', fn, thisArg) + return apply(this, 'every', fn, thisArg, undefined, arguments) }, filter( fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, ) { - return apply(this, 'filter', fn, thisArg, v => v.map(toReactive)) + return apply(this, 'filter', fn, thisArg, v => v.map(toReactive), arguments) }, find( fn: (item: unknown, index: number, array: unknown[]) => boolean, thisArg?: unknown, ) { - return apply(this, 'find', fn, thisArg, toReactive) + return apply(this, 'find', fn, thisArg, toReactive, arguments) }, findIndex( fn: (item: unknown, index: number, array: unknown[]) => boolean, thisArg?: unknown, ) { - return apply(this, 'findIndex', fn, thisArg) + return apply(this, 'findIndex', fn, thisArg, undefined, arguments) }, findLast( fn: (item: unknown, index: number, array: unknown[]) => boolean, thisArg?: unknown, ) { - return apply(this, 'findLast', fn, thisArg, toReactive) + return apply(this, 'findLast', fn, thisArg, toReactive, arguments) }, findLastIndex( fn: (item: unknown, index: number, array: unknown[]) => boolean, thisArg?: unknown, ) { - return apply(this, 'findLastIndex', fn, thisArg) + return apply(this, 'findLastIndex', fn, thisArg, undefined, arguments) }, // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement @@ -91,7 +91,7 @@ export const arrayInstrumentations: Record = { fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, ) { - return apply(this, 'forEach', fn, thisArg) + return apply(this, 'forEach', fn, thisArg, undefined, arguments) }, includes(...args: unknown[]) { @@ -116,7 +116,7 @@ export const arrayInstrumentations: Record = { fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, ) { - return apply(this, 'map', fn, thisArg) + return apply(this, 'map', fn, thisArg, undefined, arguments) }, pop() { @@ -161,7 +161,7 @@ export const arrayInstrumentations: Record = { fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, ) { - return apply(this, 'some', fn, thisArg) + return apply(this, 'some', fn, thisArg, undefined, arguments) }, splice(...args: unknown[]) { @@ -227,6 +227,7 @@ function iterator( // higher than that type ArrayMethods = keyof Array | 'findLast' | 'findLastIndex' +const arrayProto = Array.prototype // instrument functions that read (potentially) all items // to take ARRAY_ITERATE dependency function apply( @@ -235,8 +236,15 @@ function apply( fn: (item: unknown, index: number, array: unknown[]) => unknown, thisArg?: unknown, wrappedRetFn?: (result: any) => unknown, + args?: IArguments, ) { const arr = shallowReadArray(self) + let methodFn + // @ts-expect-error our code is limited to es2016 but user code is not + if ((methodFn = arr[method]) !== arrayProto[method]) { + return methodFn.apply(arr, args) + } + let needsWrap = false let wrappedFn = fn if (arr !== self) { @@ -251,8 +259,7 @@ function apply( } } } - // @ts-expect-error our code is limited to es2016 but user code is not - const result = arr[method](wrappedFn, thisArg) + const result = methodFn.call(arr, wrappedFn, thisArg) return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result } From 90caac473db6ef343e74e78161b57787fd601fe8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 10 Aug 2024 16:39:20 +0800 Subject: [PATCH 004/210] test(custom-element): test custom element hydration w/ declarative shadow dom --- packages/runtime-core/src/hydration.ts | 9 ++-- packages/runtime-dom/src/apiCustomElement.ts | 11 +++-- packages/vue/__tests__/e2e/e2eUtils.ts | 12 +++-- .../vue/__tests__/e2e/ssr-custom-element.html | 44 +++++++++++++++++++ .../__tests__/e2e/ssr-custom-element.spec.ts | 35 +++++++++++++++ 5 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 packages/vue/__tests__/e2e/ssr-custom-element.html create mode 100644 packages/vue/__tests__/e2e/ssr-custom-element.spec.ts diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 1ee34bb35..8060f9475 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -69,9 +69,12 @@ const isSVGContainer = (container: Element) => const isMathMLContainer = (container: Element) => container.namespaceURI!.includes('MathML') -const getContainerType = (container: Element): 'svg' | 'mathml' | undefined => { - if (isSVGContainer(container)) return 'svg' - if (isMathMLContainer(container)) return 'mathml' +const getContainerType = ( + container: Element | ShadowRoot, +): 'svg' | 'mathml' | undefined => { + if (container.nodeType !== DOMNodeTypes.ELEMENT) return undefined + if (isSVGContainer(container as Element)) return 'svg' + if (isMathMLContainer(container as Element)) return 'mathml' return undefined } diff --git a/packages/runtime-dom/src/apiCustomElement.ts b/packages/runtime-dom/src/apiCustomElement.ts index 26e595cb7..efee4d8a9 100644 --- a/packages/runtime-dom/src/apiCustomElement.ts +++ b/packages/runtime-dom/src/apiCustomElement.ts @@ -250,8 +250,6 @@ export class VueElement super() if (this.shadowRoot && _createApp !== createApp) { this._root = this.shadowRoot - // TODO hydration needs to be reworked - this._mount(_def) } else { if (__DEV__ && this.shadowRoot) { warn( @@ -265,10 +263,11 @@ export class VueElement } else { this._root = this } - if (!(this._def as ComponentOptions).__asyncLoader) { - // for sync component defs we can immediately resolve props - this._resolveProps(this._def) - } + } + + if (!(this._def as ComponentOptions).__asyncLoader) { + // for sync component defs we can immediately resolve props + this._resolveProps(this._def) } } diff --git a/packages/vue/__tests__/e2e/e2eUtils.ts b/packages/vue/__tests__/e2e/e2eUtils.ts index fd4abc56e..87e99ac7b 100644 --- a/packages/vue/__tests__/e2e/e2eUtils.ts +++ b/packages/vue/__tests__/e2e/e2eUtils.ts @@ -5,7 +5,7 @@ import puppeteer, { type PuppeteerLaunchOptions, } from 'puppeteer' -export const E2E_TIMEOUT = 30 * 1000 +export const E2E_TIMEOUT: number = 30 * 1000 const puppeteerOptions: PuppeteerLaunchOptions = { args: process.env.CI ? ['--no-sandbox', '--disable-setuid-sandbox'] : [], @@ -13,12 +13,13 @@ const puppeteerOptions: PuppeteerLaunchOptions = { } const maxTries = 30 -export const timeout = (n: number) => new Promise(r => setTimeout(r, n)) +export const timeout = (n: number): Promise => + new Promise(r => setTimeout(r, n)) export async function expectByPolling( poll: () => Promise, expected: string, -) { +): Promise { for (let tries = 0; tries < maxTries; tries++) { const actual = (await poll()) || '' if (actual.indexOf(expected) > -1 || tries === maxTries - 1) { @@ -55,10 +56,7 @@ export function setupPuppeteer(args?: string[]) { page.on('console', e => { if (e.type() === 'error') { const err = e.args()[0] - console.error( - `Error from Puppeteer-loaded page:\n`, - err.remoteObject().description, - ) + console.error(`Error from Puppeteer-loaded page:\n`, err.remoteObject()) } }) }) diff --git a/packages/vue/__tests__/e2e/ssr-custom-element.html b/packages/vue/__tests__/e2e/ssr-custom-element.html new file mode 100644 index 000000000..14139c2d5 --- /dev/null +++ b/packages/vue/__tests__/e2e/ssr-custom-element.html @@ -0,0 +1,44 @@ + + + + + + diff --git a/packages/vue/__tests__/e2e/ssr-custom-element.spec.ts b/packages/vue/__tests__/e2e/ssr-custom-element.spec.ts new file mode 100644 index 000000000..0c8413d17 --- /dev/null +++ b/packages/vue/__tests__/e2e/ssr-custom-element.spec.ts @@ -0,0 +1,35 @@ +import path from 'node:path' +import { setupPuppeteer } from './e2eUtils' + +const { page, click, text } = setupPuppeteer() + +// this must be tested in actual Chrome because jsdom does not support +// declarative shadow DOM +test('ssr custom element hydration', async () => { + await page().goto( + `file://${path.resolve(__dirname, './ssr-custom-element.html')}`, + ) + + function getColor() { + return page().evaluate(() => { + return [ + (document.querySelector('my-element') as any).style.border, + (document.querySelector('my-element-async') as any).style.border, + ] + }) + } + + expect(await getColor()).toMatchObject(['1px solid red', '']) + await page().evaluate(() => (window as any).resolve()) // exposed by test + expect(await getColor()).toMatchObject(['1px solid red', '1px solid red']) + + async function assertInteraction(el: string) { + const selector = `${el} >>> button` + expect(await text(selector)).toBe('1') + await click(selector) + expect(await text(selector)).toBe('2') + } + + await assertInteraction('my-element') + await assertInteraction('my-element-async') +}) From 0a16eae24963e34ed016c8472a2a39065a0b237f Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 11 Aug 2024 21:48:08 +0800 Subject: [PATCH 005/210] chore: log stats in size script --- scripts/usage-size.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/scripts/usage-size.ts b/scripts/usage-size.ts index d05273de0..aa8a29fa9 100644 --- a/scripts/usage-size.ts +++ b/scripts/usage-size.ts @@ -5,6 +5,20 @@ import nodeResolve from '@rollup/plugin-node-resolve' import { minify } from '@swc/core' import replace from '@rollup/plugin-replace' import { brotliCompressSync, gzipSync } from 'node:zlib' +import { parseArgs } from 'node:util' +import pico from 'picocolors' +import prettyBytes from 'pretty-bytes' + +const { + values: { write }, +} = parseArgs({ + options: { + write: { + type: 'boolean', + default: false, + }, + }, +}) const sizeDir = path.resolve('temp/size') const entry = path.resolve('./packages/vue/dist/vue.runtime.esm-bundler.js') @@ -34,6 +48,7 @@ const presets: Preset[] = [ main() async function main() { + console.log() const tasks: ReturnType[] = [] for (const preset of presets) { tasks.push(generateBundle(preset)) @@ -46,7 +61,7 @@ async function main() { await mkdir(sizeDir, { recursive: true }) await writeFile( path.resolve(sizeDir, '_usages.json'), - JSON.stringify(results), + JSON.stringify(results, null, 2), 'utf-8', ) } @@ -91,6 +106,16 @@ async function generateBundle(preset: Preset) { const gzip = gzipSync(minified).length const brotli = brotliCompressSync(minified).length + if (write) { + await writeFile(path.resolve(sizeDir, preset.name + '.js'), bundled) + } + + console.log( + `${pico.green(pico.bold(preset.name))} - min:${prettyBytes( + size, + )} / gzip:${prettyBytes(gzip)} / brotli:${prettyBytes(brotli)}`, + ) + return { name: preset.name, size, From 8921c2df8555df377abaede4eacb9684f67aef88 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 06:35:29 +0800 Subject: [PATCH 006/210] workflow: test publish commit workflow --- .github/workflows/publish-commit.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/publish-commit.yml diff --git a/.github/workflows/publish-commit.yml b/.github/workflows/publish-commit.yml new file mode 100644 index 000000000..9626a9a60 --- /dev/null +++ b/.github/workflows/publish-commit.yml @@ -0,0 +1,39 @@ +name: publish-commit + +on: + workflow_run: + workflows: ['ci'] + branches: [main, minor, test-publish] + types: + - completed + +jobs: + pubilsh: + if: > + github.repository == 'vuejs/core' && + github.event.workflow_run.event == 'push' && + github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + registry-url: 'https://npm.pkg.github.com' + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build and publish + id: publish + run: | + pnpm release 0.0.0-${{ github.event.workflow_run.head_commit }} --tag ${{ github.event.workflow_run.head_branch }} --publishOnly + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a1ee8b719f8cdeb06b190075463862c971fca885 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 06:45:44 +0800 Subject: [PATCH 007/210] workflow: handle targetVersion in release script with publishOnly flag --- scripts/release.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/release.js b/scripts/release.js index 5cb492e21..398cfbdef 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -563,6 +563,10 @@ async function publishPackage(pkgName, version, additionalFlags) { } async function publishOnly() { + const targetVersion = positionals[0] + if (targetVersion) { + updateVersions(targetVersion) + } await buildPackages() await publishPackages(currentVersion) } From 119a0b38322196893b652434a0a86461ead813ad Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 07:05:06 +0800 Subject: [PATCH 008/210] workflow: use explicit registry when publishing --- .github/workflows/publish-commit.yml | 2 +- scripts/release.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-commit.yml b/.github/workflows/publish-commit.yml index 9626a9a60..3b9212309 100644 --- a/.github/workflows/publish-commit.yml +++ b/.github/workflows/publish-commit.yml @@ -34,6 +34,6 @@ jobs: - name: Build and publish id: publish run: | - pnpm release 0.0.0-${{ github.event.workflow_run.head_commit }} --tag ${{ github.event.workflow_run.head_branch }} --publishOnly + pnpm release 0.0.0-${{ github.event.workflow_run.head_commit.id }} --tag ${{ github.event.workflow_run.head_branch }} --registry https://npm.pkg.github.com --publishOnly env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/release.js b/scripts/release.js index 398cfbdef..7082b25ce 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -58,6 +58,9 @@ const { values: args, positionals } = parseArgs({ publishOnly: { type: 'boolean', }, + registry: { + type: 'string', + }, }, }) @@ -545,6 +548,7 @@ async function publishPackage(pkgName, version, additionalFlags) { ...(releaseTag ? ['--tag', releaseTag] : []), '--access', 'public', + ...(args.registry ? ['--registry', args.registry] : []), ...additionalFlags, ], { From cac1e4e7f6701ab8d106cea6c6aabffd058de600 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 07:15:42 +0800 Subject: [PATCH 009/210] workflow: skip provenance when publishing commits --- scripts/release.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/release.js b/scripts/release.js index 7082b25ce..d56522a72 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -507,7 +507,8 @@ async function publishPackages(version) { } // add provenance metadata when releasing from CI // canary release commits are not pushed therefore we don't need to add provenance - if (process.env.CI && !isCanary) { + // also skip provenance if not publishing to actual npm + if (process.env.CI && !isCanary && !args.registry) { additionalPublishFlags.push('--provenance') } From 6a5b2098e1c9573fd050b0d56d0f85516f10c32b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 08:02:03 +0800 Subject: [PATCH 010/210] workflow: move private packages to separate directory --- .github/contributing.md | 4 +- .github/renovate.json5 | 4 +- eslint.config.js | 11 +- package.json | 6 +- .../dts-built-test/README.md | 2 +- .../dts-built-test/package.json | 2 +- .../dts-built-test/src/index.ts | 0 .../dts-built-test/tsconfig.json | 0 .../dts-test/README.md | 2 +- .../dts-test/appDirective.test-d.ts | 0 .../dts-test/appUse.test-d.ts | 0 .../dts-test/built.test-d.ts | 2 +- .../dts-test/compiler.test-d.ts | 0 .../dts-test/component.test-d.ts | 0 .../dts-test/componentInstance.test-d.tsx | 0 .../componentTypeExtensions.test-d.tsx | 0 .../dts-test/defineComponent.test-d.tsx | 0 .../dts-test/defineCustomElement.test-d.ts | 0 .../dts-test/directives.test-d.ts | 0 .../dts-test/extractProps.test-d.ts | 0 .../dts-test/functionalComponent.test-d.tsx | 0 .../dts-test/h.test-d.ts | 0 .../dts-test/inject.test-d.ts | 0 .../dts-test/package.json | 2 +- .../dts-test/reactivity.test-d.ts | 0 .../dts-test/ref.test-d.ts | 0 .../dts-test/setupHelpers.test-d.ts | 0 .../dts-test/tsconfig.test.json | 0 .../dts-test/tsx.test-d.tsx | 0 .../dts-test/utils.d.ts | 0 .../dts-test/watch.test-d.ts | 0 .../sfc-playground/README.md | 0 .../sfc-playground/index.html | 0 .../sfc-playground/package.json | 2 +- .../sfc-playground/public/logo.svg | 0 .../sfc-playground/src/App.vue | 0 .../sfc-playground/src/Header.vue | 2 +- .../sfc-playground/src/VersionSelect.vue | 0 .../sfc-playground/src/download/download.ts | 0 .../src/download/template/README.md | 0 .../src/download/template/index.html | 0 .../src/download/template/main.js | 0 .../src/download/template/package.json | 0 .../src/download/template/vite.config.js | 0 .../sfc-playground/src/icons/Copy.vue | 0 .../sfc-playground/src/icons/Download.vue | 0 .../sfc-playground/src/icons/GitHub.vue | 0 .../sfc-playground/src/icons/Moon.vue | 0 .../sfc-playground/src/icons/Reload.vue | 0 .../sfc-playground/src/icons/Share.vue | 0 .../sfc-playground/src/icons/Sun.vue | 0 .../sfc-playground/src/main.ts | 0 .../sfc-playground/src/vue-dev-proxy-prod.ts | 0 .../sfc-playground/src/vue-dev-proxy.ts | 0 .../src/vue-server-renderer-dev-proxy.ts | 0 .../sfc-playground/vercel.json | 0 .../sfc-playground/vite.config.ts | 12 +- .../template-explorer/README.md | 0 .../template-explorer/_redirects | 0 .../template-explorer/index.html | 0 .../template-explorer/local.html | 0 .../template-explorer/package.json | 0 .../template-explorer/src/index.ts | 0 .../template-explorer/src/options.ts | 0 .../template-explorer/src/theme.ts | 0 .../template-explorer/style.css | 0 packages-private/vite-debug/App.vue | 15 +++ packages-private/vite-debug/README.md | 1 + packages-private/vite-debug/index.html | 2 + packages-private/vite-debug/main.ts | 6 + packages-private/vite-debug/package.json | 15 +++ packages-private/vite-debug/tsconfig.json | 7 ++ packages-private/vite-debug/vite.config.ts | 6 + pnpm-lock.yaml | 119 ++++++++++-------- pnpm-workspace.yaml | 2 + rollup.config.js | 7 +- scripts/build.js | 17 ++- scripts/utils.js | 29 +++-- tsconfig.json | 5 +- vitest.config.ts | 2 +- 80 files changed, 187 insertions(+), 97 deletions(-) rename {packages => packages-private}/dts-built-test/README.md (65%) rename {packages => packages-private}/dts-built-test/package.json (85%) rename {packages => packages-private}/dts-built-test/src/index.ts (100%) rename {packages => packages-private}/dts-built-test/tsconfig.json (100%) rename {packages => packages-private}/dts-test/README.md (52%) rename {packages => packages-private}/dts-test/appDirective.test-d.ts (100%) rename {packages => packages-private}/dts-test/appUse.test-d.ts (100%) rename {packages => packages-private}/dts-test/built.test-d.ts (82%) rename {packages => packages-private}/dts-test/compiler.test-d.ts (100%) rename {packages => packages-private}/dts-test/component.test-d.ts (100%) rename {packages => packages-private}/dts-test/componentInstance.test-d.tsx (100%) rename {packages => packages-private}/dts-test/componentTypeExtensions.test-d.tsx (100%) rename {packages => packages-private}/dts-test/defineComponent.test-d.tsx (100%) rename {packages => packages-private}/dts-test/defineCustomElement.test-d.ts (100%) rename {packages => packages-private}/dts-test/directives.test-d.ts (100%) rename {packages => packages-private}/dts-test/extractProps.test-d.ts (100%) rename {packages => packages-private}/dts-test/functionalComponent.test-d.tsx (100%) rename {packages => packages-private}/dts-test/h.test-d.ts (100%) rename {packages => packages-private}/dts-test/inject.test-d.ts (100%) rename {packages => packages-private}/dts-test/package.json (74%) rename {packages => packages-private}/dts-test/reactivity.test-d.ts (100%) rename {packages => packages-private}/dts-test/ref.test-d.ts (100%) rename {packages => packages-private}/dts-test/setupHelpers.test-d.ts (100%) rename {packages => packages-private}/dts-test/tsconfig.test.json (100%) rename {packages => packages-private}/dts-test/tsx.test-d.tsx (100%) rename {packages => packages-private}/dts-test/utils.d.ts (100%) rename {packages => packages-private}/dts-test/watch.test-d.ts (100%) rename {packages => packages-private}/sfc-playground/README.md (100%) rename {packages => packages-private}/sfc-playground/index.html (100%) rename {packages => packages-private}/sfc-playground/package.json (90%) rename {packages => packages-private}/sfc-playground/public/logo.svg (100%) rename {packages => packages-private}/sfc-playground/src/App.vue (100%) rename {packages => packages-private}/sfc-playground/src/Header.vue (98%) rename {packages => packages-private}/sfc-playground/src/VersionSelect.vue (100%) rename {packages => packages-private}/sfc-playground/src/download/download.ts (100%) rename {packages => packages-private}/sfc-playground/src/download/template/README.md (100%) rename {packages => packages-private}/sfc-playground/src/download/template/index.html (100%) rename {packages => packages-private}/sfc-playground/src/download/template/main.js (100%) rename {packages => packages-private}/sfc-playground/src/download/template/package.json (100%) rename {packages => packages-private}/sfc-playground/src/download/template/vite.config.js (100%) rename {packages => packages-private}/sfc-playground/src/icons/Copy.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/Download.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/GitHub.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/Moon.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/Reload.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/Share.vue (100%) rename {packages => packages-private}/sfc-playground/src/icons/Sun.vue (100%) rename {packages => packages-private}/sfc-playground/src/main.ts (100%) rename {packages => packages-private}/sfc-playground/src/vue-dev-proxy-prod.ts (100%) rename {packages => packages-private}/sfc-playground/src/vue-dev-proxy.ts (100%) rename {packages => packages-private}/sfc-playground/src/vue-server-renderer-dev-proxy.ts (100%) rename {packages => packages-private}/sfc-playground/vercel.json (100%) rename {packages => packages-private}/sfc-playground/vite.config.ts (77%) rename {packages => packages-private}/template-explorer/README.md (100%) rename {packages => packages-private}/template-explorer/_redirects (100%) rename {packages => packages-private}/template-explorer/index.html (100%) rename {packages => packages-private}/template-explorer/local.html (100%) rename {packages => packages-private}/template-explorer/package.json (100%) rename {packages => packages-private}/template-explorer/src/index.ts (100%) rename {packages => packages-private}/template-explorer/src/options.ts (100%) rename {packages => packages-private}/template-explorer/src/theme.ts (100%) rename {packages => packages-private}/template-explorer/style.css (100%) create mode 100644 packages-private/vite-debug/App.vue create mode 100644 packages-private/vite-debug/README.md create mode 100644 packages-private/vite-debug/index.html create mode 100644 packages-private/vite-debug/main.ts create mode 100644 packages-private/vite-debug/package.json create mode 100644 packages-private/vite-debug/tsconfig.json create mode 100644 packages-private/vite-debug/vite.config.ts diff --git a/.github/contributing.md b/.github/contributing.md index 6439f1239..2554582b8 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -236,7 +236,7 @@ Tests that test against source code are grouped under `nr test-unit`, while test ### `nr test-dts` -Runs `nr build-dts` first, then verify the type tests in `packages/dts-test` are working correctly against the actual built type declarations. +Runs `nr build-dts` first, then verify the type tests in `packages-private/dts-test` are working correctly against the actual built type declarations. ## Project Structure @@ -335,7 +335,7 @@ Test coverage is continuously deployed at https://coverage.vuejs.org. PRs that i ### Testing Type Definition Correctness -Type tests are located in the `packages/dts-test` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by running `nr test-dts-only`. +Type tests are located in the `packages-private/dts-test` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by running `nr test-dts-only`. ## Financial Contribution diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 9c0458702..f13e5dd97 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -17,8 +17,8 @@ { groupName: 'playground', matchFileNames: [ - 'packages/sfc-playground/package.json', - 'packages/template-explorer/package.json', + 'packages-private/sfc-playground/package.json', + 'packages-private/template-explorer/package.json', ], }, { diff --git a/eslint.config.js b/eslint.config.js index 334787fd9..2e752e191 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -76,7 +76,11 @@ export default tseslint.config( // tests, no restrictions (runs in Node / Vitest with jsdom) { - files: ['**/__tests__/**', 'packages/dts-test/**'], + files: [ + '**/__tests__/**', + 'packages-private/dts-test/**', + 'packages-private/dts-build-test/**', + ], plugins: { vitest }, languageOptions: { globals: { @@ -119,7 +123,10 @@ export default tseslint.config( // Private package, browser only + no syntax restrictions { - files: ['packages/template-explorer/**', 'packages/sfc-playground/**'], + files: [ + 'packages-private/template-explorer/**', + 'packages-private/sfc-playground/**', + ], rules: { 'no-restricted-globals': ['error', ...NodeGlobals], 'no-restricted-syntax': ['error', banConstEnum], diff --git a/package.json b/package.json index 240dad49a..d9ab4b983 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test-unit": "vitest -c vitest.unit.config.ts", "test-e2e": "node scripts/build.js vue -f global -d && vitest -c vitest.e2e.config.ts", "test-dts": "run-s build-dts test-dts-only", - "test-dts-only": "tsc -p packages/dts-built-test/tsconfig.json && tsc -p ./packages/dts-test/tsconfig.test.json", + "test-dts-only": "tsc -p packages-private/dts-built-test/tsconfig.json && tsc -p ./packages-private/dts-test/tsconfig.test.json", "test-coverage": "vitest -c vitest.unit.config.ts --coverage", "test-bench": "vitest bench", "release": "node scripts/release.js", @@ -29,7 +29,7 @@ "dev-compiler": "run-p \"dev template-explorer\" serve", "dev-sfc": "run-s dev-sfc-prepare dev-sfc-run", "dev-sfc-prepare": "node scripts/pre-dev-sfc.js || npm run build-all-cjs", - "dev-sfc-serve": "vite packages/sfc-playground --host", + "dev-sfc-serve": "vite packages-private/sfc-playground --host", "dev-sfc-run": "run-p \"dev compiler-sfc -f esm-browser\" \"dev vue -if esm-bundler-runtime\" \"dev vue -ipf esm-browser-runtime\" \"dev server-renderer -if esm-bundler\" dev-sfc-serve", "serve": "serve", "open": "open http://localhost:3000/packages/template-explorer/local.html", @@ -38,7 +38,7 @@ "build-runtime-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js vue -f esm-browser-runtime", "build-browser-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler && node scripts/build.js vue -f esm-browser", "build-ssr-esm": "node scripts/build.js compiler-sfc server-renderer -f esm-browser", - "build-sfc-playground-self": "cd packages/sfc-playground && npm run build", + "build-sfc-playground-self": "cd packages-private/sfc-playground && npm run build", "preinstall": "npx only-allow pnpm", "postinstall": "simple-git-hooks" }, diff --git a/packages/dts-built-test/README.md b/packages-private/dts-built-test/README.md similarity index 65% rename from packages/dts-built-test/README.md rename to packages-private/dts-built-test/README.md index 8191d66e3..5c14f2190 100644 --- a/packages/dts-built-test/README.md +++ b/packages-private/dts-built-test/README.md @@ -2,4 +2,4 @@ This package is private and for testing only. It is used to verify edge cases for external libraries that build their types using Vue core types - e.g. Vuetify as in [#8376](https://github.com/vuejs/core/issues/8376). -When running the `build-dts` task, this package's types are built alongside other packages. Then, during `test-dts-only` it is imported and used in [`packages/dts-test/built.test-d.ts`](https://github.com/vuejs/core/blob/main/packages/dts-test/built.test-d.ts) to verify that the built types work correctly. +When running the `build-dts` task, this package's types are built alongside other packages. Then, during `test-dts-only` it is imported and used in [`packages-private/dts-test/built.test-d.ts`](https://github.com/vuejs/core/blob/main/packages-private/dts-test/built.test-d.ts) to verify that the built types work correctly. diff --git a/packages/dts-built-test/package.json b/packages-private/dts-built-test/package.json similarity index 85% rename from packages/dts-built-test/package.json rename to packages-private/dts-built-test/package.json index dd81cab68..ffcaa4a67 100644 --- a/packages/dts-built-test/package.json +++ b/packages-private/dts-built-test/package.json @@ -1,5 +1,5 @@ { - "name": "@vue/dts-built-test", + "name": "dts-built-test", "private": true, "version": "0.0.0", "types": "dist/index.d.ts", diff --git a/packages/dts-built-test/src/index.ts b/packages-private/dts-built-test/src/index.ts similarity index 100% rename from packages/dts-built-test/src/index.ts rename to packages-private/dts-built-test/src/index.ts diff --git a/packages/dts-built-test/tsconfig.json b/packages-private/dts-built-test/tsconfig.json similarity index 100% rename from packages/dts-built-test/tsconfig.json rename to packages-private/dts-built-test/tsconfig.json diff --git a/packages/dts-test/README.md b/packages-private/dts-test/README.md similarity index 52% rename from packages/dts-test/README.md rename to packages-private/dts-test/README.md index f75cc8b8d..075fc3431 100644 --- a/packages/dts-test/README.md +++ b/packages-private/dts-test/README.md @@ -4,4 +4,4 @@ Tests TypeScript types to ensure the types remain as expected. - This directory is included in the root `tsconfig.json`, where package imports are aliased to `src` directories, so in IDEs and the `pnpm check` script the types are validated against source code. -- When running `tsc` with `packages/dts-test/tsconfig.test.json`, packages are resolved using normal `node` resolution, so the types are validated against actual **built** types. This requires the types to be built first via `pnpm build-dts`. +- When running `tsc` with `packages-private/dts-test/tsconfig.test.json`, packages are resolved using normal `node` resolution, so the types are validated against actual **built** types. This requires the types to be built first via `pnpm build-dts`. diff --git a/packages/dts-test/appDirective.test-d.ts b/packages-private/dts-test/appDirective.test-d.ts similarity index 100% rename from packages/dts-test/appDirective.test-d.ts rename to packages-private/dts-test/appDirective.test-d.ts diff --git a/packages/dts-test/appUse.test-d.ts b/packages-private/dts-test/appUse.test-d.ts similarity index 100% rename from packages/dts-test/appUse.test-d.ts rename to packages-private/dts-test/appUse.test-d.ts diff --git a/packages/dts-test/built.test-d.ts b/packages-private/dts-test/built.test-d.ts similarity index 82% rename from packages/dts-test/built.test-d.ts rename to packages-private/dts-test/built.test-d.ts index ebff2955c..c2b4fb6d8 100644 --- a/packages/dts-test/built.test-d.ts +++ b/packages-private/dts-test/built.test-d.ts @@ -1,4 +1,4 @@ -import { CustomPropsNotErased } from '@vue/dts-built-test' +import { CustomPropsNotErased } from 'dts-built-test/src/index' import { describe, expectType } from './utils' declare module 'vue' { diff --git a/packages/dts-test/compiler.test-d.ts b/packages-private/dts-test/compiler.test-d.ts similarity index 100% rename from packages/dts-test/compiler.test-d.ts rename to packages-private/dts-test/compiler.test-d.ts diff --git a/packages/dts-test/component.test-d.ts b/packages-private/dts-test/component.test-d.ts similarity index 100% rename from packages/dts-test/component.test-d.ts rename to packages-private/dts-test/component.test-d.ts diff --git a/packages/dts-test/componentInstance.test-d.tsx b/packages-private/dts-test/componentInstance.test-d.tsx similarity index 100% rename from packages/dts-test/componentInstance.test-d.tsx rename to packages-private/dts-test/componentInstance.test-d.tsx diff --git a/packages/dts-test/componentTypeExtensions.test-d.tsx b/packages-private/dts-test/componentTypeExtensions.test-d.tsx similarity index 100% rename from packages/dts-test/componentTypeExtensions.test-d.tsx rename to packages-private/dts-test/componentTypeExtensions.test-d.tsx diff --git a/packages/dts-test/defineComponent.test-d.tsx b/packages-private/dts-test/defineComponent.test-d.tsx similarity index 100% rename from packages/dts-test/defineComponent.test-d.tsx rename to packages-private/dts-test/defineComponent.test-d.tsx diff --git a/packages/dts-test/defineCustomElement.test-d.ts b/packages-private/dts-test/defineCustomElement.test-d.ts similarity index 100% rename from packages/dts-test/defineCustomElement.test-d.ts rename to packages-private/dts-test/defineCustomElement.test-d.ts diff --git a/packages/dts-test/directives.test-d.ts b/packages-private/dts-test/directives.test-d.ts similarity index 100% rename from packages/dts-test/directives.test-d.ts rename to packages-private/dts-test/directives.test-d.ts diff --git a/packages/dts-test/extractProps.test-d.ts b/packages-private/dts-test/extractProps.test-d.ts similarity index 100% rename from packages/dts-test/extractProps.test-d.ts rename to packages-private/dts-test/extractProps.test-d.ts diff --git a/packages/dts-test/functionalComponent.test-d.tsx b/packages-private/dts-test/functionalComponent.test-d.tsx similarity index 100% rename from packages/dts-test/functionalComponent.test-d.tsx rename to packages-private/dts-test/functionalComponent.test-d.tsx diff --git a/packages/dts-test/h.test-d.ts b/packages-private/dts-test/h.test-d.ts similarity index 100% rename from packages/dts-test/h.test-d.ts rename to packages-private/dts-test/h.test-d.ts diff --git a/packages/dts-test/inject.test-d.ts b/packages-private/dts-test/inject.test-d.ts similarity index 100% rename from packages/dts-test/inject.test-d.ts rename to packages-private/dts-test/inject.test-d.ts diff --git a/packages/dts-test/package.json b/packages-private/dts-test/package.json similarity index 74% rename from packages/dts-test/package.json rename to packages-private/dts-test/package.json index a6ea96bfa..72b1b6ea6 100644 --- a/packages/dts-test/package.json +++ b/packages-private/dts-test/package.json @@ -4,6 +4,6 @@ "version": "0.0.0", "dependencies": { "vue": "workspace:*", - "@vue/dts-built-test": "workspace:*" + "dts-built-test": "workspace:*" } } diff --git a/packages/dts-test/reactivity.test-d.ts b/packages-private/dts-test/reactivity.test-d.ts similarity index 100% rename from packages/dts-test/reactivity.test-d.ts rename to packages-private/dts-test/reactivity.test-d.ts diff --git a/packages/dts-test/ref.test-d.ts b/packages-private/dts-test/ref.test-d.ts similarity index 100% rename from packages/dts-test/ref.test-d.ts rename to packages-private/dts-test/ref.test-d.ts diff --git a/packages/dts-test/setupHelpers.test-d.ts b/packages-private/dts-test/setupHelpers.test-d.ts similarity index 100% rename from packages/dts-test/setupHelpers.test-d.ts rename to packages-private/dts-test/setupHelpers.test-d.ts diff --git a/packages/dts-test/tsconfig.test.json b/packages-private/dts-test/tsconfig.test.json similarity index 100% rename from packages/dts-test/tsconfig.test.json rename to packages-private/dts-test/tsconfig.test.json diff --git a/packages/dts-test/tsx.test-d.tsx b/packages-private/dts-test/tsx.test-d.tsx similarity index 100% rename from packages/dts-test/tsx.test-d.tsx rename to packages-private/dts-test/tsx.test-d.tsx diff --git a/packages/dts-test/utils.d.ts b/packages-private/dts-test/utils.d.ts similarity index 100% rename from packages/dts-test/utils.d.ts rename to packages-private/dts-test/utils.d.ts diff --git a/packages/dts-test/watch.test-d.ts b/packages-private/dts-test/watch.test-d.ts similarity index 100% rename from packages/dts-test/watch.test-d.ts rename to packages-private/dts-test/watch.test-d.ts diff --git a/packages/sfc-playground/README.md b/packages-private/sfc-playground/README.md similarity index 100% rename from packages/sfc-playground/README.md rename to packages-private/sfc-playground/README.md diff --git a/packages/sfc-playground/index.html b/packages-private/sfc-playground/index.html similarity index 100% rename from packages/sfc-playground/index.html rename to packages-private/sfc-playground/index.html diff --git a/packages/sfc-playground/package.json b/packages-private/sfc-playground/package.json similarity index 90% rename from packages/sfc-playground/package.json rename to packages-private/sfc-playground/package.json index 9d38811c7..b43247e9c 100644 --- a/packages/sfc-playground/package.json +++ b/packages-private/sfc-playground/package.json @@ -9,7 +9,7 @@ "serve": "vite preview" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.1.2", + "@vitejs/plugin-vue": "catalog:", "vite": "catalog:" }, "dependencies": { diff --git a/packages/sfc-playground/public/logo.svg b/packages-private/sfc-playground/public/logo.svg similarity index 100% rename from packages/sfc-playground/public/logo.svg rename to packages-private/sfc-playground/public/logo.svg diff --git a/packages/sfc-playground/src/App.vue b/packages-private/sfc-playground/src/App.vue similarity index 100% rename from packages/sfc-playground/src/App.vue rename to packages-private/sfc-playground/src/App.vue diff --git a/packages/sfc-playground/src/Header.vue b/packages-private/sfc-playground/src/Header.vue similarity index 98% rename from packages/sfc-playground/src/Header.vue rename to packages-private/sfc-playground/src/Header.vue index 8e810d894..922a2b111 100644 --- a/packages/sfc-playground/src/Header.vue +++ b/packages-private/sfc-playground/src/Header.vue @@ -125,7 +125,7 @@ function toggleDark() { { - const filePath = path.resolve(__dirname, file) + const filePath = path.resolve(__dirname, '../../packages', file) const basename = path.basename(file) if (!fs.existsSync(filePath)) { throw new Error( @@ -49,11 +49,11 @@ function copyVuePlugin(): Plugin { }) } - copyFile(`../vue/dist/vue.esm-browser.js`) - copyFile(`../vue/dist/vue.esm-browser.prod.js`) - copyFile(`../vue/dist/vue.runtime.esm-browser.js`) - copyFile(`../vue/dist/vue.runtime.esm-browser.prod.js`) - copyFile(`../server-renderer/dist/server-renderer.esm-browser.js`) + copyFile(`vue/dist/vue.esm-browser.js`) + copyFile(`vue/dist/vue.esm-browser.prod.js`) + copyFile(`vue/dist/vue.runtime.esm-browser.js`) + copyFile(`vue/dist/vue.runtime.esm-browser.prod.js`) + copyFile(`server-renderer/dist/server-renderer.esm-browser.js`) }, } } diff --git a/packages/template-explorer/README.md b/packages-private/template-explorer/README.md similarity index 100% rename from packages/template-explorer/README.md rename to packages-private/template-explorer/README.md diff --git a/packages/template-explorer/_redirects b/packages-private/template-explorer/_redirects similarity index 100% rename from packages/template-explorer/_redirects rename to packages-private/template-explorer/_redirects diff --git a/packages/template-explorer/index.html b/packages-private/template-explorer/index.html similarity index 100% rename from packages/template-explorer/index.html rename to packages-private/template-explorer/index.html diff --git a/packages/template-explorer/local.html b/packages-private/template-explorer/local.html similarity index 100% rename from packages/template-explorer/local.html rename to packages-private/template-explorer/local.html diff --git a/packages/template-explorer/package.json b/packages-private/template-explorer/package.json similarity index 100% rename from packages/template-explorer/package.json rename to packages-private/template-explorer/package.json diff --git a/packages/template-explorer/src/index.ts b/packages-private/template-explorer/src/index.ts similarity index 100% rename from packages/template-explorer/src/index.ts rename to packages-private/template-explorer/src/index.ts diff --git a/packages/template-explorer/src/options.ts b/packages-private/template-explorer/src/options.ts similarity index 100% rename from packages/template-explorer/src/options.ts rename to packages-private/template-explorer/src/options.ts diff --git a/packages/template-explorer/src/theme.ts b/packages-private/template-explorer/src/theme.ts similarity index 100% rename from packages/template-explorer/src/theme.ts rename to packages-private/template-explorer/src/theme.ts diff --git a/packages/template-explorer/style.css b/packages-private/template-explorer/style.css similarity index 100% rename from packages/template-explorer/style.css rename to packages-private/template-explorer/style.css diff --git a/packages-private/vite-debug/App.vue b/packages-private/vite-debug/App.vue new file mode 100644 index 000000000..95b3be8ee --- /dev/null +++ b/packages-private/vite-debug/App.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/packages-private/vite-debug/README.md b/packages-private/vite-debug/README.md new file mode 100644 index 000000000..4f035ae6f --- /dev/null +++ b/packages-private/vite-debug/README.md @@ -0,0 +1 @@ +This package is used for debugging issues that are related to `@vitejs/plugin-vue`, or can only be reproduced in a Vite-based setup. It aims to be as close to production as possible so Vue packages are resolved to the dist files instead of source. diff --git a/packages-private/vite-debug/index.html b/packages-private/vite-debug/index.html new file mode 100644 index 000000000..79052a023 --- /dev/null +++ b/packages-private/vite-debug/index.html @@ -0,0 +1,2 @@ + +
diff --git a/packages-private/vite-debug/main.ts b/packages-private/vite-debug/main.ts new file mode 100644 index 000000000..52668a0a5 --- /dev/null +++ b/packages-private/vite-debug/main.ts @@ -0,0 +1,6 @@ +import { createApp } from 'vue' +import App from './App.vue' + +const app = createApp(App) + +app.mount('#app') diff --git a/packages-private/vite-debug/package.json b/packages-private/vite-debug/package.json new file mode 100644 index 000000000..b0f2bad2b --- /dev/null +++ b/packages-private/vite-debug/package.json @@ -0,0 +1,15 @@ +{ + "name": "vite-debug", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "serve": "vite preview" + }, + "devDependencies": { + "@vitejs/plugin-vue": "catalog:", + "vite": "catalog:", + "vue": "workspace:*" + } +} diff --git a/packages-private/vite-debug/tsconfig.json b/packages-private/vite-debug/tsconfig.json new file mode 100644 index 000000000..ceecb1cde --- /dev/null +++ b/packages-private/vite-debug/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "bundler" + }, + "include": ["./*"] +} diff --git a/packages-private/vite-debug/vite.config.ts b/packages-private/vite-debug/vite.config.ts new file mode 100644 index 000000000..c40aa3c36 --- /dev/null +++ b/packages-private/vite-debug/vite.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig({ + plugins: [vue()], +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75497dd7f..496c3fb87 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,9 @@ catalogs: '@babel/types': specifier: ^7.25.2 version: 7.25.2 + '@vitejs/plugin-vue': + specifier: ^5.1.2 + version: 5.1.2 estree-walker: specifier: ^2.0.2 version: 2.0.2 @@ -180,6 +183,70 @@ importers: specifier: ^2.0.0 version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + packages-private/dts-built-test: + dependencies: + '@vue/reactivity': + specifier: workspace:* + version: link:../../packages/reactivity + '@vue/shared': + specifier: workspace:* + version: link:../../packages/shared + vue: + specifier: workspace:* + version: link:../../packages/vue + + packages-private/dts-test: + dependencies: + dts-built-test: + specifier: workspace:* + version: link:../dts-built-test + vue: + specifier: workspace:* + version: link:../../packages/vue + + packages-private/sfc-playground: + dependencies: + '@vue/repl': + specifier: ^4.3.1 + version: 4.3.1 + file-saver: + specifier: ^2.0.5 + version: 2.0.5 + jszip: + specifier: ^3.10.1 + version: 3.10.1 + vue: + specifier: workspace:* + version: link:../../packages/vue + devDependencies: + '@vitejs/plugin-vue': + specifier: 'catalog:' + version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue) + vite: + specifier: 'catalog:' + version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + + packages-private/template-explorer: + dependencies: + monaco-editor: + specifier: ^0.50.0 + version: 0.50.0 + source-map-js: + specifier: ^1.2.0 + version: 1.2.0 + + packages-private/vite-debug: + devDependencies: + '@vitejs/plugin-vue': + specifier: 'catalog:' + version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue) + vite: + specifier: 'catalog:' + version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + vue: + specifier: workspace:* + version: link:../../packages/vue + packages/compiler-core: dependencies: '@babel/parser': @@ -281,27 +348,6 @@ importers: specifier: workspace:* version: link:../shared - packages/dts-built-test: - dependencies: - '@vue/reactivity': - specifier: workspace:* - version: link:../reactivity - '@vue/shared': - specifier: workspace:* - version: link:../shared - vue: - specifier: workspace:* - version: link:../vue - - packages/dts-test: - dependencies: - '@vue/dts-built-test': - specifier: workspace:* - version: link:../dts-built-test - vue: - specifier: workspace:* - version: link:../vue - packages/reactivity: dependencies: '@vue/shared': @@ -357,39 +403,8 @@ importers: specifier: workspace:* version: link:../vue - packages/sfc-playground: - dependencies: - '@vue/repl': - specifier: ^4.3.1 - version: 4.3.1 - file-saver: - specifier: ^2.0.5 - version: 2.0.5 - jszip: - specifier: ^3.10.1 - version: 3.10.1 - vue: - specifier: workspace:* - version: link:../vue - devDependencies: - '@vitejs/plugin-vue': - specifier: ^5.1.2 - version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue) - vite: - specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) - packages/shared: {} - packages/template-explorer: - dependencies: - monaco-editor: - specifier: ^0.50.0 - version: 0.50.0 - source-map-js: - specifier: ^1.2.0 - version: 1.2.0 - packages/vue: dependencies: '@vue/compiler-dom': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index facb791e6..23270954b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,6 @@ packages: - 'packages/*' + - 'packages-private/*' catalog: '@babel/parser': ^7.25.3 @@ -8,3 +9,4 @@ catalog: 'magic-string': ^0.30.11 'source-map-js': ^1.2.0 'vite': ^5.4.0 + '@vitejs/plugin-vue': ^5.1.2 diff --git a/rollup.config.js b/rollup.config.js index 8e97d74c5..79883d1dd 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,7 @@ import assert from 'node:assert/strict' import { createRequire } from 'node:module' import { fileURLToPath } from 'node:url' +import fs from 'node:fs' import path from 'node:path' import replace from '@rollup/plugin-replace' import json from '@rollup/plugin-json' @@ -33,7 +34,11 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url)) const masterVersion = require('./package.json').version const consolidatePkg = require('@vue/consolidate/package.json') -const packagesDir = path.resolve(__dirname, 'packages') +const privatePackages = fs.readdirSync('packages-private') +const pkgBase = privatePackages.includes(process.env.TARGET) + ? `packages-private` + : `packages` +const packagesDir = path.resolve(__dirname, pkgBase) const packageDir = path.resolve(packagesDir, process.env.TARGET) const resolve = (/** @type {string} */ p) => path.resolve(packageDir, p) diff --git a/scripts/build.js b/scripts/build.js index ec111a038..4a0aef645 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -16,7 +16,7 @@ nr build core --formats cjs ``` */ -import fs from 'node:fs/promises' +import fs from 'node:fs' import { parseArgs } from 'node:util' import { existsSync, readFileSync } from 'node:fs' import path from 'node:path' @@ -84,7 +84,7 @@ const sizeDir = path.resolve('temp/size') run() async function run() { - if (writeSize) await fs.mkdir(sizeDir, { recursive: true }) + if (writeSize) fs.mkdirSync(sizeDir, { recursive: true }) const removeCache = scanEnums() try { const resolvedTargets = targets.length @@ -151,13 +151,18 @@ async function runParallel(maxConcurrency, source, iteratorFn) { return Promise.all(ret) } +const privatePackages = fs.readdirSync('packages-private') + /** * Builds the target. * @param {string} target - The target to build. * @returns {Promise} - A promise representing the build process. */ async function build(target) { - const pkgDir = path.resolve(`packages/${target}`) + const pkgBase = privatePackages.includes(target) + ? `packages-private` + : `packages` + const pkgDir = path.resolve(`${pkgBase}/${target}`) const pkg = JSON.parse(readFileSync(`${pkgDir}/package.json`, 'utf-8')) // if this is a full build (no specific targets), ignore private packages @@ -167,7 +172,7 @@ async function build(target) { // if building a specific format, do not remove dist. if (!formats && existsSync(`${pkgDir}/dist`)) { - await fs.rm(`${pkgDir}/dist`, { recursive: true }) + fs.rmSync(`${pkgDir}/dist`, { recursive: true }) } const env = @@ -232,7 +237,7 @@ async function checkFileSize(filePath) { if (!existsSync(filePath)) { return } - const file = await fs.readFile(filePath) + const file = fs.readFileSync(filePath) const fileName = path.basename(filePath) const gzipped = gzipSync(file) @@ -247,7 +252,7 @@ async function checkFileSize(filePath) { ) if (writeSize) - await fs.writeFile( + fs.writeFileSync( path.resolve(sizeDir, `${fileName}.json`), JSON.stringify({ file: fileName, diff --git a/scripts/utils.js b/scripts/utils.js index 056d95b7b..3c92bf7ba 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -6,19 +6,22 @@ import { spawn } from 'node:child_process' const require = createRequire(import.meta.url) -export const targets = fs.readdirSync('packages').filter(f => { - if ( - !fs.statSync(`packages/${f}`).isDirectory() || - !fs.existsSync(`packages/${f}/package.json`) - ) { - return false - } - const pkg = require(`../packages/${f}/package.json`) - if (pkg.private && !pkg.buildOptions) { - return false - } - return true -}) +export const targets = fs + .readdirSync('packages') + .filter(f => { + if ( + !fs.statSync(`packages/${f}`).isDirectory() || + !fs.existsSync(`packages/${f}/package.json`) + ) { + return false + } + const pkg = require(`../packages/${f}/package.json`) + if (pkg.private && !pkg.buildOptions) { + return false + } + return true + }) + .concat('template-explorer') /** * diff --git a/tsconfig.json b/tsconfig.json index 8ff1b2a31..a12850af0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,12 +32,13 @@ "include": [ "packages/global.d.ts", "packages/*/src", + "packages-private/*/src", "packages/runtime-dom/types/jsx.d.ts", "packages/*/__tests__", - "packages/dts-test", + "packages-private/dts-test", "packages/vue/jsx-runtime", "scripts/*", "rollup.*.js" ], - "exclude": ["packages/sfc-playground/src/vue-dev-proxy*"] + "exclude": ["packages-private/sfc-playground/src/vue-dev-proxy*"] } diff --git a/vitest.config.ts b/vitest.config.ts index 0b6c014f4..f661a003d 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -40,7 +40,7 @@ export default defineConfig({ 'packages/runtime-dom/src/components/Transition*', // mostly entries 'packages/vue-compat/**', - 'packages/sfc-playground/**', + 'packages-private/**', 'scripts/**', ], }, From 85ee76f29da3853ef6617484eaf3789f7bcf2227 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 08:07:41 +0800 Subject: [PATCH 011/210] chore: bump transition tests buffer in ci --- packages/vue/__tests__/e2e/Transition.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue/__tests__/e2e/Transition.spec.ts b/packages/vue/__tests__/e2e/Transition.spec.ts index 3a231e4cf..b9e911728 100644 --- a/packages/vue/__tests__/e2e/Transition.spec.ts +++ b/packages/vue/__tests__/e2e/Transition.spec.ts @@ -8,7 +8,7 @@ describe('e2e: Transition', () => { const baseUrl = `file://${path.resolve(__dirname, './transition.html')}` const duration = process.env.CI ? 200 : 50 - const buffer = 20 + const buffer = process.env.CI ? 50 : 20 const transitionFinish = (time = duration) => timeout(time + buffer) From 2dc1c31feb3e27dee79013bb373f1d095875f10b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 08:08:18 +0800 Subject: [PATCH 012/210] workflow: upload-built-packages --- .github/workflows/publish-commit.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-commit.yml b/.github/workflows/publish-commit.yml index 3b9212309..61bdf7017 100644 --- a/.github/workflows/publish-commit.yml +++ b/.github/workflows/publish-commit.yml @@ -1,9 +1,10 @@ -name: publish-commit +# upload built packages as artifacts for faster ecosystem-ci +name: upload-built-packages on: workflow_run: workflows: ['ci'] - branches: [main, minor, test-publish] + branches: [main, minor] types: - completed @@ -25,15 +26,17 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: '.node-version' - registry-url: 'https://npm.pkg.github.com' + registry-url: 'https://registry.npmjs.org' cache: 'pnpm' - name: Install deps run: pnpm install - - name: Build and publish - id: publish - run: | - pnpm release 0.0.0-${{ github.event.workflow_run.head_commit.id }} --tag ${{ github.event.workflow_run.head_branch }} --registry https://npm.pkg.github.com --publishOnly - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build + run: pnpm build --withTypes + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: packages + path: packages/**/dist/* From da2bf967f6ebfccd95beb6b1cb398baf32cb8009 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 08:24:55 +0800 Subject: [PATCH 013/210] chore: rename workflow --- .github/workflows/{publish-commit.yml => upload-packages.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish-commit.yml => upload-packages.yml} (100%) diff --git a/.github/workflows/publish-commit.yml b/.github/workflows/upload-packages.yml similarity index 100% rename from .github/workflows/publish-commit.yml rename to .github/workflows/upload-packages.yml From 67cdb5f335f557980f46bab421492a169fa749df Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 08:29:03 +0800 Subject: [PATCH 014/210] workflow: adjust upload depth --- .github/workflows/upload-packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-packages.yml b/.github/workflows/upload-packages.yml index 61bdf7017..6c2bfa8c5 100644 --- a/.github/workflows/upload-packages.yml +++ b/.github/workflows/upload-packages.yml @@ -9,7 +9,7 @@ on: - completed jobs: - pubilsh: + build-and-upload: if: > github.repository == 'vuejs/core' && github.event.workflow_run.event == 'push' && @@ -39,4 +39,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: packages - path: packages/**/dist/* + path: packages/*/dist/* From 765abf8c4ad48fba5a9395264ba386bccb4824c3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 09:27:08 +0800 Subject: [PATCH 015/210] workflow: fix size report --- .github/workflows/size-report.yml | 12 ++++++++---- scripts/size-report.ts | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml index fb47e968b..32e96dc64 100644 --- a/.github/workflows/size-report.yml +++ b/.github/workflows/size-report.yml @@ -44,16 +44,20 @@ jobs: - name: Read PR Number id: pr-number - run: echo "number=(cat ./temp/size/number.txt)" >> $GITHUB_OUTPUT + uses: juliangruber/read-file-action@v1 + with: + path: temp/size/number.txt - name: Read base branch id: pr-base - run: echo "base=(cat ./temp/size/base.txt)" >> $GITHUB_OUTPUT + uses: juliangruber/read-file-action@v1 + with: + path: temp/size/base.txt - name: Download Previous Size Data uses: dawidd6/action-download-artifact@v6 with: - branch: ${{ steps.pr-base.outputs.base }} + branch: ${{ steps.pr-base.outputs.content }} workflow: size-data.yml event: push name: size-data @@ -73,7 +77,7 @@ jobs: uses: actions-cool/maintain-one-comment@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - number: ${{ steps.pr-number.outputs.number }} + number: ${{ steps.pr-number.outputs.content }} body: | ${{ steps.size-report.outputs.content }} diff --git a/scripts/size-report.ts b/scripts/size-report.ts index 30475ac3c..363fa9279 100644 --- a/scripts/size-report.ts +++ b/scripts/size-report.ts @@ -31,7 +31,8 @@ async function run() { } async function renderFiles() { - const filterFiles = (files: string[]) => files.filter(file => file[0] !== '_') + const filterFiles = (files: string[]) => + files.filter(file => file[0] !== '_' && !file.endsWith('.txt')) const curr = filterFiles(await readdir(currDir)) const prev = existsSync(prevDir) ? filterFiles(await readdir(prevDir)) : [] From 43ccad4ea16192f08757d45d3f13db550065634f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:30:12 +0800 Subject: [PATCH 016/210] chore(deps): update all non-major dependencies (#11582) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 6 ++--- pnpm-lock.yaml | 60 +++++++++++++++++++++++++------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index d9ab4b983..283643888 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "version": "3.5.0-beta.1", - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@9.7.0", "type": "module", "scripts": { "dev": "node scripts/dev.js", @@ -68,7 +68,7 @@ "@rollup/plugin-replace": "5.0.4", "@swc/core": "^1.7.6", "@types/hash-sum": "^1.0.2", - "@types/node": "^20.14.14", + "@types/node": "^20.14.15", "@types/semver": "^7.5.8", "@types/serve-handler": "^6.1.4", "@vitest/coverage-istanbul": "^2.0.0", @@ -104,7 +104,7 @@ "simple-git-hooks": "^2.11.1", "todomvc-app-css": "^2.4.3", "tslib": "^2.6.3", - "tsx": "^4.16.5", + "tsx": "^4.17.0", "typescript": "~5.5.4", "typescript-eslint": "^8.0.0", "vite": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 496c3fb87..e14477f54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ^1.0.2 version: 1.0.2 '@types/node': - specifier: ^20.14.14 - version: 20.14.14 + specifier: ^20.14.15 + version: 20.14.15 '@types/semver': specifier: ^7.5.8 version: 7.5.8 @@ -70,7 +70,7 @@ importers: version: 6.1.4 '@vitest/coverage-istanbul': specifier: ^2.0.0 - version: 2.0.5(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) + version: 2.0.5(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -94,7 +94,7 @@ importers: version: 3.1.0(eslint@9.8.0)(typescript@5.5.4) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)) + version: 0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -168,7 +168,7 @@ importers: specifier: ^2.6.3 version: 2.6.3 tsx: - specifier: ^4.16.5 + specifier: ^4.17.0 version: 4.17.0 typescript: specifier: ~5.5.4 @@ -178,10 +178,10 @@ importers: version: 8.0.1(eslint@9.8.0)(typescript@5.5.4) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) vitest: specifier: ^2.0.0 - version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + version: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) packages-private/dts-built-test: dependencies: @@ -221,10 +221,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) packages-private/template-explorer: dependencies: @@ -239,10 +239,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) vue: specifier: workspace:* version: link:../../packages/vue @@ -1127,8 +1127,8 @@ packages: '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} - '@types/node@20.14.14': - resolution: {integrity: sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==} + '@types/node@20.14.15': + resolution: {integrity: sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -4000,7 +4000,7 @@ snapshots: '@types/hash-sum@1.0.2': {} - '@types/node@20.14.14': + '@types/node@20.14.15': dependencies: undici-types: 5.26.5 @@ -4012,13 +4012,13 @@ snapshots: '@types/serve-handler@6.1.4': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 '@types/trusted-types@2.0.7': {} '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 optional: true '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4)': @@ -4140,12 +4140,12 @@ snapshots: '@typescript-eslint/types': 8.0.1 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.14.14)(sass@1.77.8))(vue@packages+vue)': + '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue)': dependencies: - vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) vue: link:packages/vue - '@vitest/coverage-istanbul@2.0.5(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8))': + '@vitest/coverage-istanbul@2.0.5(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8))': dependencies: '@istanbuljs/schema': 0.1.3 debug: 4.3.6 @@ -4157,7 +4157,7 @@ snapshots: magicast: 0.3.4 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color @@ -4811,12 +4811,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8)): + eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.4) eslint: 9.8.0 optionalDependencies: - vitest: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color - typescript @@ -6358,13 +6358,13 @@ snapshots: vary@1.1.2: {} - vite-node@2.0.5(@types/node@20.14.14)(sass@1.77.8): + vite-node@2.0.5(@types/node@20.14.15)(sass@1.77.8): dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) + vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) transitivePeerDependencies: - '@types/node' - less @@ -6376,17 +6376,17 @@ snapshots: - supports-color - terser - vite@5.4.0(@types/node@20.14.14)(sass@1.77.8): + vite@5.4.0(@types/node@20.14.15)(sass@1.77.8): dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.20.0 optionalDependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 fsevents: 2.3.3 sass: 1.77.8 - vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1)(sass@1.77.8): + vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -6404,11 +6404,11 @@ snapshots: tinybench: 2.9.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.14.14)(sass@1.77.8) - vite-node: 2.0.5(@types/node@20.14.14)(sass@1.77.8) + vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + vite-node: 2.0.5(@types/node@20.14.15)(sass@1.77.8) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 jsdom: 24.1.1 transitivePeerDependencies: - less From a26d48177f45ac7a183cd053fd5b49d7ea0e930b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:31:13 +0800 Subject: [PATCH 017/210] chore(deps): update build (#11583) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- .../src/download/template/package.json | 2 +- pnpm-lock.yaml | 90 +++++++++---------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 283643888..53adff018 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "5.0.4", - "@swc/core": "^1.7.6", + "@swc/core": "^1.7.10", "@types/hash-sum": "^1.0.2", "@types/node": "^20.14.15", "@types/semver": "^7.5.8", diff --git a/packages-private/sfc-playground/src/download/template/package.json b/packages-private/sfc-playground/src/download/template/package.json index 28a5aee22..50f0a6d2f 100644 --- a/packages-private/sfc-playground/src/download/template/package.json +++ b/packages-private/sfc-playground/src/download/template/package.json @@ -12,6 +12,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^5.1.2", - "vite": "^5.3.5" + "vite": "^5.4.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e14477f54..3a27e728b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: 5.0.4 version: 5.0.4(rollup@4.20.0) '@swc/core': - specifier: ^1.7.6 - version: 1.7.6 + specifier: ^1.7.10 + version: 1.7.10 '@types/hash-sum': specifier: ^1.0.2 version: 1.0.2 @@ -1043,68 +1043,68 @@ packages: cpu: [x64] os: [win32] - '@swc/core-darwin-arm64@1.7.6': - resolution: {integrity: sha512-6lYHey84ZzsdtC7UuPheM4Rm0Inzxm6Sb8U6dmKc4eCx8JL0LfWG4LC5RsdsrTxnjTsbriWlnhZBffh8ijUHIQ==} + '@swc/core-darwin-arm64@1.7.10': + resolution: {integrity: sha512-TYp4x/9w/C/yMU1olK5hTKq/Hi7BjG71UJ4V1U1WxI1JA3uokjQ/GoktDfmH5V5pX4dgGSOJwUe2RjoN8Z/XnA==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.7.6': - resolution: {integrity: sha512-Fyl+8aH9O5rpx4O7r2KnsPpoi32iWoKOYKiipeTbGjQ/E95tNPxbmsz4yqE8Ovldcga60IPJ5OKQA3HWRiuzdw==} + '@swc/core-darwin-x64@1.7.10': + resolution: {integrity: sha512-P3LJjAWh5yLc6p5IUwV5LgRfA3R1oDCZDMabYyb2BVQuJTD4MfegW9DhBcUUF5dhBLwq3191KpLVzE+dLTbiXw==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.7.6': - resolution: {integrity: sha512-2WxYTqFaOx48GKC2cbO1/IntA+w+kfCFy436Ij7qRqqtV/WAvTM9TC1OmiFbqq436rSot52qYmX8fkwdB5UcLQ==} + '@swc/core-linux-arm-gnueabihf@1.7.10': + resolution: {integrity: sha512-yGOFjE7w/akRTmqGY3FvWYrqbxO7OB2N2FHj2LO5HtzXflfoABb5RyRvdEquX+17J6mEpu4EwjYNraTD/WHIEQ==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.7.6': - resolution: {integrity: sha512-TBEGMSe0LhvPe4S7E68c7VzgT3OMu4VTmBLS7B2aHv4v8uZO92Khpp7L0WqgYU1y5eMjk+XLDLi4kokiNHv/Hg==} + '@swc/core-linux-arm64-gnu@1.7.10': + resolution: {integrity: sha512-SPWsgWHfdWKKjLrYlvhxcdBJ7Ruy6crJbPoE9NfD95eJEjMnS2yZTqj2ChFsY737WeyhWYlHzgYhYOVCp83YwQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.7.6': - resolution: {integrity: sha512-QI8QGL0HGT42tj7F1A+YAzhGkJjUcvvTfI1e2m704W0Enl2/UIK9v5D1zvQzYwusRyKuaQfbeBRYDh0NcLOGLg==} + '@swc/core-linux-arm64-musl@1.7.10': + resolution: {integrity: sha512-PUi50bkNqnBL3Z/Zq6jSfwgN9A/taA6u2Zou0tjDJi7oVdpjdr7SxNgCGzMJ/nNg5D/IQn1opM1jktMvpsPAuQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.7.6': - resolution: {integrity: sha512-61AYVzhjuNQAVIKKWOJu3H0/pFD28RYJGxnGg3YMhvRLRyuWNyY5Nyyj2WkKcz/ON+g38Arlz00NT1LDIViRLg==} + '@swc/core-linux-x64-gnu@1.7.10': + resolution: {integrity: sha512-Sc+pY55gknCAmBQBR6DhlA7jZSxHaLSDb5Sevzi6DOFMXR79NpA6zWTNKwp1GK2AnRIkbAfvYLgOxS5uWTFVpg==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.7.6': - resolution: {integrity: sha512-hQFznpfLK8XajfAAN9Cjs0w/aVmO7iu9VZvInyrTCRcPqxV5O+rvrhRxKvC1LRMZXr5M6JRSRtepp5w+TK4kAw==} + '@swc/core-linux-x64-musl@1.7.10': + resolution: {integrity: sha512-g5NKx2LXaGd0K26hmEts1Cvb7ptIvq3MHSgr6/D1tRPcDZw1Sp0dYsmyOv0ho4F5GOJyiCooG3oE9FXdb7jIpQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.7.6': - resolution: {integrity: sha512-Aqsd9afykVMuekzjm4X4TDqwxmG4CrzoOSFe0hZrn9SMio72l5eAPnMtYoe5LsIqtjV8MNprLfXaNbjHjTegmA==} + '@swc/core-win32-arm64-msvc@1.7.10': + resolution: {integrity: sha512-plRIsOcfy9t9Q/ivm5DA7I0HaIvfAWPbI+bvVRrr3C/1K2CSqnqZJjEWOAmx2LiyipijNnEaFYuLBp0IkGuJpg==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.7.6': - resolution: {integrity: sha512-9h0hYnOeRVNeQgHQTvD1Im67faNSSzBZ7Adtxyu9urNLfBTJilMllFd2QuGHlKW5+uaT6ZH7ZWDb+c/enx7Lcg==} + '@swc/core-win32-ia32-msvc@1.7.10': + resolution: {integrity: sha512-GntrVNT23viHtbfzmlK8lfBiKeajH24GzbDT7qXhnoO20suUPcyYZxyvCb4gWM2zu8ZBTPHNlqfrNsriQCZ+lQ==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.7.6': - resolution: {integrity: sha512-izeoB8glCSe6IIDQmrVm6bvR9muk9TeKgmtY7b6l1BwL4BFnTUk4dMmpbntT90bEVQn3JPCaPtUG4HfL8VuyuA==} + '@swc/core-win32-x64-msvc@1.7.10': + resolution: {integrity: sha512-uXIF8GuSappe1imm6Lf7pHGepfCBjDQlS+qTqvEGE0wZAsL1IVATK9P/cH/OCLfJXeQDTLeSYmrpwjtXNt46tQ==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.7.6': - resolution: {integrity: sha512-FZxyao9eQks1MRmUshgsZTmlg/HB2oXK5fghkoWJm/1CU2q2kaJlVDll2as5j+rmWiwkp0Gidlq8wlXcEEAO+g==} + '@swc/core@1.7.10': + resolution: {integrity: sha512-l0xrFwBQ9atizhmV94yC2nwcecTk/oftofwMNPiFMGe56dqdmi2ArHaTV3PCtMlgaUH6rGCehoRMt5OrCI1ktg==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -3942,51 +3942,51 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.20.0': optional: true - '@swc/core-darwin-arm64@1.7.6': + '@swc/core-darwin-arm64@1.7.10': optional: true - '@swc/core-darwin-x64@1.7.6': + '@swc/core-darwin-x64@1.7.10': optional: true - '@swc/core-linux-arm-gnueabihf@1.7.6': + '@swc/core-linux-arm-gnueabihf@1.7.10': optional: true - '@swc/core-linux-arm64-gnu@1.7.6': + '@swc/core-linux-arm64-gnu@1.7.10': optional: true - '@swc/core-linux-arm64-musl@1.7.6': + '@swc/core-linux-arm64-musl@1.7.10': optional: true - '@swc/core-linux-x64-gnu@1.7.6': + '@swc/core-linux-x64-gnu@1.7.10': optional: true - '@swc/core-linux-x64-musl@1.7.6': + '@swc/core-linux-x64-musl@1.7.10': optional: true - '@swc/core-win32-arm64-msvc@1.7.6': + '@swc/core-win32-arm64-msvc@1.7.10': optional: true - '@swc/core-win32-ia32-msvc@1.7.6': + '@swc/core-win32-ia32-msvc@1.7.10': optional: true - '@swc/core-win32-x64-msvc@1.7.6': + '@swc/core-win32-x64-msvc@1.7.10': optional: true - '@swc/core@1.7.6': + '@swc/core@1.7.10': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.12 optionalDependencies: - '@swc/core-darwin-arm64': 1.7.6 - '@swc/core-darwin-x64': 1.7.6 - '@swc/core-linux-arm-gnueabihf': 1.7.6 - '@swc/core-linux-arm64-gnu': 1.7.6 - '@swc/core-linux-arm64-musl': 1.7.6 - '@swc/core-linux-x64-gnu': 1.7.6 - '@swc/core-linux-x64-musl': 1.7.6 - '@swc/core-win32-arm64-msvc': 1.7.6 - '@swc/core-win32-ia32-msvc': 1.7.6 - '@swc/core-win32-x64-msvc': 1.7.6 + '@swc/core-darwin-arm64': 1.7.10 + '@swc/core-darwin-x64': 1.7.10 + '@swc/core-linux-arm-gnueabihf': 1.7.10 + '@swc/core-linux-arm64-gnu': 1.7.10 + '@swc/core-linux-arm64-musl': 1.7.10 + '@swc/core-linux-x64-gnu': 1.7.10 + '@swc/core-linux-x64-musl': 1.7.10 + '@swc/core-win32-arm64-msvc': 1.7.10 + '@swc/core-win32-ia32-msvc': 1.7.10 + '@swc/core-win32-x64-msvc': 1.7.10 '@swc/counter@0.1.3': {} From 4c4e12ae28d67d616924b0601e68adc551959971 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:31:46 +0800 Subject: [PATCH 018/210] fix(deps): update dependency postcss to ^8.4.41 (#11585) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/compiler-sfc/package.json | 2 +- pnpm-lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index e58d475b2..fecea4681 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -49,7 +49,7 @@ "@vue/shared": "workspace:*", "estree-walker": "catalog:", "magic-string": "catalog:", - "postcss": "^8.4.40", + "postcss": "^8.4.41", "source-map-js": "catalog:" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a27e728b..70fff0fec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -302,7 +302,7 @@ importers: specifier: 'catalog:' version: 0.30.11 postcss: - specifier: ^8.4.40 + specifier: ^8.4.41 version: 8.4.41 source-map-js: specifier: 'catalog:' From 31deff4c32fc98d9330ec9e2fb035547582163c8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:34:23 +0800 Subject: [PATCH 019/210] chore(deps): update dependency puppeteer to v23 (#11588) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 53adff018..fb1b3a789 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "prettier": "^3.3.3", "pretty-bytes": "^6.1.1", "pug": "^3.0.3", - "puppeteer": "~22.15.0", + "puppeteer": "~23.0.2", "rimraf": "^6.0.1", "rollup": "^4.20.0", "rollup-plugin-dts": "^6.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 70fff0fec..71232d72b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -132,8 +132,8 @@ importers: specifier: ^3.0.3 version: 3.0.3 puppeteer: - specifier: ~22.15.0 - version: 22.15.0(typescript@5.5.4) + specifier: ~23.0.2 + version: 23.0.2(typescript@5.5.4) rimraf: specifier: ^6.0.1 version: 6.0.1 @@ -1495,8 +1495,8 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chromium-bidi@0.6.3: - resolution: {integrity: sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==} + chromium-bidi@0.6.4: + resolution: {integrity: sha512-8zoq6ogmhQQkAKZVKO2ObFTl4uOkqoX1PlKQX3hZQ5E9cbUotcAb7h4pTNVAGGv8Z36PF3CtdOriEp/Rz82JqQ==} peerDependencies: devtools-protocol: '*' @@ -2828,12 +2828,12 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - puppeteer-core@22.15.0: - resolution: {integrity: sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==} + puppeteer-core@23.0.2: + resolution: {integrity: sha512-MvOHn+g1TYkAR2oVd/bf/YWXKqFTJmkhyyurYgxkrjh8rBOL1ZH5VyOsLJi0bLO7/yoipAmk1gFZEx9HUJnaoA==} engines: {node: '>=18'} - puppeteer@22.15.0: - resolution: {integrity: sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==} + puppeteer@23.0.2: + resolution: {integrity: sha512-I/l1P8s8brcLG+oW9AwF8hUaOSGGJcGKMflXRgULUH0S3ABptlLI9ZKjqWDo8ipY6v789ZKd+bNKtcCwpTh5Ww==} engines: {node: '>=18'} hasBin: true @@ -4426,7 +4426,7 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chromium-bidi@0.6.3(devtools-protocol@0.0.1312386): + chromium-bidi@0.6.4(devtools-protocol@0.0.1312386): dependencies: devtools-protocol: 0.0.1312386 mitt: 3.0.1 @@ -5858,10 +5858,10 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@22.15.0: + puppeteer-core@23.0.2: dependencies: '@puppeteer/browsers': 2.3.0 - chromium-bidi: 0.6.3(devtools-protocol@0.0.1312386) + chromium-bidi: 0.6.4(devtools-protocol@0.0.1312386) debug: 4.3.6 devtools-protocol: 0.0.1312386 ws: 8.18.0 @@ -5870,12 +5870,13 @@ snapshots: - supports-color - utf-8-validate - puppeteer@22.15.0(typescript@5.5.4): + puppeteer@23.0.2(typescript@5.5.4): dependencies: '@puppeteer/browsers': 2.3.0 + chromium-bidi: 0.6.4(devtools-protocol@0.0.1312386) cosmiconfig: 9.0.0(typescript@5.5.4) devtools-protocol: 0.0.1312386 - puppeteer-core: 22.15.0 + puppeteer-core: 23.0.2 transitivePeerDependencies: - bufferutil - supports-color From cffa12859d20f225385f921d77378a45b7577fa6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:34:36 +0800 Subject: [PATCH 020/210] chore(deps): update test to ^2.0.5 (#11584) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- pnpm-lock.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fb1b3a789..c03ac0fb7 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@types/node": "^20.14.15", "@types/semver": "^7.5.8", "@types/serve-handler": "^6.1.4", - "@vitest/coverage-istanbul": "^2.0.0", + "@vitest/coverage-istanbul": "^2.0.5", "@vue/consolidate": "1.0.0", "conventional-changelog-cli": "^5.0.0", "enquirer": "^2.4.1", @@ -108,7 +108,7 @@ "typescript": "~5.5.4", "typescript-eslint": "^8.0.0", "vite": "catalog:", - "vitest": "^2.0.0" + "vitest": "^2.0.5" }, "pnpm": { "peerDependencyRules": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71232d72b..aa63c8f48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,7 +69,7 @@ importers: specifier: ^6.1.4 version: 6.1.4 '@vitest/coverage-istanbul': - specifier: ^2.0.0 + specifier: ^2.0.5 version: 2.0.5(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) '@vue/consolidate': specifier: 1.0.0 @@ -180,7 +180,7 @@ importers: specifier: 'catalog:' version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) vitest: - specifier: ^2.0.0 + specifier: ^2.0.5 version: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) packages-private/dts-built-test: From 3f23eff2b50d2ec8829241858aabb8e148b76416 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:34:50 +0800 Subject: [PATCH 021/210] chore(deps): update lint (#11586) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- pnpm-lock.yaml | 87 ++++++++++++++++++++++++++------------------------ 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index c03ac0fb7..eaf118113 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "enquirer": "^2.4.1", "esbuild": "^0.23.0", "esbuild-plugin-polyfill-node": "^0.3.0", - "eslint": "^9.8.0", + "eslint": "^9.9.0", "eslint-plugin-import-x": "^3.1.0", "eslint-plugin-vitest": "^0.5.4", "estree-walker": "catalog:", @@ -106,7 +106,7 @@ "tslib": "^2.6.3", "tsx": "^4.17.0", "typescript": "~5.5.4", - "typescript-eslint": "^8.0.0", + "typescript-eslint": "^8.0.1", "vite": "catalog:", "vitest": "^2.0.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa63c8f48..9926afe02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,14 +87,14 @@ importers: specifier: ^0.3.0 version: 0.3.0(esbuild@0.23.0) eslint: - specifier: ^9.8.0 - version: 9.8.0 + specifier: ^9.9.0 + version: 9.9.0 eslint-plugin-import-x: specifier: ^3.1.0 - version: 3.1.0(eslint@9.8.0)(typescript@5.5.4) + version: 3.1.0(eslint@9.9.0)(typescript@5.5.4) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) + version: 0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -174,8 +174,8 @@ importers: specifier: ~5.5.4 version: 5.5.4 typescript-eslint: - specifier: ^8.0.0 - version: 8.0.1(eslint@9.8.0)(typescript@5.5.4) + specifier: ^8.0.1 + version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) vite: specifier: 'catalog:' version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) @@ -830,8 +830,8 @@ packages: resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.8.0': - resolution: {integrity: sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==} + '@eslint/js@9.9.0': + resolution: {integrity: sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': @@ -1865,10 +1865,15 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.8.0: - resolution: {integrity: sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A==} + eslint@9.9.0: + resolution: {integrity: sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true espree@10.1.0: resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} @@ -3740,9 +3745,9 @@ snapshots: '@esbuild/win32-x64@0.23.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0)': dependencies: - eslint: 9.8.0 + eslint: 9.9.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} @@ -3769,7 +3774,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.8.0': {} + '@eslint/js@9.9.0': {} '@eslint/object-schema@2.1.4': {} @@ -4021,15 +4026,15 @@ snapshots: '@types/node': 20.14.15 optional: true - '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/type-utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.1 - eslint: 9.8.0 + eslint: 9.9.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -4039,14 +4044,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 8.0.1 '@typescript-eslint/types': 8.0.1 '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.1 debug: 4.3.6 - eslint: 9.8.0 + eslint: 9.9.0 optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -4062,10 +4067,10 @@ snapshots: '@typescript-eslint/types': 8.0.1 '@typescript-eslint/visitor-keys': 8.0.1 - '@typescript-eslint/type-utils@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -4108,24 +4113,24 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/utils@7.18.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - eslint: 9.8.0 + eslint: 9.9.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.0.1(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) '@typescript-eslint/scope-manager': 8.0.1 '@typescript-eslint/types': 8.0.1 '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - eslint: 9.8.0 + eslint: 9.9.0 transitivePeerDependencies: - supports-color - typescript @@ -4794,12 +4799,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.5.4): + eslint-plugin-import-x@3.1.0(eslint@9.9.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) debug: 4.3.6 doctrine: 3.0.0 - eslint: 9.8.0 + eslint: 9.9.0 eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.6 is-glob: 4.0.3 @@ -4811,10 +4816,10 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)): + eslint-plugin-vitest@0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.8.0)(typescript@5.5.4) - eslint: 9.8.0 + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) + eslint: 9.9.0 optionalDependencies: vitest: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: @@ -4830,13 +4835,13 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.8.0: + eslint@9.9.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.8.0 + '@eslint/js': 9.9.0 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 @@ -6299,11 +6304,11 @@ snapshots: type-fest@4.24.0: {} - typescript-eslint@8.0.1(eslint@9.8.0)(typescript@5.5.4): + typescript-eslint@8.0.1(eslint@9.9.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.1(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: From 5238e5a9dedbd295bc1fd61e78c33a05bec2b977 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 12 Aug 2024 09:33:56 +0800 Subject: [PATCH 022/210] chore(deps): pin marked --- .github/renovate.json5 | 4 ++++ package.json | 2 +- pnpm-lock.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f13e5dd97..34307d8af 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -54,5 +54,9 @@ // pinned // https://github.com/vuejs/core/commit/a012e39b373f1b6918e5c89856e8f902e1bfa14d '@rollup/plugin-replace', + + // pinned + // only used in example for e2e tests + 'marked', ], } diff --git a/package.json b/package.json index eaf118113..1b08c8bcf 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "lodash": "^4.17.21", "magic-string": "^0.30.11", "markdown-table": "^3.0.3", - "marked": "^13.0.3", + "marked": "13.0.3", "npm-run-all2": "^6.2.2", "picocolors": "^1.0.1", "prettier": "^3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9926afe02..2a4aeb62e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,7 +114,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 marked: - specifier: ^13.0.3 + specifier: 13.0.3 version: 13.0.3 npm-run-all2: specifier: ^6.2.2 From d0f882d5bb6842a1631840c9dfeeeedec189cf6a Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 13 Aug 2024 22:02:57 +0800 Subject: [PATCH 023/210] chore: add explicit type annotation to `initDirectivesForSSR` (#11596) --- packages/runtime-dom/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/index.ts b/packages/runtime-dom/src/index.ts index 95f27353a..344cbf375 100644 --- a/packages/runtime-dom/src/index.ts +++ b/packages/runtime-dom/src/index.ts @@ -283,7 +283,7 @@ let ssrDirectiveInitialized = false /** * @internal */ -export const initDirectivesForSSR = __SSR__ +export const initDirectivesForSSR: () => void = __SSR__ ? () => { if (!ssrDirectiveInitialized) { ssrDirectiveInitialized = true From 4e7d5db4d276a5d4aaf3af7d43cfd28c171db307 Mon Sep 17 00:00:00 2001 From: edison Date: Tue, 13 Aug 2024 22:04:48 +0800 Subject: [PATCH 024/210] feat(deprecated): remove deprecated parseExpressions option (#11597) --- packages/compiler-sfc/src/parse.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/compiler-sfc/src/parse.ts b/packages/compiler-sfc/src/parse.ts index e10d4cc84..08d862446 100644 --- a/packages/compiler-sfc/src/parse.ts +++ b/packages/compiler-sfc/src/parse.ts @@ -29,11 +29,6 @@ export interface SFCParseOptions { ignoreEmpty?: boolean compiler?: TemplateCompiler templateParseOptions?: ParserOptions - /** - * TODO remove in 3.5 - * @deprecated use `templateParseOptions: { prefixIdentifiers: false }` instead - */ - parseExpressions?: boolean } export interface SFCBlock { @@ -138,8 +133,7 @@ export function parse( pad = false, ignoreEmpty = true, compiler = CompilerDOM, - templateParseOptions = {}, - parseExpressions = true, + templateParseOptions = { prefixIdentifiers: true }, } = options const descriptor: SFCDescriptor = { @@ -158,7 +152,6 @@ export function parse( const errors: (CompilerError | SyntaxError)[] = [] const ast = compiler.parse(source, { parseMode: 'sfc', - prefixIdentifiers: parseExpressions, ...templateParseOptions, onError: e => { errors.push(e) From 73fa91fabd43d842c2a65b186a78ecebecfb67dd Mon Sep 17 00:00:00 2001 From: edison Date: Tue, 13 Aug 2024 22:05:14 +0800 Subject: [PATCH 025/210] refactor: remove unnecessary check as filter is always non-null (#11599) --- packages/runtime-core/src/components/KeepAlive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/components/KeepAlive.ts b/packages/runtime-core/src/components/KeepAlive.ts index cca1b8d96..e9c8cce58 100644 --- a/packages/runtime-core/src/components/KeepAlive.ts +++ b/packages/runtime-core/src/components/KeepAlive.ts @@ -195,10 +195,10 @@ const KeepAliveImpl: ComponentOptions = { _unmount(vnode, instance, parentSuspense, true) } - function pruneCache(filter?: (name: string) => boolean) { + function pruneCache(filter: (name: string) => boolean) { cache.forEach((vnode, key) => { const name = getComponentName(vnode.type as ConcreteComponent) - if (name && (!filter || !filter(name))) { + if (name && !filter(name)) { pruneCacheEntry(key) } }) From fee669764fbf475adce9e47a7a73b4937ab31ffc Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 13 Aug 2024 22:06:10 +0800 Subject: [PATCH 026/210] fix(types): add fallback stub for DOM types when DOM lib is absent (#11598) --- packages/runtime-dom/src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/index.ts b/packages/runtime-dom/src/index.ts index 344cbf375..64bfacef2 100644 --- a/packages/runtime-dom/src/index.ts +++ b/packages/runtime-dom/src/index.ts @@ -33,9 +33,17 @@ import type { vShow } from './directives/vShow' import type { VOnDirective } from './directives/vOn' import type { VModelDirective } from './directives/vModel' +/** + * This is a stub implementation to prevent the need to use dom types. + * + * To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`. + */ +type DomStub = {} +type DomType = typeof globalThis extends { window: unknown } ? T : DomStub + declare module '@vue/reactivity' { export interface RefUnwrapBailTypes { - runtimeDOMBailTypes: Node | Window + runtimeDOMBailTypes: DomType } } From 3653bc0f45d6fedf84e29b64ca52584359c383c0 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Tue, 13 Aug 2024 22:07:35 +0800 Subject: [PATCH 027/210] fix(keep-alive): ensure include/exclude regexp work with global flag (#11595) --- .../__tests__/components/KeepAlive.spec.ts | 144 ++++++++++++++++++ .../runtime-core/src/components/KeepAlive.ts | 1 + 2 files changed, 145 insertions(+) diff --git a/packages/runtime-core/__tests__/components/KeepAlive.spec.ts b/packages/runtime-core/__tests__/components/KeepAlive.spec.ts index 6d3f6a9b8..0b761972c 100644 --- a/packages/runtime-core/__tests__/components/KeepAlive.spec.ts +++ b/packages/runtime-core/__tests__/components/KeepAlive.spec.ts @@ -32,6 +32,7 @@ const timeout = (n: number = 0) => new Promise(r => setTimeout(r, n)) describe('KeepAlive', () => { let one: ComponentOptions let two: ComponentOptions + let oneTest: ComponentOptions let views: Record let root: TestElement @@ -49,6 +50,18 @@ describe('KeepAlive', () => { deactivated: vi.fn(), unmounted: vi.fn(), } + oneTest = { + name: 'oneTest', + data: () => ({ msg: 'oneTest' }), + render(this: any) { + return h('div', this.msg) + }, + created: vi.fn(), + mounted: vi.fn(), + activated: vi.fn(), + deactivated: vi.fn(), + unmounted: vi.fn(), + } two = { name: 'two', data: () => ({ msg: 'two' }), @@ -63,6 +76,7 @@ describe('KeepAlive', () => { } views = { one, + oneTest, two, } }) @@ -369,6 +383,128 @@ describe('KeepAlive', () => { assertHookCalls(two, [2, 2, 0, 0, 2]) } + async function assertNameMatchWithFlag(props: KeepAliveProps) { + const outerRef = ref(true) + const viewRef = ref('one') + const App = { + render() { + return outerRef.value + ? h(KeepAlive, props, () => h(views[viewRef.value])) + : null + }, + } + render(h(App), root) + + expect(serializeInner(root)).toBe(`
one
`) + assertHookCalls(one, [1, 1, 1, 0, 0]) + assertHookCalls(oneTest, [0, 0, 0, 0, 0]) + assertHookCalls(two, [0, 0, 0, 0, 0]) + + viewRef.value = 'oneTest' + await nextTick() + expect(serializeInner(root)).toBe(`
oneTest
`) + assertHookCalls(one, [1, 1, 1, 1, 0]) + assertHookCalls(oneTest, [1, 1, 1, 0, 0]) + assertHookCalls(two, [0, 0, 0, 0, 0]) + + viewRef.value = 'two' + await nextTick() + expect(serializeInner(root)).toBe(`
two
`) + assertHookCalls(one, [1, 1, 1, 1, 0]) + assertHookCalls(oneTest, [1, 1, 1, 1, 0]) + assertHookCalls(two, [1, 1, 0, 0, 0]) + + viewRef.value = 'one' + await nextTick() + expect(serializeInner(root)).toBe(`
one
`) + assertHookCalls(one, [1, 1, 2, 1, 0]) + assertHookCalls(oneTest, [1, 1, 1, 1, 0]) + assertHookCalls(two, [1, 1, 0, 0, 1]) + + viewRef.value = 'oneTest' + await nextTick() + expect(serializeInner(root)).toBe(`
oneTest
`) + assertHookCalls(one, [1, 1, 2, 2, 0]) + assertHookCalls(oneTest, [1, 1, 2, 1, 0]) + assertHookCalls(two, [1, 1, 0, 0, 1]) + + viewRef.value = 'two' + await nextTick() + expect(serializeInner(root)).toBe(`
two
`) + assertHookCalls(one, [1, 1, 2, 2, 0]) + assertHookCalls(oneTest, [1, 1, 2, 2, 0]) + assertHookCalls(two, [2, 2, 0, 0, 1]) + + // teardown + outerRef.value = false + await nextTick() + expect(serializeInner(root)).toBe(``) + assertHookCalls(one, [1, 1, 2, 2, 1]) + assertHookCalls(oneTest, [1, 1, 2, 2, 1]) + assertHookCalls(two, [2, 2, 0, 0, 2]) + } + + async function assertNameMatchWithFlagExclude(props: KeepAliveProps) { + const outerRef = ref(true) + const viewRef = ref('one') + const App = { + render() { + return outerRef.value + ? h(KeepAlive, props, () => h(views[viewRef.value])) + : null + }, + } + render(h(App), root) + + expect(serializeInner(root)).toBe(`
one
`) + assertHookCalls(one, [1, 1, 0, 0, 0]) + assertHookCalls(oneTest, [0, 0, 0, 0, 0]) + assertHookCalls(two, [0, 0, 0, 0, 0]) + + viewRef.value = 'oneTest' + await nextTick() + expect(serializeInner(root)).toBe(`
oneTest
`) + assertHookCalls(one, [1, 1, 0, 0, 1]) + assertHookCalls(oneTest, [1, 1, 0, 0, 0]) + assertHookCalls(two, [0, 0, 0, 0, 0]) + + viewRef.value = 'two' + await nextTick() + expect(serializeInner(root)).toBe(`
two
`) + assertHookCalls(one, [1, 1, 0, 0, 1]) + assertHookCalls(oneTest, [1, 1, 0, 0, 1]) + assertHookCalls(two, [1, 1, 1, 0, 0]) + + viewRef.value = 'one' + await nextTick() + expect(serializeInner(root)).toBe(`
one
`) + assertHookCalls(one, [2, 2, 0, 0, 1]) + assertHookCalls(oneTest, [1, 1, 0, 0, 1]) + assertHookCalls(two, [1, 1, 1, 1, 0]) + + viewRef.value = 'oneTest' + await nextTick() + expect(serializeInner(root)).toBe(`
oneTest
`) + assertHookCalls(one, [2, 2, 0, 0, 2]) + assertHookCalls(oneTest, [2, 2, 0, 0, 1]) + assertHookCalls(two, [1, 1, 1, 1, 0]) + + viewRef.value = 'two' + await nextTick() + expect(serializeInner(root)).toBe(`
two
`) + assertHookCalls(one, [2, 2, 0, 0, 2]) + assertHookCalls(oneTest, [2, 2, 0, 0, 2]) + assertHookCalls(two, [1, 1, 2, 1, 0]) + + // teardown + outerRef.value = false + await nextTick() + expect(serializeInner(root)).toBe(``) + assertHookCalls(one, [2, 2, 0, 0, 2]) + assertHookCalls(oneTest, [2, 2, 0, 0, 2]) + assertHookCalls(two, [1, 1, 2, 2, 1]) + } + describe('props', () => { test('include (string)', async () => { await assertNameMatch({ include: 'one' }) @@ -378,6 +514,10 @@ describe('KeepAlive', () => { await assertNameMatch({ include: /^one$/ }) }) + test('include (regex with g flag)', async () => { + await assertNameMatchWithFlag({ include: /one/g }) + }) + test('include (array)', async () => { await assertNameMatch({ include: ['one'] }) }) @@ -390,6 +530,10 @@ describe('KeepAlive', () => { await assertNameMatch({ exclude: /^two$/ }) }) + test('exclude (regex with a flag)', async () => { + await assertNameMatchWithFlagExclude({ exclude: /one/g }) + }) + test('exclude (array)', async () => { await assertNameMatch({ exclude: ['two'] }) }) diff --git a/packages/runtime-core/src/components/KeepAlive.ts b/packages/runtime-core/src/components/KeepAlive.ts index e9c8cce58..11be59ffc 100644 --- a/packages/runtime-core/src/components/KeepAlive.ts +++ b/packages/runtime-core/src/components/KeepAlive.ts @@ -382,6 +382,7 @@ function matches(pattern: MatchPattern, name: string): boolean { } else if (isString(pattern)) { return pattern.split(',').includes(name) } else if (isRegExp(pattern)) { + pattern.lastIndex = 0 return pattern.test(name) } /* istanbul ignore next */ From 3bda3e83fd9e2fbe451a1c79dae82ff6a7467683 Mon Sep 17 00:00:00 2001 From: linzhe <40790268+linzhe141@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:54:08 +0800 Subject: [PATCH 028/210] fix(reactivity): sync watch should be executed correctly (#11589) close #11577 --- packages/reactivity/src/effect.ts | 8 ++---- .../runtime-core/__tests__/apiWatch.spec.ts | 28 +++++++++++++++++++ packages/runtime-core/src/apiWatch.ts | 1 - 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index 6b18318dd..c769ba57d 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -45,8 +45,7 @@ export enum EffectFlags { NOTIFIED = 1 << 3, DIRTY = 1 << 4, ALLOW_RECURSE = 1 << 5, - NO_BATCH = 1 << 6, - PAUSED = 1 << 7, + PAUSED = 1 << 6, } /** @@ -169,9 +168,6 @@ export class ReactiveEffect ) { return } - if (this.flags & EffectFlags.NO_BATCH) { - return this.trigger() - } if (!(this.flags & EffectFlags.NOTIFIED)) { this.flags |= EffectFlags.NOTIFIED this.nextEffect = batchedEffect @@ -267,6 +263,7 @@ export function endBatch(): void { return } + batchDepth-- let error: unknown while (batchedEffect) { let e: ReactiveEffect | undefined = batchedEffect @@ -286,7 +283,6 @@ export function endBatch(): void { } } - batchDepth-- if (error) throw error } diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index 85afec24c..67f0bc160 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -1856,4 +1856,32 @@ describe('api: watch', () => { warn.mockRestore() }) + + it('should be executed correctly', () => { + const v = ref(1) + let foo = '' + + watch( + v, + () => { + foo += '1' + }, + { + flush: 'sync', + }, + ) + watch( + v, + () => { + foo += '2' + }, + { + flush: 'sync', + }, + ) + + expect(foo).toBe('') + v.value++ + expect(foo).toBe('12') + }) }) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 2ad887a34..479a263b3 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -394,7 +394,6 @@ function doWatch( let scheduler: EffectScheduler if (flush === 'sync') { - effect.flags |= EffectFlags.NO_BATCH scheduler = job as any // the scheduler function gets called directly } else if (flush === 'post') { scheduler = () => queuePostRenderEffect(job, instance && instance.suspense) From 5cf5a1620d9a97382d386c277265d9dd051fe484 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 14 Aug 2024 15:11:10 +0800 Subject: [PATCH 029/210] fix(types/computed): ensure type safety for `WritableComputedRef` (#11608) --- packages-private/dts-test/ref.test-d.ts | 8 ++++++++ packages/reactivity/src/computed.ts | 15 ++++++++++----- packages/runtime-core/src/apiComputed.ts | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages-private/dts-test/ref.test-d.ts b/packages-private/dts-test/ref.test-d.ts index 89dbeacb3..929e3d1a1 100644 --- a/packages-private/dts-test/ref.test-d.ts +++ b/packages-private/dts-test/ref.test-d.ts @@ -209,6 +209,14 @@ describe('allow computed getter and setter types to be unrelated', () => { expectType(c.value) }) +describe('Type safety for `WritableComputedRef` and `ComputedRef`', () => { + // @ts-expect-error + const writableComputed: WritableComputedRef = computed(() => '') + // should allow + const immutableComputed: ComputedRef = writableComputed + expectType>(immutableComputed) +}) + // shallowRef type Status = 'initial' | 'ready' | 'invalidating' const shallowStatus = shallowRef('initial') diff --git a/packages/reactivity/src/computed.ts b/packages/reactivity/src/computed.ts index bb9f9e02f..aa5d20790 100644 --- a/packages/reactivity/src/computed.ts +++ b/packages/reactivity/src/computed.ts @@ -14,19 +14,24 @@ import { Dep, globalVersion } from './dep' import { ReactiveFlags, TrackOpTypes } from './constants' declare const ComputedRefSymbol: unique symbol +declare const WritableComputedRefSymbol: unique symbol -export interface ComputedRef extends WritableComputedRef { - readonly value: T +interface BaseComputedRef extends Ref { [ComputedRefSymbol]: true -} - -export interface WritableComputedRef extends Ref { /** * @deprecated computed no longer uses effect */ effect: ComputedRefImpl } +export interface ComputedRef extends BaseComputedRef { + readonly value: T +} + +export interface WritableComputedRef extends BaseComputedRef { + [WritableComputedRefSymbol]: true +} + export type ComputedGetter = (oldValue?: T) => T export type ComputedSetter = (newValue: T) => void diff --git a/packages/runtime-core/src/apiComputed.ts b/packages/runtime-core/src/apiComputed.ts index a7d959dfa..2ebb2d4e6 100644 --- a/packages/runtime-core/src/apiComputed.ts +++ b/packages/runtime-core/src/apiComputed.ts @@ -13,5 +13,5 @@ export const computed: typeof _computed = ( ;(c as unknown as ComputedRefImpl)._warnRecursive = true } } - return c + return c as any } From c96ec67c875d5589a21e6cef12ef977f9ab66a4a Mon Sep 17 00:00:00 2001 From: Raman Paulau Date: Wed, 14 Aug 2024 00:12:13 -0700 Subject: [PATCH 030/210] chore(types): update examples in JSDoc for augmenting global properties and custom options to align with docs (#11609) --- packages/runtime-core/src/componentOptions.ts | 2 +- packages/runtime-core/src/componentPublicInstance.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/componentOptions.ts b/packages/runtime-core/src/componentOptions.ts index 07955f841..c59b0428f 100644 --- a/packages/runtime-core/src/componentOptions.ts +++ b/packages/runtime-core/src/componentOptions.ts @@ -91,7 +91,7 @@ import { markAsyncBoundary } from './helpers/useId' * * @example * ```ts - * declare module '@vue/runtime-core' { + * declare module 'vue' { * interface ComponentCustomOptions { * beforeRouteUpdate?( * to: Route, diff --git a/packages/runtime-core/src/componentPublicInstance.ts b/packages/runtime-core/src/componentPublicInstance.ts index 9857df189..39935427f 100644 --- a/packages/runtime-core/src/componentPublicInstance.ts +++ b/packages/runtime-core/src/componentPublicInstance.ts @@ -65,7 +65,7 @@ import type { Directive } from './directives' * import { createApp } from 'vue' * import { Router, createRouter } from 'vue-router' * - * declare module '@vue/runtime-core' { + * declare module 'vue' { * interface ComponentCustomProperties { * $router: Router * } From c66a362f5060dc6afab5f9e4910db3a1d457cc52 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 15 Aug 2024 08:48:13 +0800 Subject: [PATCH 031/210] chore: add recommendations extensions vitest (#11610) --- .vscode/extensions.json | 3 +++ vitest.workspace.ts | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 vitest.workspace.ts diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..91ebd5692 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["vitest.explorer"] +} diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 000000000..a20586e7c --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,6 @@ +import { defineWorkspace } from 'vitest/config' + +export default defineWorkspace([ + './vitest.unit.config.ts', + './vitest.e2e.config.ts', +]) From 905c9f16e112fa1c39976b7e4b51ecc3d6bcdeab Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 08:55:36 +0800 Subject: [PATCH 032/210] chore: update changelog regarding inject behavior change close #11602 close #11604 --- changelogs/CHANGELOG-3.4.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelogs/CHANGELOG-3.4.md b/changelogs/CHANGELOG-3.4.md index 635ec8513..3390d7ffc 100644 --- a/changelogs/CHANGELOG-3.4.md +++ b/changelogs/CHANGELOG-3.4.md @@ -12,6 +12,7 @@ * Revert "fix(types/ref): correct type inference for nested refs ([#11536](https://github.com/vuejs/core/issues/11536))" ([3a56315](https://github.com/vuejs/core/commit/3a56315f94bc0e11cfbb288b65482ea8fc3a39b4)) * **runtime-core:** fix warning for missing event handler ([#11489](https://github.com/vuejs/core/issues/11489)) ([e359ff0](https://github.com/vuejs/core/commit/e359ff0046286aee03fe31656c023677be457e07)), closes [#4803](https://github.com/vuejs/core/issues/4803) [#8268](https://github.com/vuejs/core/issues/8268) * **runtime-core:** prioritize using the provides from currentApp in nested createApp ([#11502](https://github.com/vuejs/core/issues/11502)) ([7e75de0](https://github.com/vuejs/core/commit/7e75de002f08076a02c9361a58fa1d0af1772964)), closes [#11488](https://github.com/vuejs/core/issues/11488) + * Note: this change will break `inject` calls inside Pinia stores that expects to be able to inject provided values from the component using the store. This is expected because the usage is relying on previously incorrect behavior. * **runtime-dom:** apply css vars before mount ([#11538](https://github.com/vuejs/core/issues/11538)) ([fdc2a31](https://github.com/vuejs/core/commit/fdc2a31dbd4196d6432be16767a1bfdab1240d49)), closes [#11533](https://github.com/vuejs/core/issues/11533) * **ssr:** ensure content is valid when rendering normal slot ([#11491](https://github.com/vuejs/core/issues/11491)) ([6c90324](https://github.com/vuejs/core/commit/6c903248703e2413c6197b9ad4d535f31c8eac39)), closes [#11326](https://github.com/vuejs/core/issues/11326) * **types/ref:** correct type inference for nested refs ([#11536](https://github.com/vuejs/core/issues/11536)) ([536f623](https://github.com/vuejs/core/commit/536f62332c455ba82ef2979ba634b831f91928ba)), closes [#11532](https://github.com/vuejs/core/issues/11532) [#11537](https://github.com/vuejs/core/issues/11537) From 58612294757480974e667652ede5bbcf72b1089d Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 09:58:30 +0800 Subject: [PATCH 033/210] fix(compiler-core): use ast-based check for function expressions when possible close #11615 --- .../__tests__/transforms/vOn.spec.ts | 15 ++++ .../compiler-core/__tests__/utils.spec.ts | 16 +++-- .../compiler-core/src/transforms/vModel.ts | 5 +- packages/compiler-core/src/transforms/vOn.ts | 9 +-- packages/compiler-core/src/utils.ts | 69 ++++++++++++++++--- 5 files changed, 89 insertions(+), 25 deletions(-) diff --git a/packages/compiler-core/__tests__/transforms/vOn.spec.ts b/packages/compiler-core/__tests__/transforms/vOn.spec.ts index 66097f29f..9fda02595 100644 --- a/packages/compiler-core/__tests__/transforms/vOn.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vOn.spec.ts @@ -285,6 +285,21 @@ describe('compiler: transform v-on', () => { }, ], }) + + const { node: node2 } = parseWithVOn( + `
`, + ) + expect((node2.codegenNode as VNodeCall).props).toMatchObject({ + properties: [ + { + key: { content: `onClick` }, + value: { + type: NodeTypes.SIMPLE_EXPRESSION, + content: `(e: (number | string)[]) => foo(e)`, + }, + }, + ], + }) }) test('should NOT wrap as function if expression is already function expression (async)', () => { diff --git a/packages/compiler-core/__tests__/utils.spec.ts b/packages/compiler-core/__tests__/utils.spec.ts index 506aa8698..2d377a271 100644 --- a/packages/compiler-core/__tests__/utils.spec.ts +++ b/packages/compiler-core/__tests__/utils.spec.ts @@ -1,5 +1,5 @@ -import type { TransformContext } from '../src' -import type { Position } from '../src/ast' +import type { ExpressionNode, TransformContext } from '../src' +import { type Position, createSimpleExpression } from '../src/ast' import { advancePositionWithClone, isMemberExpressionBrowser, @@ -41,7 +41,8 @@ describe('advancePositionWithClone', () => { }) describe('isMemberExpression', () => { - function commonAssertions(fn: (str: string) => boolean) { + function commonAssertions(raw: (exp: ExpressionNode) => boolean) { + const fn = (str: string) => raw(createSimpleExpression(str)) // should work expect(fn('obj.foo')).toBe(true) expect(fn('obj[foo]')).toBe(true) @@ -78,13 +79,16 @@ describe('isMemberExpression', () => { test('browser', () => { commonAssertions(isMemberExpressionBrowser) - expect(isMemberExpressionBrowser('123[a]')).toBe(false) + expect(isMemberExpressionBrowser(createSimpleExpression('123[a]'))).toBe( + false, + ) }) test('node', () => { const ctx = { expressionPlugins: ['typescript'] } as any as TransformContext - const fn = (str: string) => isMemberExpressionNode(str, ctx) - commonAssertions(fn) + const fn = (str: string) => + isMemberExpressionNode(createSimpleExpression(str), ctx) + commonAssertions(exp => isMemberExpressionNode(exp, ctx)) // TS-specific checks expect(fn('foo as string')).toBe(true) diff --git a/packages/compiler-core/src/transforms/vModel.ts b/packages/compiler-core/src/transforms/vModel.ts index 88be6238a..60c7dc63b 100644 --- a/packages/compiler-core/src/transforms/vModel.ts +++ b/packages/compiler-core/src/transforms/vModel.ts @@ -55,10 +55,7 @@ export const transformModel: DirectiveTransform = (dir, node, context) => { bindingType === BindingTypes.SETUP_REF || bindingType === BindingTypes.SETUP_MAYBE_REF) - if ( - !expString.trim() || - (!isMemberExpression(expString, context) && !maybeRef) - ) { + if (!expString.trim() || (!isMemberExpression(exp, context) && !maybeRef)) { context.onError( createCompilerError(ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION, exp.loc), ) diff --git a/packages/compiler-core/src/transforms/vOn.ts b/packages/compiler-core/src/transforms/vOn.ts index a1631e10d..ed809a2d7 100644 --- a/packages/compiler-core/src/transforms/vOn.ts +++ b/packages/compiler-core/src/transforms/vOn.ts @@ -13,12 +13,9 @@ import { camelize, toHandlerKey } from '@vue/shared' import { ErrorCodes, createCompilerError } from '../errors' import { processExpression } from './transformExpression' import { validateBrowserExpression } from '../validateExpression' -import { hasScopeRef, isMemberExpression } from '../utils' +import { hasScopeRef, isFnExpression, isMemberExpression } from '../utils' import { TO_HANDLER_KEY } from '../runtimeHelpers' -const fnExpRE = - /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/ - export interface VOnDirectiveNode extends DirectiveNode { // v-on without arg is handled directly in ./transformElements.ts due to it affecting // codegen for the entire props object. This transform here is only for v-on @@ -84,8 +81,8 @@ export const transformOn: DirectiveTransform = ( } let shouldCache: boolean = context.cacheHandlers && !exp && !context.inVOnce if (exp) { - const isMemberExp = isMemberExpression(exp.content, context) - const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content)) + const isMemberExp = isMemberExpression(exp, context) + const isInlineStatement = !(isMemberExp || isFnExpression(exp, context)) const hasMultipleStatements = exp.content.includes(`;`) // process the expression since it's been skipped diff --git a/packages/compiler-core/src/utils.ts b/packages/compiler-core/src/utils.ts index 54a3a8457..5b29a117c 100644 --- a/packages/compiler-core/src/utils.ts +++ b/packages/compiler-core/src/utils.ts @@ -40,7 +40,7 @@ import { import { NOOP, isObject, isString } from '@vue/shared' import type { PropsExpression } from './transforms/transformElement' import { parseExpression } from '@babel/parser' -import type { Expression } from '@babel/types' +import type { Expression, Node } from '@babel/types' import { unwrapTSNode } from './babelUtils' export const isStaticExp = (p: JSChildNode): p is SimpleExpressionNode => @@ -78,15 +78,20 @@ const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/ const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/ const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g +const getExpSource = (exp: ExpressionNode): string => + exp.type === NodeTypes.SIMPLE_EXPRESSION ? exp.content : exp.loc.source + /** * Simple lexer to check if an expression is a member expression. This is * lax and only checks validity at the root level (i.e. does not validate exps * inside square brackets), but it's ok since these are only used on template * expressions and false positives are invalid expressions in the first place. */ -export const isMemberExpressionBrowser = (path: string): boolean => { +export const isMemberExpressionBrowser = (exp: ExpressionNode): boolean => { // remove whitespaces around . or [ first - path = path.trim().replace(whitespaceRE, s => s.trim()) + const path = getExpSource(exp) + .trim() + .replace(whitespaceRE, s => s.trim()) let state = MemberExpLexState.inMemberExp let stateStack: MemberExpLexState[] = [] @@ -154,15 +159,19 @@ export const isMemberExpressionBrowser = (path: string): boolean => { } export const isMemberExpressionNode: ( - path: string, + exp: ExpressionNode, context: TransformContext, ) => boolean = __BROWSER__ ? (NOOP as any) - : (path: string, context: TransformContext): boolean => { + : (exp, context) => { try { - let ret: Expression = parseExpression(path, { - plugins: context.expressionPlugins, - }) + let ret: Node = + exp.ast || + parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins + ? [...context.expressionPlugins, 'typescript'] + : ['typescript'], + }) ret = unwrapTSNode(ret) as Expression return ( ret.type === 'MemberExpression' || @@ -175,10 +184,52 @@ export const isMemberExpressionNode: ( } export const isMemberExpression: ( - path: string, + exp: ExpressionNode, context: TransformContext, ) => boolean = __BROWSER__ ? isMemberExpressionBrowser : isMemberExpressionNode +const fnExpRE = + /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/ + +export const isFnExpressionBrowser: (exp: ExpressionNode) => boolean = exp => + fnExpRE.test(getExpSource(exp)) + +export const isFnExpressionNode: ( + exp: ExpressionNode, + context: TransformContext, +) => boolean = __BROWSER__ + ? (NOOP as any) + : (exp, context) => { + try { + let ret: Node = + exp.ast || + parseExpression(getExpSource(exp), { + plugins: context.expressionPlugins + ? [...context.expressionPlugins, 'typescript'] + : ['typescript'], + }) + // parser may parse the exp as statements when it contains semicolons + if (ret.type === 'Program') { + ret = ret.body[0] + if (ret.type === 'ExpressionStatement') { + ret = ret.expression + } + } + ret = unwrapTSNode(ret) as Expression + return ( + ret.type === 'FunctionExpression' || + ret.type === 'ArrowFunctionExpression' + ) + } catch (e) { + return false + } + } + +export const isFnExpression: ( + exp: ExpressionNode, + context: TransformContext, +) => boolean = __BROWSER__ ? isFnExpressionBrowser : isFnExpressionNode + export function advancePositionWithClone( pos: Position, source: string, From e9e08155bf8d00c3327ed7371330eb2ae467e560 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 10:16:32 +0800 Subject: [PATCH 034/210] fix(build): revert entities to 4.5 to avoid runtime resolution errors close #11603 --- .github/renovate.json5 | 4 ++++ packages/compiler-core/package.json | 2 +- packages/compiler-core/src/parser.ts | 2 +- packages/compiler-core/src/tokenizer.ts | 2 +- pnpm-lock.yaml | 10 ++-------- rollup.config.js | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 34307d8af..8808b599e 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -58,5 +58,9 @@ // pinned // only used in example for e2e tests 'marked', + + // pinned, 5.0+ has exports issues + // https://github.com/vuejs/core/issues/11603 + 'entities', ], } diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 4172a3919..6acbf724c 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -48,7 +48,7 @@ "dependencies": { "@babel/parser": "catalog:", "@vue/shared": "workspace:*", - "entities": "^5.0.0", + "entities": "^4.5.0", "estree-walker": "catalog:", "source-map-js": "catalog:" }, diff --git a/packages/compiler-core/src/parser.ts b/packages/compiler-core/src/parser.ts index 55487e12b..cac943dd6 100644 --- a/packages/compiler-core/src/parser.ts +++ b/packages/compiler-core/src/parser.ts @@ -44,7 +44,7 @@ import { isSimpleIdentifier, isStaticArgOf, } from './utils' -import { decodeHTML } from 'entities/dist/decode.js' +import { decodeHTML } from 'entities/lib/decode.js' import { type ParserOptions as BabelOptions, parse, diff --git a/packages/compiler-core/src/tokenizer.ts b/packages/compiler-core/src/tokenizer.ts index 7e93cdf58..35c49fa65 100644 --- a/packages/compiler-core/src/tokenizer.ts +++ b/packages/compiler-core/src/tokenizer.ts @@ -36,7 +36,7 @@ import { EntityDecoder, fromCodePoint, htmlDecodeTree, -} from 'entities/dist/decode.js' +} from 'entities/lib/decode.js' export enum ParseMode { BASE, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a4aeb62e..975f879b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -256,8 +256,8 @@ importers: specifier: workspace:* version: link:../shared entities: - specifier: ^5.0.0 - version: 5.0.0 + specifier: ^4.5.0 + version: 4.5.0 estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -1773,10 +1773,6 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - entities@5.0.0: - resolution: {integrity: sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==} - engines: {node: '>=0.12'} - env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} @@ -4700,8 +4696,6 @@ snapshots: entities@4.5.0: {} - entities@5.0.0: {} - env-paths@2.2.1: {} environment@1.1.0: {} diff --git a/rollup.config.js b/rollup.config.js index 79883d1dd..a9f9b17f3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -258,7 +258,7 @@ function createConfig(format, output, plugins = []) { 'source-map-js', '@babel/parser', 'estree-walker', - 'entities/dist/decode.js', + 'entities/lib/decode.js', ] if (isGlobalBuild || isBrowserESMBuild || isCompatPackage) { From fe008152c0612ff3ecc7ad88e7e66a06b1b2bc3f Mon Sep 17 00:00:00 2001 From: disservin Date: Thu, 15 Aug 2024 04:24:04 +0200 Subject: [PATCH 035/210] fix(compiler-sfc): handle keyof operator with index object (#11581) --- .../compileScript/resolveType.spec.ts | 59 +++++++++++++++++++ .../compiler-sfc/src/script/resolveType.ts | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts index b8b71878e..ff3388256 100644 --- a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts @@ -596,6 +596,65 @@ describe('resolveType', () => { }) }) + test('keyof: nested object with number', () => { + const { props } = resolve( + ` + interface Type { + deep: { + 1: any + } + } + + defineProps<{ + route: keyof Type['deep'] + }>()`, + ) + + expect(props).toStrictEqual({ + route: ['Number'], + }) + }) + + test('keyof: nested object with string', () => { + const { props } = resolve( + ` + interface Type { + deep: { + foo: any + } + } + + defineProps<{ + route: keyof Type['deep'] + }>()`, + ) + + expect(props).toStrictEqual({ + route: ['String'], + }) + }) + + test('keyof: nested object with intermediate', () => { + const { props } = resolve( + ` + interface Type { + deep: { + foo: any + } + } + + type Foo = Type['deep'] + + defineProps<{ + route: keyof Foo + }>()`, + ) + + expect(props).toStrictEqual({ + route: ['String'], + }) + }) + test('ExtractPropTypes (element-plus)', () => { const { props, raw } = resolve( ` diff --git a/packages/compiler-sfc/src/script/resolveType.ts b/packages/compiler-sfc/src/script/resolveType.ts index 4f2d29e03..ee0a72399 100644 --- a/packages/compiler-sfc/src/script/resolveType.ts +++ b/packages/compiler-sfc/src/script/resolveType.ts @@ -1703,7 +1703,7 @@ export function inferRuntimeType( case 'TSIndexedAccessType': { const types = resolveIndexType(ctx, node, scope) - return flattenTypes(ctx, types, scope) + return flattenTypes(ctx, types, scope, isKeyOf) } case 'ClassDeclaration': From 3d6f01571b3fb61b32da599d0419eff4e3ebb231 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 14:29:14 +0800 Subject: [PATCH 036/210] fix(compiler-sfc): fix prefixIdentifier default value --- .../compileScript/importUsageCheck.spec.ts | 16 ++++++++++++++++ packages/compiler-sfc/src/parse.ts | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts b/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts index b842f7a46..fe52b12d4 100644 --- a/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript/importUsageCheck.spec.ts @@ -234,3 +234,19 @@ test('namespace / dot component usage', () => { expect(content).toMatch('return { get Foo() { return Foo } }') assertCode(content) }) + +test('check when has explicit parse options', () => { + const { content } = compile( + ` + + + `, + undefined, + { templateParseOptions: {} }, + ) + expect(content).toMatch('return { get x() { return x } }') +}) diff --git a/packages/compiler-sfc/src/parse.ts b/packages/compiler-sfc/src/parse.ts index 08d862446..01a4bec6e 100644 --- a/packages/compiler-sfc/src/parse.ts +++ b/packages/compiler-sfc/src/parse.ts @@ -133,7 +133,7 @@ export function parse( pad = false, ignoreEmpty = true, compiler = CompilerDOM, - templateParseOptions = { prefixIdentifiers: true }, + templateParseOptions = {}, } = options const descriptor: SFCDescriptor = { @@ -152,6 +152,7 @@ export function parse( const errors: (CompilerError | SyntaxError)[] = [] const ast = compiler.parse(source, { parseMode: 'sfc', + prefixIdentifiers: true, ...templateParseOptions, onError: e => { errors.push(e) From e19fc270428b59456fee43224990138c4d6ccb2d Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 15:18:19 +0800 Subject: [PATCH 037/210] fix(custom-element): keep instance.isCE for backwards compat --- packages/runtime-core/src/component.ts | 7 ++++++- packages/runtime-dom/src/apiCustomElement.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 24cf90003..46608ae2d 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -414,10 +414,15 @@ export interface ComponentInternalInstance { */ inheritAttrs?: boolean /** - * is custom element? + * Custom Element instance (if component is created by defineCustomElement) * @internal */ ce?: ComponentCustomElementInterface + /** + * is custom element? (kept only for compatibility) + * @internal + */ + isCE?: boolean /** * custom element specific HMR method * @internal diff --git a/packages/runtime-dom/src/apiCustomElement.ts b/packages/runtime-dom/src/apiCustomElement.ts index efee4d8a9..79b7eea80 100644 --- a/packages/runtime-dom/src/apiCustomElement.ts +++ b/packages/runtime-dom/src/apiCustomElement.ts @@ -519,6 +519,7 @@ export class VueElement vnode.ce = instance => { this._instance = instance instance.ce = this + instance.isCE = true // for vue-i18n backwards compat // HMR if (__DEV__) { instance.ceReload = newStyles => { From 7d700c215d6250c9acfc5e126770dade678bcebf Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 15 Aug 2024 15:29:43 +0800 Subject: [PATCH 038/210] release: v3.5.0-beta.2 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ package.json | 2 +- packages/compiler-core/package.json | 2 +- packages/compiler-dom/package.json | 2 +- packages/compiler-sfc/package.json | 2 +- packages/compiler-ssr/package.json | 2 +- packages/reactivity/package.json | 2 +- packages/runtime-core/package.json | 2 +- packages/runtime-dom/package.json | 2 +- packages/server-renderer/package.json | 2 +- packages/shared/package.json | 2 +- packages/vue-compat/package.json | 2 +- packages/vue/package.json | 2 +- 13 files changed, 36 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54d83073c..7d3fcdf64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +# [3.5.0-beta.2](https://github.com/vuejs/core/compare/v3.5.0-beta.1...v3.5.0-beta.2) (2024-08-15) + + +### Bug Fixes + +* **build:** revert entities to 4.5 to avoid runtime resolution errors ([e9e0815](https://github.com/vuejs/core/commit/e9e08155bf8d00c3327ed7371330eb2ae467e560)), closes [#11603](https://github.com/vuejs/core/issues/11603) +* **compiler-core:** use ast-based check for function expressions when possible ([5861229](https://github.com/vuejs/core/commit/58612294757480974e667652ede5bbcf72b1089d)), closes [#11615](https://github.com/vuejs/core/issues/11615) +* **compiler-sfc:** fix prefixIdentifier default value ([3d6f015](https://github.com/vuejs/core/commit/3d6f01571b3fb61b32da599d0419eff4e3ebb231)) +* **compiler-sfc:** handle keyof operator with index object ([#11581](https://github.com/vuejs/core/issues/11581)) ([fe00815](https://github.com/vuejs/core/commit/fe008152c0612ff3ecc7ad88e7e66a06b1b2bc3f)) +* **custom-element:** keep instance.isCE for backwards compat ([e19fc27](https://github.com/vuejs/core/commit/e19fc270428b59456fee43224990138c4d6ccb2d)) +* **deps:** update dependency postcss to ^8.4.41 ([#11585](https://github.com/vuejs/core/issues/11585)) ([4c4e12a](https://github.com/vuejs/core/commit/4c4e12ae28d67d616924b0601e68adc551959971)) +* **keep-alive:** ensure include/exclude regexp work with global flag ([#11595](https://github.com/vuejs/core/issues/11595)) ([3653bc0](https://github.com/vuejs/core/commit/3653bc0f45d6fedf84e29b64ca52584359c383c0)) +* **reactivity:** ensure extended method arguments are not lost ([#11574](https://github.com/vuejs/core/issues/11574)) ([4085def](https://github.com/vuejs/core/commit/4085def1bae42d01ee3c22c731cc4a02096464ee)), closes [#11570](https://github.com/vuejs/core/issues/11570) +* **reactivity:** sync watch should be executed correctly ([#11589](https://github.com/vuejs/core/issues/11589)) ([3bda3e8](https://github.com/vuejs/core/commit/3bda3e83fd9e2fbe451a1c79dae82ff6a7467683)), closes [#11577](https://github.com/vuejs/core/issues/11577) +* **types/computed:** ensure type safety for `WritableComputedRef` ([#11608](https://github.com/vuejs/core/issues/11608)) ([5cf5a16](https://github.com/vuejs/core/commit/5cf5a1620d9a97382d386c277265d9dd051fe484)) +* **types:** add fallback stub for DOM types when DOM lib is absent ([#11598](https://github.com/vuejs/core/issues/11598)) ([fee6697](https://github.com/vuejs/core/commit/fee669764fbf475adce9e47a7a73b4937ab31ffc)) + + +### Features + +* **deprecated:** remove deprecated parseExpressions option ([#11597](https://github.com/vuejs/core/issues/11597)) ([4e7d5db](https://github.com/vuejs/core/commit/4e7d5db4d276a5d4aaf3af7d43cfd28c171db307)) + + + # [3.5.0-beta.1](https://github.com/vuejs/core/compare/v3.4.37...v3.5.0-beta.1) (2024-08-08) diff --git a/package.json b/package.json index 1b08c8bcf..83fd352df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "packageManager": "pnpm@9.7.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 6acbf724c..028bd629f 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/compiler-core", "main": "index.js", "module": "dist/compiler-core.esm-bundler.js", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index 5dcb81737..a23e66f58 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/compiler-dom", "main": "index.js", "module": "dist/compiler-dom.esm-bundler.js", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index fecea4681..c7a358a95 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index c726aee37..5927015fc 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index adf8e864a..2099737e4 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 0d0f6c57a..77263a90f 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 68dddc9e1..63a72e0b2 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index d8221ea15..47bab1419 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index 6156f210d..eb5fa68b7 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index ce721601d..3bd457db4 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index 5c1d2cd02..18eed0969 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.0-beta.1", + "version": "3.5.0-beta.2", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From d7d0371e74707ee601020f67de88e091cdae2673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:49:43 +0800 Subject: [PATCH 039/210] fix(runtime-core): correct type inference for PascalCase emits (#11579) fix vuejs/language-tools#4269 --- .../dts-test/defineComponent.test-d.tsx | 15 +++++++++++++++ packages/runtime-core/src/componentEmits.ts | 16 +++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages-private/dts-test/defineComponent.test-d.tsx b/packages-private/dts-test/defineComponent.test-d.tsx index 810310bac..79ce6d695 100644 --- a/packages-private/dts-test/defineComponent.test-d.tsx +++ b/packages-private/dts-test/defineComponent.test-d.tsx @@ -906,12 +906,15 @@ describe('emits', () => { emits: { click: (n: number) => typeof n === 'number', input: (b: string) => b.length > 1, + Focus: (f: boolean) => !!f, }, setup(props, { emit }) { expectType<((n: number) => boolean) | undefined>(props.onClick) expectType<((b: string) => boolean) | undefined>(props.onInput) + expectType<((f: boolean) => boolean) | undefined>(props.onFocus) emit('click', 1) emit('input', 'foo') + emit('Focus', true) // @ts-expect-error emit('nope') // @ts-expect-error @@ -922,6 +925,10 @@ describe('emits', () => { emit('input') // @ts-expect-error emit('input', 1) + // @ts-expect-error + emit('focus') + // @ts-expect-error + emit('focus', true) }, created() { this.$emit('click', 1) @@ -936,6 +943,10 @@ describe('emits', () => { this.$emit('input') // @ts-expect-error this.$emit('input', 1) + // @ts-expect-error + this.$emit('focus') + // @ts-expect-error + this.$emit('focus', true) }, mounted() { // #3599 @@ -954,6 +965,10 @@ describe('emits', () => { this.$emit('input') // @ts-expect-error this.$emit('input', 1) + // @ts-expect-error + this.$emit('focus') + // @ts-expect-error + this.$emit('focus', true) }) }, }) diff --git a/packages/runtime-core/src/componentEmits.ts b/packages/runtime-core/src/componentEmits.ts index 4c3912e05..dddb2e945 100644 --- a/packages/runtime-core/src/componentEmits.ts +++ b/packages/runtime-core/src/componentEmits.ts @@ -47,15 +47,13 @@ export type EmitsToProps = } : T extends ObjectEmitsOptions ? { - [K in `on${Capitalize}`]?: K extends `on${infer C}` - ? ( - ...args: T[Uncapitalize] extends (...args: infer P) => any - ? P - : T[Uncapitalize] extends null - ? any[] - : never - ) => any - : never + [K in string & keyof T as `on${Capitalize}`]?: ( + ...args: T[K] extends (...args: infer P) => any + ? P + : T[K] extends null + ? any[] + : never + ) => any } : {} From 9cf8ea9ba79e21640d2f05970bbd431dc1d276a0 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 16 Aug 2024 16:01:24 +0800 Subject: [PATCH 040/210] chore: add 3.4.38 changelog (#11630) [ci skip] --- CHANGELOG.md | 2 +- changelogs/CHANGELOG-3.4.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3fcdf64..c7af327bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -143,7 +143,7 @@ ## Previous Changelogs -### 3.4.x (2023-10-28 - 2024-08-08) +### 3.4.x (2023-10-28 - 2024-08-15) See [3.4 changelog](./changelogs/CHANGELOG-3.4.md) diff --git a/changelogs/CHANGELOG-3.4.md b/changelogs/CHANGELOG-3.4.md index 3390d7ffc..6c97e4829 100644 --- a/changelogs/CHANGELOG-3.4.md +++ b/changelogs/CHANGELOG-3.4.md @@ -1,3 +1,15 @@ +## [3.4.38](https://github.com/vuejs/core/compare/v3.4.37...v3.4.38) (2024-08-15) + + +### Bug Fixes + +* **build:** revert entities to 4.5 to avoid runtime resolution errors ([f349af7](https://github.com/vuejs/core/commit/f349af7b65b9f8605d8b7bafcc06c25ab1f2daf0)), closes [#11603](https://github.com/vuejs/core/issues/11603) +* **compiler-core:** use ast-based check for function expressions when possible ([236cac3](https://github.com/vuejs/core/commit/236cac3ff285890b8468dc827c463d87a91e516f)), closes [#11615](https://github.com/vuejs/core/issues/11615) +* **compiler-sfc:** handle keyof operator with index object ([#11581](https://github.com/vuejs/core/issues/11581)) ([74d26db](https://github.com/vuejs/core/commit/74d26dbbe3cf2f70d1b772284eec6743ea946f6d)) +* **types:** add fallback stub for DOM types when DOM lib is absent ([#11598](https://github.com/vuejs/core/issues/11598)) ([4db0085](https://github.com/vuejs/core/commit/4db0085de316e1b773f474597915f9071d6ae6c6)) + + + ## [3.4.37](https://github.com/vuejs/core/compare/v3.4.36...v3.4.37) (2024-08-08) From 7ba59c6d4394466f7343bb008f5ef04240056a1b Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 16 Aug 2024 16:01:40 +0800 Subject: [PATCH 041/210] feat(workflows): auto close issues with `can't reproduce` label (#11631) * feat(workflows): auto close issues with 'can't reproduce' label * chore: update --- .../workflows/close-cant-reproduce-issues.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/close-cant-reproduce-issues.yml diff --git a/.github/workflows/close-cant-reproduce-issues.yml b/.github/workflows/close-cant-reproduce-issues.yml new file mode 100644 index 000000000..8fb48f842 --- /dev/null +++ b/.github/workflows/close-cant-reproduce-issues.yml @@ -0,0 +1,21 @@ +name: Auto close issues with "can't reproduce" label + +on: + schedule: + - cron: '0 0 * * *' + +permissions: + issues: write + +jobs: + close-issues: + if: github.repository == 'vuejs/core' + runs-on: ubuntu-latest + steps: + - name: can't reproduce + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + token: ${{ secrets.GITHUB_TOKEN }} + labels: "can't reproduce" + inactive-day: 3 From c42919a0f6ab1c7ff22d7cab3d446461504c5de6 Mon Sep 17 00:00:00 2001 From: dlzmoe Date: Fri, 16 Aug 2024 16:02:23 +0800 Subject: [PATCH 042/210] chore: update email link in SECURITY.md (#11632) [ci skip] --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index a1bb8c411..192502e38 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,6 +10,6 @@ Please note that we do not consider XSS via template expressions a valid attack We would like to thank the following security researchers for responsibly disclosing security issues to us. -- Jeet Pal - [@jeetpal2007](https://github.com/jeetpal2007) | [Email](jeetpal2007@gmail.com) | [LinkedIn](https://in.linkedin.com/in/jeet-pal-22601a290) +- Jeet Pal - [@jeetpal2007](https://github.com/jeetpal2007) | [Email](mailto:jeetpal2007@gmail.com) | [LinkedIn](https://in.linkedin.com/in/jeet-pal-22601a290) - Mix - [@mnixry](https://github.com/mnixry) - Aviv Keller - [@RedYetiDev](https://github.com/redyetidev) | [LinkedIn](https://www.linkedin.com/in/redyetidev) From 8bcaad4a32cf0f1f89e0259f6a53036620b7fe9f Mon Sep 17 00:00:00 2001 From: Jakob Date: Fri, 16 Aug 2024 10:14:08 +0200 Subject: [PATCH 043/210] fix(watch): handle errors in computed used as watch source (#11626) close #11624 --- .../__tests__/errorHandling.spec.ts | 37 +++++++++++++++++++ packages/runtime-core/src/apiWatch.ts | 5 ++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/errorHandling.spec.ts b/packages/runtime-core/__tests__/errorHandling.spec.ts index 4cf4ffe31..0cd3efa58 100644 --- a/packages/runtime-core/__tests__/errorHandling.spec.ts +++ b/packages/runtime-core/__tests__/errorHandling.spec.ts @@ -670,5 +670,42 @@ describe('error handling', () => { ) }) + // #11624 + test('in computed that is used as key for watch', async () => { + const err = new Error('foo') + const fn = vi.fn() + const trigger = ref(false) + + const Comp = { + setup() { + onErrorCaptured((err, instance, info) => { + fn(err, info) + return false + }) + return () => h(Child) + }, + } + + const Child = { + setup() { + const foo = computed(() => { + if (trigger.value) throw err + return 1 + }) + watch(foo, () => {}) + return () => null + }, + } + + render(h(Comp), nodeOps.createElement('div')) + + trigger.value = true + await nextTick() + expect(fn).toHaveBeenCalledWith( + err, + ErrorTypeStrings[ErrorCodes.COMPONENT_UPDATE], + ) + }) + // native event handler handling should be tested in respective renderers }) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 479a263b3..35b488052 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -400,7 +400,10 @@ function doWatch( } else { // default: 'pre' job.flags! |= SchedulerJobFlags.PRE - if (instance) job.id = instance.uid + if (instance) { + job.id = instance.uid + job.i = instance + } scheduler = () => queueJob(job) } effect.scheduler = scheduler From 5e0f6d5f8fe7c4eb8f247357c3e2e281726f36db Mon Sep 17 00:00:00 2001 From: Andy Li Date: Thu, 15 Aug 2024 10:28:40 +0800 Subject: [PATCH 044/210] fix(types/custom-element): `defineCustomElement` with required props (#11578) --- .../dts-test/defineCustomElement.test-d.ts | 33 +++++++++++++++++++ packages/runtime-dom/src/apiCustomElement.ts | 8 ++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/packages-private/dts-test/defineCustomElement.test-d.ts b/packages-private/dts-test/defineCustomElement.test-d.ts index b81c0befe..f81f8b8fa 100644 --- a/packages-private/dts-test/defineCustomElement.test-d.ts +++ b/packages-private/dts-test/defineCustomElement.test-d.ts @@ -99,4 +99,37 @@ describe('defineCustomElement using defineComponent return type', () => { expectType(instance.a) instance.a = 42 }) + + test('with required props', () => { + const Comp1Vue = defineComponent({ + props: { + a: { type: Number, required: true }, + }, + }) + const Comp = defineCustomElement(Comp1Vue) + expectType(Comp) + + const instance = new Comp() + expectType(instance.a) + instance.a = 42 + }) + + test('with default props', () => { + const Comp1Vue = defineComponent({ + props: { + a: { + type: Number, + default: 1, + validator: () => true, + }, + }, + emits: ['click'], + }) + const Comp = defineCustomElement(Comp1Vue) + expectType(Comp) + + const instance = new Comp() + expectType(instance.a) + instance.a = 42 + }) }) diff --git a/packages/runtime-dom/src/apiCustomElement.ts b/packages/runtime-dom/src/apiCustomElement.ts index 79b7eea80..ccd8989b3 100644 --- a/packages/runtime-dom/src/apiCustomElement.ts +++ b/packages/runtime-dom/src/apiCustomElement.ts @@ -9,6 +9,7 @@ import { type ComponentOptionsBase, type ComponentOptionsMixin, type ComponentProvideOptions, + type ComponentPublicInstance, type ComputedOptions, type ConcreteComponent, type CreateAppFunction, @@ -153,14 +154,13 @@ export function defineCustomElement< // overload 3: defining a custom element from the returned value of // `defineComponent` export function defineCustomElement< - T extends DefineComponent, + // this should be `ComponentPublicInstanceConstructor` but that type is not exported + T extends { new (...args: any[]): ComponentPublicInstance }, >( options: T, extraOptions?: CustomElementOptions, ): VueElementConstructor< - T extends DefineComponent - ? ExtractPropTypes

- : unknown + T extends DefineComponent ? P : unknown > /*! #__NO_SIDE_EFFECTS__ */ From 9de1d101f98bf6081f41038f6974826f190330a0 Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 16 Aug 2024 16:23:09 +0800 Subject: [PATCH 045/210] fix(reactivity): extended methods respect reactive (#11629) close #11628 --- packages/reactivity/__tests__/reactiveArray.spec.ts | 12 ++++++++++-- packages/reactivity/src/arrayInstrumentations.ts | 11 ++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/reactivity/__tests__/reactiveArray.spec.ts b/packages/reactivity/__tests__/reactiveArray.spec.ts index 960c16e0b..fabafc21e 100644 --- a/packages/reactivity/__tests__/reactiveArray.spec.ts +++ b/packages/reactivity/__tests__/reactiveArray.spec.ts @@ -709,9 +709,17 @@ describe('reactivity/reactive/Array', () => { expect(state.things.every('foo', 'bar', 'baz')).toBe(false) expect(state.things.filter('foo', 'bar', 'baz')).toEqual([foo]) - expect(state.things.find('foo', 'bar', 'baz')).toBe(foo) + + const _foo = state.things.find('foo', 'bar', 'baz') + expect(isReactive(_foo)).toBe(true) + expect(foo).toStrictEqual(_foo) + expect(state.things.findIndex('foo', 'bar', 'baz')).toBe(1) - expect(state.things.findLast('foo', 'bar', 'baz')).toBe(bar) + + const _bar = state.things.findLast('foo', 'bar', 'baz') + expect(isReactive(_bar)).toBe(true) + expect(bar).toStrictEqual(_bar) + expect(state.things.findLastIndex('foo', 'bar', 'baz')).toBe(1) expect(state.things.forEach('foo', 'bar', 'baz')).toBeUndefined() expect(state.things.map('foo', 'bar', 'baz')).toEqual(['1', '2', '3']) diff --git a/packages/reactivity/src/arrayInstrumentations.ts b/packages/reactivity/src/arrayInstrumentations.ts index 58c31835d..6cf7602ec 100644 --- a/packages/reactivity/src/arrayInstrumentations.ts +++ b/packages/reactivity/src/arrayInstrumentations.ts @@ -239,16 +239,17 @@ function apply( args?: IArguments, ) { const arr = shallowReadArray(self) - let methodFn + const needsWrap = arr !== self && !isShallow(self) // @ts-expect-error our code is limited to es2016 but user code is not - if ((methodFn = arr[method]) !== arrayProto[method]) { - return methodFn.apply(arr, args) + const methodFn = arr[method] + // @ts-expect-error + if (methodFn !== arrayProto[method]) { + const result = methodFn.apply(arr, args) + return needsWrap ? toReactive(result) : result } - let needsWrap = false let wrappedFn = fn if (arr !== self) { - needsWrap = !isShallow(self) if (needsWrap) { wrappedFn = function (this: unknown, item, index) { return fn.call(this, toReactive(item), index, self) From ca41b9202a26672273dce659a34f1351bfc97a68 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 16 Aug 2024 17:53:02 +0800 Subject: [PATCH 046/210] workflow: set up continuous release with pkg.pr.new --- .github/workflows/ci.yml | 27 +++++++++++++++++ .github/workflows/upload-packages.yml | 42 --------------------------- 2 files changed, 27 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/upload-packages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9145507f..1ae85e207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ on: push: branches: - '**' + tags: + - '!**' pull_request: branches: - main @@ -12,3 +14,28 @@ jobs: test: if: ${{ ! startsWith(github.event.head_commit.message, 'release:') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }} uses: ./.github/workflows/test.yml + + continuous-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm build --withTypes + + - name: Release + run: pnpx pkg-pr-new publish --compact --pnpm './packages/*' diff --git a/.github/workflows/upload-packages.yml b/.github/workflows/upload-packages.yml deleted file mode 100644 index 6c2bfa8c5..000000000 --- a/.github/workflows/upload-packages.yml +++ /dev/null @@ -1,42 +0,0 @@ -# upload built packages as artifacts for faster ecosystem-ci -name: upload-built-packages - -on: - workflow_run: - workflows: ['ci'] - branches: [main, minor] - types: - - completed - -jobs: - build-and-upload: - if: > - github.repository == 'vuejs/core' && - github.event.workflow_run.event == 'push' && - github.event.workflow_run.conclusion == 'success' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.node-version' - registry-url: 'https://registry.npmjs.org' - cache: 'pnpm' - - - name: Install deps - run: pnpm install - - - name: Build - run: pnpm build --withTypes - - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: packages - path: packages/*/dist/* From 7a6c6652e064a8be9d2543bc11914cc0ce1b8cf1 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 16 Aug 2024 22:01:41 +0800 Subject: [PATCH 047/210] workflow: pass along commit to ecosystem-ci pr workflow --- .github/workflows/ecosystem-ci-trigger.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ecosystem-ci-trigger.yml b/.github/workflows/ecosystem-ci-trigger.yml index 25adf7c85..b3e963ece 100644 --- a/.github/workflows/ecosystem-ci-trigger.yml +++ b/.github/workflows/ecosystem-ci-trigger.yml @@ -9,7 +9,8 @@ jobs: runs-on: ubuntu-latest if: github.repository == 'vuejs/core' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run') steps: - - uses: actions/github-script@v7 + - name: Check user permission + uses: actions/github-script@v7 with: script: | const user = context.payload.sender.login @@ -43,7 +44,8 @@ jobs: }) throw new Error('not allowed') } - - uses: actions/github-script@v7 + - name: Get PR info + uses: actions/github-script@v7 id: get-pr-data with: script: | @@ -56,9 +58,11 @@ jobs: return { num: context.issue.number, branchName: pr.head.ref, - repo: pr.head.repo.full_name + repo: pr.head.repo.full_name, + commit: pr.head.sha } - - uses: actions/github-script@v7 + - name: Trigger run + uses: actions/github-script@v7 id: trigger env: COMMENT: ${{ github.event.comment.body }} @@ -80,6 +84,7 @@ jobs: prNumber: '' + prData.num, branchName: prData.branchName, repo: prData.repo, - suite: suite === '' ? '-' : suite + suite: suite === '' ? '-' : suite, + commit: prData.commit } }) From b332f80f0edb018229a23b43b93bb402b6368a3c Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Mon, 19 Aug 2024 03:13:50 +0100 Subject: [PATCH 048/210] fix(runtime-core): pre jobs without an id should run first (#7746) --- .../runtime-core/__tests__/scheduler.spec.ts | 41 ++++++++++++++++++- packages/runtime-core/src/scheduler.ts | 14 +++---- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/packages/runtime-core/__tests__/scheduler.spec.ts b/packages/runtime-core/__tests__/scheduler.spec.ts index 079ced4bd..8d74330da 100644 --- a/packages/runtime-core/__tests__/scheduler.spec.ts +++ b/packages/runtime-core/__tests__/scheduler.spec.ts @@ -239,6 +239,37 @@ describe('scheduler', () => { expect(calls).toEqual(['cb1', 'cb2', 'job1']) }) + it('should insert pre jobs without ids first during flushing', async () => { + const calls: string[] = [] + const job1: SchedulerJob = () => { + calls.push('job1') + queueJob(job3) + queueJob(job4) + } + // job1 has no id + job1.flags! |= SchedulerJobFlags.PRE + const job2: SchedulerJob = () => { + calls.push('job2') + } + job2.id = 1 + job2.flags! |= SchedulerJobFlags.PRE + const job3: SchedulerJob = () => { + calls.push('job3') + } + // job3 has no id + job3.flags! |= SchedulerJobFlags.PRE + const job4: SchedulerJob = () => { + calls.push('job4') + } + // job4 has no id + job4.flags! |= SchedulerJobFlags.PRE + + queueJob(job1) + queueJob(job2) + await nextTick() + expect(calls).toEqual(['job1', 'job3', 'job4', 'job2']) + }) + // #3806 it('queue preFlushCb inside postFlushCb', async () => { const spy = vi.fn() @@ -448,12 +479,20 @@ describe('scheduler', () => { job2.id = 2 const job3 = () => calls.push('job3') job3.id = 1 + const job4: SchedulerJob = () => calls.push('job4') + job4.id = 2 + job4.flags! |= SchedulerJobFlags.PRE + const job5: SchedulerJob = () => calls.push('job5') + // job5 has no id + job5.flags! |= SchedulerJobFlags.PRE queueJob(job1) queueJob(job2) queueJob(job3) + queueJob(job4) + queueJob(job5) await nextTick() - expect(calls).toEqual(['job3', 'job2', 'job1']) + expect(calls).toEqual(['job5', 'job3', 'job4', 'job2', 'job1']) }) test('sort SchedulerCbs based on id', async () => { diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 354ebb3a4..bcad99629 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -92,16 +92,16 @@ function findInsertionIndex(id: number) { export function queueJob(job: SchedulerJob): void { if (!(job.flags! & SchedulerJobFlags.QUEUED)) { - if (job.id == null) { - queue.push(job) - } else if ( + const jobId = getId(job) + const lastJob = queue[queue.length - 1] + if ( + !lastJob || // fast path when the job id is larger than the tail - !(job.flags! & SchedulerJobFlags.PRE) && - job.id >= ((queue[queue.length - 1] && queue[queue.length - 1].id) || 0) + (!(job.flags! & SchedulerJobFlags.PRE) && jobId >= getId(lastJob)) ) { queue.push(job) } else { - queue.splice(findInsertionIndex(job.id), 0, job) + queue.splice(findInsertionIndex(jobId), 0, job) } if (!(job.flags! & SchedulerJobFlags.ALLOW_RECURSE)) { @@ -206,7 +206,7 @@ export function flushPostFlushCbs(seen?: CountMap): void { } const getId = (job: SchedulerJob): number => - job.id == null ? Infinity : job.id + job.id == null ? (job.flags! & SchedulerJobFlags.PRE ? -1 : Infinity) : job.id const comparator = (a: SchedulerJob, b: SchedulerJob): number => { const diff = getId(a) - getId(b) From 7fbf4964e4444c72cc2cc8939783a2178f3763cd Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Mon, 19 Aug 2024 03:17:45 +0100 Subject: [PATCH 049/210] refactor(scheduler): remove redundant sorting (#11646) --- packages/runtime-core/src/scheduler.ts | 36 +++++++------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index bcad99629..256ab2027 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -64,13 +64,17 @@ export function nextTick( return fn ? p.then(this ? fn.bind(this) : fn) : p } -// #2768 -// Use binary-search to find a suitable position in the queue, -// so that the queue maintains the increasing order of job's id, -// which can prevent the job from being skipped and also can avoid repeated patching. +// Use binary-search to find a suitable position in the queue. The queue needs +// to be sorted in increasing order of the job ids. This ensures that: +// 1. Components are updated from parent to child. As the parent is always +// created before the child it will always have a smaller id. +// 2. If a component is unmounted during a parent component's update, its update +// can be skipped. +// A pre watcher will have the same id as its component's update job. The +// watcher should be inserted immediately before the update job. This allows +// watchers to be skipped if the component is unmounted by the parent update. function findInsertionIndex(id: number) { - // the start index should be `flushIndex + 1` - let start = flushIndex + 1 + let start = isFlushing ? flushIndex + 1 : 0 let end = queue.length while (start < end) { @@ -208,17 +212,6 @@ export function flushPostFlushCbs(seen?: CountMap): void { const getId = (job: SchedulerJob): number => job.id == null ? (job.flags! & SchedulerJobFlags.PRE ? -1 : Infinity) : job.id -const comparator = (a: SchedulerJob, b: SchedulerJob): number => { - const diff = getId(a) - getId(b) - if (diff === 0) { - const isAPre = a.flags! & SchedulerJobFlags.PRE - const isBPre = b.flags! & SchedulerJobFlags.PRE - if (isAPre && !isBPre) return -1 - if (isBPre && !isAPre) return 1 - } - return diff -} - function flushJobs(seen?: CountMap) { isFlushPending = false isFlushing = true @@ -226,15 +219,6 @@ function flushJobs(seen?: CountMap) { seen = seen || new Map() } - // Sort queue before flush. - // This ensures that: - // 1. Components are updated from parent to child. (because parent is always - // created before the child so its render effect will have smaller - // priority number) - // 2. If a component is unmounted during a parent component's update, - // its update can be skipped. - queue.sort(comparator) - // conditional usage of checkRecursiveUpdate must be determined out of // try ... catch block since Rollup by default de-optimizes treeshaking // inside try-catch. This can leave all warning code unshaked. Although From 4469972c9f2bc80d1e659e98f2174570df79a6a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:33:57 +0800 Subject: [PATCH 050/210] chore(deps): update build (#11651) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 6 +- .../src/download/template/package.json | 2 +- pnpm-lock.yaml | 531 +++++++++++------- 3 files changed, 347 insertions(+), 192 deletions(-) diff --git a/package.json b/package.json index 83fd352df..419529b04 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "5.0.4", - "@swc/core": "^1.7.10", + "@swc/core": "^1.7.11", "@types/hash-sum": "^1.0.2", "@types/node": "^20.14.15", "@types/semver": "^7.5.8", @@ -75,7 +75,7 @@ "@vue/consolidate": "1.0.0", "conventional-changelog-cli": "^5.0.0", "enquirer": "^2.4.1", - "esbuild": "^0.23.0", + "esbuild": "^0.23.1", "esbuild-plugin-polyfill-node": "^0.3.0", "eslint": "^9.9.0", "eslint-plugin-import-x": "^3.1.0", @@ -94,7 +94,7 @@ "pug": "^3.0.3", "puppeteer": "~23.0.2", "rimraf": "^6.0.1", - "rollup": "^4.20.0", + "rollup": "^4.21.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-polyfill-node": "^0.13.0", diff --git a/packages-private/sfc-playground/src/download/template/package.json b/packages-private/sfc-playground/src/download/template/package.json index 50f0a6d2f..8b9d97521 100644 --- a/packages-private/sfc-playground/src/download/template/package.json +++ b/packages-private/sfc-playground/src/download/template/package.json @@ -12,6 +12,6 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^5.1.2", - "vite": "^5.4.0" + "vite": "^5.4.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 975f879b8..3fc091562 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,22 +40,22 @@ importers: version: 7.25.2 '@rollup/plugin-alias': specifier: ^5.1.0 - version: 5.1.0(rollup@4.20.0) + version: 5.1.0(rollup@4.21.0) '@rollup/plugin-commonjs': specifier: ^26.0.1 - version: 26.0.1(rollup@4.20.0) + version: 26.0.1(rollup@4.21.0) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.20.0) + version: 6.1.0(rollup@4.21.0) '@rollup/plugin-node-resolve': specifier: ^15.2.3 - version: 15.2.3(rollup@4.20.0) + version: 15.2.3(rollup@4.21.0) '@rollup/plugin-replace': specifier: 5.0.4 - version: 5.0.4(rollup@4.20.0) + version: 5.0.4(rollup@4.21.0) '@swc/core': - specifier: ^1.7.10 - version: 1.7.10 + specifier: ^1.7.11 + version: 1.7.11 '@types/hash-sum': specifier: ^1.0.2 version: 1.0.2 @@ -81,11 +81,11 @@ importers: specifier: ^2.4.1 version: 2.4.1 esbuild: - specifier: ^0.23.0 - version: 0.23.0 + specifier: ^0.23.1 + version: 0.23.1 esbuild-plugin-polyfill-node: specifier: ^0.3.0 - version: 0.3.0(esbuild@0.23.0) + version: 0.3.0(esbuild@0.23.1) eslint: specifier: ^9.9.0 version: 9.9.0 @@ -138,17 +138,17 @@ importers: specifier: ^6.0.1 version: 6.0.1 rollup: - specifier: ^4.20.0 - version: 4.20.0 + specifier: ^4.21.0 + version: 4.21.0 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.20.0)(typescript@5.5.4) + version: 6.1.1(rollup@4.21.0)(typescript@5.5.4) rollup-plugin-esbuild: specifier: ^6.1.1 - version: 6.1.1(esbuild@0.23.0)(rollup@4.20.0) + version: 6.1.1(esbuild@0.23.1)(rollup@4.21.0) rollup-plugin-polyfill-node: specifier: ^0.13.0 - version: 0.13.0(rollup@4.20.0) + version: 0.13.0(rollup@4.21.0) semver: specifier: ^7.6.3 version: 7.6.3 @@ -536,8 +536,8 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.23.0': - resolution: {integrity: sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==} + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] @@ -548,8 +548,8 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.23.0': - resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} engines: {node: '>=18'} cpu: [arm64] os: [android] @@ -560,8 +560,8 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.23.0': - resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} engines: {node: '>=18'} cpu: [arm] os: [android] @@ -572,8 +572,8 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.23.0': - resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -584,8 +584,8 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.23.0': - resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] @@ -596,8 +596,8 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.23.0': - resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} engines: {node: '>=18'} cpu: [x64] os: [darwin] @@ -608,8 +608,8 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.23.0': - resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] @@ -620,8 +620,8 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.23.0': - resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -632,8 +632,8 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.23.0': - resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] @@ -644,8 +644,8 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.23.0': - resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] @@ -656,8 +656,8 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.23.0': - resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} engines: {node: '>=18'} cpu: [ia32] os: [linux] @@ -668,8 +668,8 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.23.0': - resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} engines: {node: '>=18'} cpu: [loong64] os: [linux] @@ -680,8 +680,8 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.23.0': - resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] @@ -692,8 +692,8 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.23.0': - resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] @@ -704,8 +704,8 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.23.0': - resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] @@ -716,8 +716,8 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.23.0': - resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -728,8 +728,8 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.23.0': - resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} engines: {node: '>=18'} cpu: [x64] os: [linux] @@ -740,14 +740,14 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.23.0': - resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.23.0': - resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] @@ -758,8 +758,8 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.23.0': - resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] @@ -770,8 +770,8 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.23.0': - resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -782,8 +782,8 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.23.0': - resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} engines: {node: '>=18'} cpu: [arm64] os: [win32] @@ -794,8 +794,8 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.23.0': - resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -806,8 +806,8 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.23.0': - resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -968,143 +968,223 @@ packages: cpu: [arm] os: [android] + '@rollup/rollup-android-arm-eabi@4.21.0': + resolution: {integrity: sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==} + cpu: [arm] + os: [android] + '@rollup/rollup-android-arm64@4.20.0': resolution: {integrity: sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==} cpu: [arm64] os: [android] + '@rollup/rollup-android-arm64@4.21.0': + resolution: {integrity: sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==} + cpu: [arm64] + os: [android] + '@rollup/rollup-darwin-arm64@4.20.0': resolution: {integrity: sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==} cpu: [arm64] os: [darwin] + '@rollup/rollup-darwin-arm64@4.21.0': + resolution: {integrity: sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==} + cpu: [arm64] + os: [darwin] + '@rollup/rollup-darwin-x64@4.20.0': resolution: {integrity: sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==} cpu: [x64] os: [darwin] + '@rollup/rollup-darwin-x64@4.21.0': + resolution: {integrity: sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==} + cpu: [x64] + os: [darwin] + '@rollup/rollup-linux-arm-gnueabihf@4.20.0': resolution: {integrity: sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-gnueabihf@4.21.0': + resolution: {integrity: sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.20.0': resolution: {integrity: sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.21.0': + resolution: {integrity: sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.20.0': resolution: {integrity: sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.21.0': + resolution: {integrity: sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-musl@4.20.0': resolution: {integrity: sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-musl@4.21.0': + resolution: {integrity: sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.20.0': resolution: {integrity: sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==} cpu: [ppc64] os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': + resolution: {integrity: sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==} + cpu: [ppc64] + os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.20.0': resolution: {integrity: sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.21.0': + resolution: {integrity: sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.20.0': resolution: {integrity: sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==} cpu: [s390x] os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.21.0': + resolution: {integrity: sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==} + cpu: [s390x] + os: [linux] + '@rollup/rollup-linux-x64-gnu@4.20.0': resolution: {integrity: sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-gnu@4.21.0': + resolution: {integrity: sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-musl@4.20.0': resolution: {integrity: sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-musl@4.21.0': + resolution: {integrity: sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==} + cpu: [x64] + os: [linux] + '@rollup/rollup-win32-arm64-msvc@4.20.0': resolution: {integrity: sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==} cpu: [arm64] os: [win32] + '@rollup/rollup-win32-arm64-msvc@4.21.0': + resolution: {integrity: sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==} + cpu: [arm64] + os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.20.0': resolution: {integrity: sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==} cpu: [ia32] os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.21.0': + resolution: {integrity: sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==} + cpu: [ia32] + os: [win32] + '@rollup/rollup-win32-x64-msvc@4.20.0': resolution: {integrity: sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==} cpu: [x64] os: [win32] - '@swc/core-darwin-arm64@1.7.10': - resolution: {integrity: sha512-TYp4x/9w/C/yMU1olK5hTKq/Hi7BjG71UJ4V1U1WxI1JA3uokjQ/GoktDfmH5V5pX4dgGSOJwUe2RjoN8Z/XnA==} + '@rollup/rollup-win32-x64-msvc@4.21.0': + resolution: {integrity: sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==} + cpu: [x64] + os: [win32] + + '@swc/core-darwin-arm64@1.7.11': + resolution: {integrity: sha512-HRQv4qIeMBPThZ6Y/4yYW52rGsS6yrpusvuxLGyoFo45Y0y12/V2yXkOIA/0HIQyrqoUAxn1k4zQXpPaPNCmnw==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.7.10': - resolution: {integrity: sha512-P3LJjAWh5yLc6p5IUwV5LgRfA3R1oDCZDMabYyb2BVQuJTD4MfegW9DhBcUUF5dhBLwq3191KpLVzE+dLTbiXw==} + '@swc/core-darwin-x64@1.7.11': + resolution: {integrity: sha512-vtMQj0F3oYwDu5yhO7SKDRg1XekRSi6/TbzHAbBXv+dBhlGGvcZZynT1H90EVFTv+7w7Sh+lOFvRv5Z4ZTcxow==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.7.10': - resolution: {integrity: sha512-yGOFjE7w/akRTmqGY3FvWYrqbxO7OB2N2FHj2LO5HtzXflfoABb5RyRvdEquX+17J6mEpu4EwjYNraTD/WHIEQ==} + '@swc/core-linux-arm-gnueabihf@1.7.11': + resolution: {integrity: sha512-mHtzWKxhtyreI4CSxs+3+ENv8t/Qo35WFoYG66qHEgJz/Z2Lh6jv1E+MYgHdYwnpQHgHbdvAco7HsBu/Dt6xXw==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.7.10': - resolution: {integrity: sha512-SPWsgWHfdWKKjLrYlvhxcdBJ7Ruy6crJbPoE9NfD95eJEjMnS2yZTqj2ChFsY737WeyhWYlHzgYhYOVCp83YwQ==} + '@swc/core-linux-arm64-gnu@1.7.11': + resolution: {integrity: sha512-FRwe/x0GfXSQjGP2lIk+NO0pUFS/lI/RorCLBPiK808EVE9JTbh9DKCc/4Bbb4jgScAjNkrFCUVObQYl3YKmpA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.7.10': - resolution: {integrity: sha512-PUi50bkNqnBL3Z/Zq6jSfwgN9A/taA6u2Zou0tjDJi7oVdpjdr7SxNgCGzMJ/nNg5D/IQn1opM1jktMvpsPAuQ==} + '@swc/core-linux-arm64-musl@1.7.11': + resolution: {integrity: sha512-GY/rs0+GUq14Gbnza90KOrQd/9yHd5qQMii5jcSWcUCT5A8QTa8kiicsM2NxZeTJ69xlKmT7sLod5l99lki/2A==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.7.10': - resolution: {integrity: sha512-Sc+pY55gknCAmBQBR6DhlA7jZSxHaLSDb5Sevzi6DOFMXR79NpA6zWTNKwp1GK2AnRIkbAfvYLgOxS5uWTFVpg==} + '@swc/core-linux-x64-gnu@1.7.11': + resolution: {integrity: sha512-QDkGRwSPmp2RBOlSs503IUXlWYlny8DyznTT0QuK0ML2RpDFlXWU94K/EZhS0RBEUkMY/W51OacM8P8aS/dkCg==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.7.10': - resolution: {integrity: sha512-g5NKx2LXaGd0K26hmEts1Cvb7ptIvq3MHSgr6/D1tRPcDZw1Sp0dYsmyOv0ho4F5GOJyiCooG3oE9FXdb7jIpQ==} + '@swc/core-linux-x64-musl@1.7.11': + resolution: {integrity: sha512-SBEfKrXy6zQ6ksnyxw1FaCftrIH4fLfA81xNnKb7x/6iblv7Ko6H0aK3P5C86jyqF/82+ONl9C7ImGkUFQADig==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.7.10': - resolution: {integrity: sha512-plRIsOcfy9t9Q/ivm5DA7I0HaIvfAWPbI+bvVRrr3C/1K2CSqnqZJjEWOAmx2LiyipijNnEaFYuLBp0IkGuJpg==} + '@swc/core-win32-arm64-msvc@1.7.11': + resolution: {integrity: sha512-a2Y4xxEsLLYHJN7sMnw9+YQJDi3M1BxEr9hklfopPuGGnYLFNnx5CypH1l9ReijEfWjIAHNi7pq3m023lzW1Hg==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.7.10': - resolution: {integrity: sha512-GntrVNT23viHtbfzmlK8lfBiKeajH24GzbDT7qXhnoO20suUPcyYZxyvCb4gWM2zu8ZBTPHNlqfrNsriQCZ+lQ==} + '@swc/core-win32-ia32-msvc@1.7.11': + resolution: {integrity: sha512-ZbZFMwZO+j8ulhegJ7EhJ/QVZPoQ5qc30ylJQSxizizTJaen71Q7/13lXWc6ksuCKvg6dUKrp/TPgoxOOtSrFA==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.7.10': - resolution: {integrity: sha512-uXIF8GuSappe1imm6Lf7pHGepfCBjDQlS+qTqvEGE0wZAsL1IVATK9P/cH/OCLfJXeQDTLeSYmrpwjtXNt46tQ==} + '@swc/core-win32-x64-msvc@1.7.11': + resolution: {integrity: sha512-IUohZedSJyDu/ReEBG/mqX6uG29uA7zZ9z6dIAF+p6eFxjXmh9MuHryyM+H8ebUyoq/Ad3rL+rUCksnuYNnI0w==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.7.10': - resolution: {integrity: sha512-l0xrFwBQ9atizhmV94yC2nwcecTk/oftofwMNPiFMGe56dqdmi2ArHaTV3PCtMlgaUH6rGCehoRMt5OrCI1ktg==} + '@swc/core@1.7.11': + resolution: {integrity: sha512-AB+qc45UrJrDfbhPKcUXk+9z/NmFfYYwJT6G7/iur0fCse9kXjx45gi40+u/O2zgarG/30/zV6E3ps8fUvjh7g==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -1805,8 +1885,8 @@ packages: engines: {node: '>=12'} hasBin: true - esbuild@0.23.0: - resolution: {integrity: sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==} + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} engines: {node: '>=18'} hasBin: true @@ -2943,6 +3023,11 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + rollup@4.21.0: + resolution: {integrity: sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + rrweb-cssom@0.6.0: resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} @@ -3603,142 +3688,142 @@ snapshots: '@esbuild/aix-ppc64@0.21.5': optional: true - '@esbuild/aix-ppc64@0.23.0': + '@esbuild/aix-ppc64@0.23.1': optional: true '@esbuild/android-arm64@0.21.5': optional: true - '@esbuild/android-arm64@0.23.0': + '@esbuild/android-arm64@0.23.1': optional: true '@esbuild/android-arm@0.21.5': optional: true - '@esbuild/android-arm@0.23.0': + '@esbuild/android-arm@0.23.1': optional: true '@esbuild/android-x64@0.21.5': optional: true - '@esbuild/android-x64@0.23.0': + '@esbuild/android-x64@0.23.1': optional: true '@esbuild/darwin-arm64@0.21.5': optional: true - '@esbuild/darwin-arm64@0.23.0': + '@esbuild/darwin-arm64@0.23.1': optional: true '@esbuild/darwin-x64@0.21.5': optional: true - '@esbuild/darwin-x64@0.23.0': + '@esbuild/darwin-x64@0.23.1': optional: true '@esbuild/freebsd-arm64@0.21.5': optional: true - '@esbuild/freebsd-arm64@0.23.0': + '@esbuild/freebsd-arm64@0.23.1': optional: true '@esbuild/freebsd-x64@0.21.5': optional: true - '@esbuild/freebsd-x64@0.23.0': + '@esbuild/freebsd-x64@0.23.1': optional: true '@esbuild/linux-arm64@0.21.5': optional: true - '@esbuild/linux-arm64@0.23.0': + '@esbuild/linux-arm64@0.23.1': optional: true '@esbuild/linux-arm@0.21.5': optional: true - '@esbuild/linux-arm@0.23.0': + '@esbuild/linux-arm@0.23.1': optional: true '@esbuild/linux-ia32@0.21.5': optional: true - '@esbuild/linux-ia32@0.23.0': + '@esbuild/linux-ia32@0.23.1': optional: true '@esbuild/linux-loong64@0.21.5': optional: true - '@esbuild/linux-loong64@0.23.0': + '@esbuild/linux-loong64@0.23.1': optional: true '@esbuild/linux-mips64el@0.21.5': optional: true - '@esbuild/linux-mips64el@0.23.0': + '@esbuild/linux-mips64el@0.23.1': optional: true '@esbuild/linux-ppc64@0.21.5': optional: true - '@esbuild/linux-ppc64@0.23.0': + '@esbuild/linux-ppc64@0.23.1': optional: true '@esbuild/linux-riscv64@0.21.5': optional: true - '@esbuild/linux-riscv64@0.23.0': + '@esbuild/linux-riscv64@0.23.1': optional: true '@esbuild/linux-s390x@0.21.5': optional: true - '@esbuild/linux-s390x@0.23.0': + '@esbuild/linux-s390x@0.23.1': optional: true '@esbuild/linux-x64@0.21.5': optional: true - '@esbuild/linux-x64@0.23.0': + '@esbuild/linux-x64@0.23.1': optional: true '@esbuild/netbsd-x64@0.21.5': optional: true - '@esbuild/netbsd-x64@0.23.0': + '@esbuild/netbsd-x64@0.23.1': optional: true - '@esbuild/openbsd-arm64@0.23.0': + '@esbuild/openbsd-arm64@0.23.1': optional: true '@esbuild/openbsd-x64@0.21.5': optional: true - '@esbuild/openbsd-x64@0.23.0': + '@esbuild/openbsd-x64@0.23.1': optional: true '@esbuild/sunos-x64@0.21.5': optional: true - '@esbuild/sunos-x64@0.23.0': + '@esbuild/sunos-x64@0.23.1': optional: true '@esbuild/win32-arm64@0.21.5': optional: true - '@esbuild/win32-arm64@0.23.0': + '@esbuild/win32-arm64@0.23.1': optional: true '@esbuild/win32-ia32@0.21.5': optional: true - '@esbuild/win32-ia32@0.23.0': + '@esbuild/win32-ia32@0.23.1': optional: true '@esbuild/win32-x64@0.21.5': optional: true - '@esbuild/win32-x64@0.23.0': + '@esbuild/win32-x64@0.23.1': optional: true '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0)': @@ -3838,156 +3923,204 @@ snapshots: transitivePeerDependencies: - supports-color - '@rollup/plugin-alias@5.1.0(rollup@4.20.0)': + '@rollup/plugin-alias@5.1.0(rollup@4.21.0)': dependencies: slash: 4.0.0 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/plugin-commonjs@26.0.1(rollup@4.20.0)': + '@rollup/plugin-commonjs@26.0.1(rollup@4.21.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 10.4.5 is-reference: 1.2.1 magic-string: 0.30.11 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/plugin-inject@5.0.5(rollup@4.20.0)': + '@rollup/plugin-inject@5.0.5(rollup@4.21.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) estree-walker: 2.0.2 magic-string: 0.30.11 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/plugin-json@6.1.0(rollup@4.20.0)': + '@rollup/plugin-json@6.1.0(rollup@4.21.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/plugin-node-resolve@15.2.3(rollup@4.20.0)': + '@rollup/plugin-node-resolve@15.2.3(rollup@4.21.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/plugin-replace@5.0.4(rollup@4.20.0)': + '@rollup/plugin-replace@5.0.4(rollup@4.21.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) magic-string: 0.30.11 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 - '@rollup/pluginutils@5.1.0(rollup@4.20.0)': + '@rollup/pluginutils@5.1.0(rollup@4.21.0)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.20.0 + rollup: 4.21.0 '@rollup/rollup-android-arm-eabi@4.20.0': optional: true + '@rollup/rollup-android-arm-eabi@4.21.0': + optional: true + '@rollup/rollup-android-arm64@4.20.0': optional: true + '@rollup/rollup-android-arm64@4.21.0': + optional: true + '@rollup/rollup-darwin-arm64@4.20.0': optional: true + '@rollup/rollup-darwin-arm64@4.21.0': + optional: true + '@rollup/rollup-darwin-x64@4.20.0': optional: true + '@rollup/rollup-darwin-x64@4.21.0': + optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.20.0': optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.21.0': + optional: true + '@rollup/rollup-linux-arm-musleabihf@4.20.0': optional: true + '@rollup/rollup-linux-arm-musleabihf@4.21.0': + optional: true + '@rollup/rollup-linux-arm64-gnu@4.20.0': optional: true + '@rollup/rollup-linux-arm64-gnu@4.21.0': + optional: true + '@rollup/rollup-linux-arm64-musl@4.20.0': optional: true + '@rollup/rollup-linux-arm64-musl@4.21.0': + optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.20.0': optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.21.0': + optional: true + '@rollup/rollup-linux-riscv64-gnu@4.20.0': optional: true + '@rollup/rollup-linux-riscv64-gnu@4.21.0': + optional: true + '@rollup/rollup-linux-s390x-gnu@4.20.0': optional: true + '@rollup/rollup-linux-s390x-gnu@4.21.0': + optional: true + '@rollup/rollup-linux-x64-gnu@4.20.0': optional: true + '@rollup/rollup-linux-x64-gnu@4.21.0': + optional: true + '@rollup/rollup-linux-x64-musl@4.20.0': optional: true + '@rollup/rollup-linux-x64-musl@4.21.0': + optional: true + '@rollup/rollup-win32-arm64-msvc@4.20.0': optional: true + '@rollup/rollup-win32-arm64-msvc@4.21.0': + optional: true + '@rollup/rollup-win32-ia32-msvc@4.20.0': optional: true + '@rollup/rollup-win32-ia32-msvc@4.21.0': + optional: true + '@rollup/rollup-win32-x64-msvc@4.20.0': optional: true - '@swc/core-darwin-arm64@1.7.10': + '@rollup/rollup-win32-x64-msvc@4.21.0': + optional: true + + '@swc/core-darwin-arm64@1.7.11': optional: true - '@swc/core-darwin-x64@1.7.10': + '@swc/core-darwin-x64@1.7.11': optional: true - '@swc/core-linux-arm-gnueabihf@1.7.10': + '@swc/core-linux-arm-gnueabihf@1.7.11': optional: true - '@swc/core-linux-arm64-gnu@1.7.10': + '@swc/core-linux-arm64-gnu@1.7.11': optional: true - '@swc/core-linux-arm64-musl@1.7.10': + '@swc/core-linux-arm64-musl@1.7.11': optional: true - '@swc/core-linux-x64-gnu@1.7.10': + '@swc/core-linux-x64-gnu@1.7.11': optional: true - '@swc/core-linux-x64-musl@1.7.10': + '@swc/core-linux-x64-musl@1.7.11': optional: true - '@swc/core-win32-arm64-msvc@1.7.10': + '@swc/core-win32-arm64-msvc@1.7.11': optional: true - '@swc/core-win32-ia32-msvc@1.7.10': + '@swc/core-win32-ia32-msvc@1.7.11': optional: true - '@swc/core-win32-x64-msvc@1.7.10': + '@swc/core-win32-x64-msvc@1.7.11': optional: true - '@swc/core@1.7.10': + '@swc/core@1.7.11': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.12 optionalDependencies: - '@swc/core-darwin-arm64': 1.7.10 - '@swc/core-darwin-x64': 1.7.10 - '@swc/core-linux-arm-gnueabihf': 1.7.10 - '@swc/core-linux-arm64-gnu': 1.7.10 - '@swc/core-linux-arm64-musl': 1.7.10 - '@swc/core-linux-x64-gnu': 1.7.10 - '@swc/core-linux-x64-musl': 1.7.10 - '@swc/core-win32-arm64-msvc': 1.7.10 - '@swc/core-win32-ia32-msvc': 1.7.10 - '@swc/core-win32-x64-msvc': 1.7.10 + '@swc/core-darwin-arm64': 1.7.11 + '@swc/core-darwin-x64': 1.7.11 + '@swc/core-linux-arm-gnueabihf': 1.7.11 + '@swc/core-linux-arm64-gnu': 1.7.11 + '@swc/core-linux-arm64-musl': 1.7.11 + '@swc/core-linux-x64-gnu': 1.7.11 + '@swc/core-linux-x64-musl': 1.7.11 + '@swc/core-win32-arm64-msvc': 1.7.11 + '@swc/core-win32-ia32-msvc': 1.7.11 + '@swc/core-win32-x64-msvc': 1.7.11 '@swc/counter@0.1.3': {} @@ -4712,10 +4845,10 @@ snapshots: es-module-lexer@1.5.4: {} - esbuild-plugin-polyfill-node@0.3.0(esbuild@0.23.0): + esbuild-plugin-polyfill-node@0.3.0(esbuild@0.23.1): dependencies: '@jspm/core': 2.0.1 - esbuild: 0.23.0 + esbuild: 0.23.1 import-meta-resolve: 3.1.1 esbuild@0.21.5: @@ -4744,32 +4877,32 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - esbuild@0.23.0: + esbuild@0.23.1: optionalDependencies: - '@esbuild/aix-ppc64': 0.23.0 - '@esbuild/android-arm': 0.23.0 - '@esbuild/android-arm64': 0.23.0 - '@esbuild/android-x64': 0.23.0 - '@esbuild/darwin-arm64': 0.23.0 - '@esbuild/darwin-x64': 0.23.0 - '@esbuild/freebsd-arm64': 0.23.0 - '@esbuild/freebsd-x64': 0.23.0 - '@esbuild/linux-arm': 0.23.0 - '@esbuild/linux-arm64': 0.23.0 - '@esbuild/linux-ia32': 0.23.0 - '@esbuild/linux-loong64': 0.23.0 - '@esbuild/linux-mips64el': 0.23.0 - '@esbuild/linux-ppc64': 0.23.0 - '@esbuild/linux-riscv64': 0.23.0 - '@esbuild/linux-s390x': 0.23.0 - '@esbuild/linux-x64': 0.23.0 - '@esbuild/netbsd-x64': 0.23.0 - '@esbuild/openbsd-arm64': 0.23.0 - '@esbuild/openbsd-x64': 0.23.0 - '@esbuild/sunos-x64': 0.23.0 - '@esbuild/win32-arm64': 0.23.0 - '@esbuild/win32-ia32': 0.23.0 - '@esbuild/win32-x64': 0.23.0 + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 escalade@3.1.2: {} @@ -5969,29 +6102,29 @@ snapshots: glob: 11.0.0 package-json-from-dist: 1.0.0 - rollup-plugin-dts@6.1.1(rollup@4.20.0)(typescript@5.5.4): + rollup-plugin-dts@6.1.1(rollup@4.21.0)(typescript@5.5.4): dependencies: magic-string: 0.30.11 - rollup: 4.20.0 + rollup: 4.21.0 typescript: 5.5.4 optionalDependencies: '@babel/code-frame': 7.24.7 - rollup-plugin-esbuild@6.1.1(esbuild@0.23.0)(rollup@4.20.0): + rollup-plugin-esbuild@6.1.1(esbuild@0.23.1)(rollup@4.21.0): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.20.0) + '@rollup/pluginutils': 5.1.0(rollup@4.21.0) debug: 4.3.6 es-module-lexer: 1.5.4 - esbuild: 0.23.0 + esbuild: 0.23.1 get-tsconfig: 4.7.6 - rollup: 4.20.0 + rollup: 4.21.0 transitivePeerDependencies: - supports-color - rollup-plugin-polyfill-node@0.13.0(rollup@4.20.0): + rollup-plugin-polyfill-node@0.13.0(rollup@4.21.0): dependencies: - '@rollup/plugin-inject': 5.0.5(rollup@4.20.0) - rollup: 4.20.0 + '@rollup/plugin-inject': 5.0.5(rollup@4.21.0) + rollup: 4.21.0 rollup@4.20.0: dependencies: @@ -6015,6 +6148,28 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.20.0 fsevents: 2.3.3 + rollup@4.21.0: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.21.0 + '@rollup/rollup-android-arm64': 4.21.0 + '@rollup/rollup-darwin-arm64': 4.21.0 + '@rollup/rollup-darwin-x64': 4.21.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.21.0 + '@rollup/rollup-linux-arm-musleabihf': 4.21.0 + '@rollup/rollup-linux-arm64-gnu': 4.21.0 + '@rollup/rollup-linux-arm64-musl': 4.21.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.21.0 + '@rollup/rollup-linux-riscv64-gnu': 4.21.0 + '@rollup/rollup-linux-s390x-gnu': 4.21.0 + '@rollup/rollup-linux-x64-gnu': 4.21.0 + '@rollup/rollup-linux-x64-musl': 4.21.0 + '@rollup/rollup-win32-arm64-msvc': 4.21.0 + '@rollup/rollup-win32-ia32-msvc': 4.21.0 + '@rollup/rollup-win32-x64-msvc': 4.21.0 + fsevents: 2.3.3 + rrweb-cssom@0.6.0: {} rrweb-cssom@0.7.1: {} @@ -6285,7 +6440,7 @@ snapshots: tsx@4.17.0: dependencies: - esbuild: 0.23.0 + esbuild: 0.23.1 get-tsconfig: 4.7.6 optionalDependencies: fsevents: 2.3.3 From 448c2396b975048d3359be45cded511ab3c2a58a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:34:10 +0800 Subject: [PATCH 051/210] chore(deps): update dependency postcss-selector-parser to ^6.1.2 (#11652) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/compiler-sfc/package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index c7a358a95..c228933b1 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -60,7 +60,7 @@ "merge-source-map": "^1.1.0", "minimatch": "~9.0.5", "postcss-modules": "^6.0.0", - "postcss-selector-parser": "^6.1.1", + "postcss-selector-parser": "^6.1.2", "pug": "^3.0.3", "sass": "^1.77.8" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3fc091562..e88daa6b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -330,8 +330,8 @@ importers: specifier: ^6.0.0 version: 6.0.0(postcss@8.4.41) postcss-selector-parser: - specifier: ^6.1.1 - version: 6.1.1 + specifier: ^6.1.2 + version: 6.1.2 pug: specifier: ^3.0.3 version: 3.0.3 @@ -2819,8 +2819,8 @@ packages: peerDependencies: postcss: ^8.0.0 - postcss-selector-parser@6.1.1: - resolution: {integrity: sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==} + postcss-selector-parser@6.1.2: + resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} postcss-value-parser@4.2.0: @@ -5845,13 +5845,13 @@ snapshots: dependencies: icss-utils: 5.1.0(postcss@8.4.41) postcss: 8.4.41 - postcss-selector-parser: 6.1.1 + postcss-selector-parser: 6.1.2 postcss-value-parser: 4.2.0 postcss-modules-scope@3.2.0(postcss@8.4.41): dependencies: postcss: 8.4.41 - postcss-selector-parser: 6.1.1 + postcss-selector-parser: 6.1.2 postcss-modules-values@4.0.0(postcss@8.4.41): dependencies: @@ -5870,7 +5870,7 @@ snapshots: postcss-modules-values: 4.0.0(postcss@8.4.41) string-hash: 1.1.3 - postcss-selector-parser@6.1.1: + postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 From 0e3d5cc15fed31f72fc146da95c047e59689745b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:34:21 +0800 Subject: [PATCH 052/210] chore(deps): update all non-major dependencies (#11654) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- pnpm-lock.yaml | 66 +++++++++++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 419529b04..c02b8f1ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "version": "3.5.0-beta.2", - "packageManager": "pnpm@9.7.0", + "packageManager": "pnpm@9.7.1", "type": "module", "scripts": { "dev": "node scripts/dev.js", @@ -68,7 +68,7 @@ "@rollup/plugin-replace": "5.0.4", "@swc/core": "^1.7.11", "@types/hash-sum": "^1.0.2", - "@types/node": "^20.14.15", + "@types/node": "^20.16.0", "@types/semver": "^7.5.8", "@types/serve-handler": "^6.1.4", "@vitest/coverage-istanbul": "^2.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e88daa6b8..9b204babf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ^1.0.2 version: 1.0.2 '@types/node': - specifier: ^20.14.15 - version: 20.14.15 + specifier: ^20.16.0 + version: 20.16.0 '@types/semver': specifier: ^7.5.8 version: 7.5.8 @@ -70,7 +70,7 @@ importers: version: 6.1.4 '@vitest/coverage-istanbul': specifier: ^2.0.5 - version: 2.0.5(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) + version: 2.0.5(vitest@2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -94,7 +94,7 @@ importers: version: 3.1.0(eslint@9.9.0)(typescript@5.5.4) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)) + version: 0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -178,10 +178,10 @@ importers: version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + version: 5.4.0(@types/node@20.16.0)(sass@1.77.8) vitest: specifier: ^2.0.5 - version: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) + version: 2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8) packages-private/dts-built-test: dependencies: @@ -221,10 +221,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.16.0)(sass@1.77.8))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + version: 5.4.0(@types/node@20.16.0)(sass@1.77.8) packages-private/template-explorer: dependencies: @@ -239,10 +239,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.16.0)(sass@1.77.8))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + version: 5.4.0(@types/node@20.16.0)(sass@1.77.8) vue: specifier: workspace:* version: link:../../packages/vue @@ -1207,8 +1207,8 @@ packages: '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} - '@types/node@20.14.15': - resolution: {integrity: sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==} + '@types/node@20.16.0': + resolution: {integrity: sha512-vDxceJcoZhIVh67S568bm1UGZO0DX0hpplJZxzeXMKwIPLn190ec5RRxQ69BKhX44SUGIxxgMdDY557lGLKprQ==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -3341,8 +3341,8 @@ packages: unbzip2-stream@1.4.3: resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.6: + resolution: {integrity: sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org==} unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} @@ -4134,9 +4134,9 @@ snapshots: '@types/hash-sum@1.0.2': {} - '@types/node@20.14.15': + '@types/node@20.16.0': dependencies: - undici-types: 5.26.5 + undici-types: 6.19.6 '@types/normalize-package-data@2.4.4': {} @@ -4146,13 +4146,13 @@ snapshots: '@types/serve-handler@6.1.4': dependencies: - '@types/node': 20.14.15 + '@types/node': 20.16.0 '@types/trusted-types@2.0.7': {} '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.15 + '@types/node': 20.16.0 optional: true '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': @@ -4274,12 +4274,12 @@ snapshots: '@typescript-eslint/types': 8.0.1 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.14.15)(sass@1.77.8))(vue@packages+vue)': + '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.16.0)(sass@1.77.8))(vue@packages+vue)': dependencies: - vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + vite: 5.4.0(@types/node@20.16.0)(sass@1.77.8) vue: link:packages/vue - '@vitest/coverage-istanbul@2.0.5(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8))': + '@vitest/coverage-istanbul@2.0.5(vitest@2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8))': dependencies: '@istanbuljs/schema': 0.1.3 debug: 4.3.6 @@ -4291,7 +4291,7 @@ snapshots: magicast: 0.3.4 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color @@ -4943,12 +4943,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8)): + eslint-plugin-vitest@0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8)): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) eslint: 9.9.0 optionalDependencies: - vitest: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8) + vitest: 2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8) transitivePeerDependencies: - supports-color - typescript @@ -6474,7 +6474,7 @@ snapshots: buffer: 5.7.1 through: 2.3.8 - undici-types@5.26.5: {} + undici-types@6.19.6: {} unicorn-magic@0.1.0: {} @@ -6513,13 +6513,13 @@ snapshots: vary@1.1.2: {} - vite-node@2.0.5(@types/node@20.14.15)(sass@1.77.8): + vite-node@2.0.5(@types/node@20.16.0)(sass@1.77.8): dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) + vite: 5.4.0(@types/node@20.16.0)(sass@1.77.8) transitivePeerDependencies: - '@types/node' - less @@ -6531,17 +6531,17 @@ snapshots: - supports-color - terser - vite@5.4.0(@types/node@20.14.15)(sass@1.77.8): + vite@5.4.0(@types/node@20.16.0)(sass@1.77.8): dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.20.0 optionalDependencies: - '@types/node': 20.14.15 + '@types/node': 20.16.0 fsevents: 2.3.3 sass: 1.77.8 - vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1)(sass@1.77.8): + vitest@2.0.5(@types/node@20.16.0)(jsdom@24.1.1)(sass@1.77.8): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -6559,11 +6559,11 @@ snapshots: tinybench: 2.9.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.14.15)(sass@1.77.8) - vite-node: 2.0.5(@types/node@20.14.15)(sass@1.77.8) + vite: 5.4.0(@types/node@20.16.0)(sass@1.77.8) + vite-node: 2.0.5(@types/node@20.16.0)(sass@1.77.8) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.15 + '@types/node': 20.16.0 jsdom: 24.1.1 transitivePeerDependencies: - less From c183405f9f58a6619ebc2ce9c653ce3726138a53 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:34:40 +0800 Subject: [PATCH 053/210] chore(deps): update lint (#11653) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- pnpm-lock.yaml | 114 ++++++++++++++++++++++++------------------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/package.json b/package.json index c02b8f1ab..3ed2ceea8 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "eslint-plugin-vitest": "^0.5.4", "estree-walker": "catalog:", "jsdom": "^24.1.1", - "lint-staged": "^15.2.8", + "lint-staged": "^15.2.9", "lodash": "^4.17.21", "magic-string": "^0.30.11", "markdown-table": "^3.0.3", @@ -106,7 +106,7 @@ "tslib": "^2.6.3", "tsx": "^4.17.0", "typescript": "~5.5.4", - "typescript-eslint": "^8.0.1", + "typescript-eslint": "^8.1.0", "vite": "catalog:", "vitest": "^2.0.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b204babf..361cbfd8b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -102,8 +102,8 @@ importers: specifier: ^24.1.1 version: 24.1.1 lint-staged: - specifier: ^15.2.8 - version: 15.2.8 + specifier: ^15.2.9 + version: 15.2.9 lodash: specifier: ^4.17.21 version: 4.17.21 @@ -174,8 +174,8 @@ importers: specifier: ~5.5.4 version: 5.5.4 typescript-eslint: - specifier: ^8.0.1 - version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(eslint@9.9.0)(typescript@5.5.4) vite: specifier: 'catalog:' version: 5.4.0(@types/node@20.16.0)(sass@1.77.8) @@ -1228,8 +1228,8 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@8.0.1': - resolution: {integrity: sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==} + '@typescript-eslint/eslint-plugin@8.1.0': + resolution: {integrity: sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -1239,8 +1239,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.0.1': - resolution: {integrity: sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==} + '@typescript-eslint/parser@8.1.0': + resolution: {integrity: sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1253,12 +1253,12 @@ packages: resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@8.0.1': - resolution: {integrity: sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==} + '@typescript-eslint/scope-manager@8.1.0': + resolution: {integrity: sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.0.1': - resolution: {integrity: sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==} + '@typescript-eslint/type-utils@8.1.0': + resolution: {integrity: sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1270,8 +1270,8 @@ packages: resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@8.0.1': - resolution: {integrity: sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==} + '@typescript-eslint/types@8.1.0': + resolution: {integrity: sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@7.18.0': @@ -1283,8 +1283,8 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@8.0.1': - resolution: {integrity: sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==} + '@typescript-eslint/typescript-estree@8.1.0': + resolution: {integrity: sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1298,8 +1298,8 @@ packages: peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/utils@8.0.1': - resolution: {integrity: sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==} + '@typescript-eslint/utils@8.1.0': + resolution: {integrity: sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1308,8 +1308,8 @@ packages: resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@8.0.1': - resolution: {integrity: sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==} + '@typescript-eslint/visitor-keys@8.1.0': + resolution: {integrity: sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitejs/plugin-vue@5.1.2': @@ -2465,8 +2465,8 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lint-staged@15.2.8: - resolution: {integrity: sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==} + lint-staged@15.2.9: + resolution: {integrity: sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==} engines: {node: '>=18.12.0'} hasBin: true @@ -3319,8 +3319,8 @@ packages: resolution: {integrity: sha512-spAaHzc6qre0TlZQQ2aA/nGMe+2Z/wyGk5Z+Ru2VUfdNwT6kWO6TjevOlpebsATEG1EIQ2sOiDszud3lO5mt/Q==} engines: {node: '>=16'} - typescript-eslint@8.0.1: - resolution: {integrity: sha512-V3Y+MdfhawxEjE16dWpb7/IOgeXnLwAEEkS7v8oDqNcR1oYlqWhGH/iHqHdKVdpWme1VPZ0SoywXAkCqawj2eQ==} + typescript-eslint@8.1.0: + resolution: {integrity: sha512-prB2U3jXPJLpo1iVLN338Lvolh6OrcCZO+9Yv6AR+tvegPPptYCDBIHiEEUdqRi8gAv2bXNKfMUrgAd2ejn/ow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -4155,14 +4155,14 @@ snapshots: '@types/node': 20.16.0 optional: true - '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.1.0(@typescript-eslint/parser@8.1.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/type-utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/parser': 8.1.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/type-utils': 8.1.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.1.0 eslint: 9.9.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -4173,12 +4173,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.1.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.1.0 debug: 4.3.6 eslint: 9.9.0 optionalDependencies: @@ -4191,15 +4191,15 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/scope-manager@8.0.1': + '@typescript-eslint/scope-manager@8.1.0': dependencies: - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/visitor-keys': 8.1.0 - '@typescript-eslint/type-utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.1.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@9.9.0)(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -4210,7 +4210,7 @@ snapshots: '@typescript-eslint/types@7.18.0': {} - '@typescript-eslint/types@8.0.1': {} + '@typescript-eslint/types@8.1.0': {} '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': dependencies: @@ -4227,10 +4227,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.0.1(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.1.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/visitor-keys': 8.1.0 debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 @@ -4253,12 +4253,12 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/utils@8.1.0(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) eslint: 9.9.0 transitivePeerDependencies: - supports-color @@ -4269,9 +4269,9 @@ snapshots: '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.0.1': + '@typescript-eslint/visitor-keys@8.1.0': dependencies: - '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/types': 8.1.0 eslint-visitor-keys: 3.4.3 '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.16.0)(sass@1.77.8))(vue@packages+vue)': @@ -4461,7 +4461,7 @@ snapshots: dependencies: ansi-align: 3.0.1 camelcase: 7.0.1 - chalk: 5.0.1 + chalk: 5.3.0 cli-boxes: 3.0.0 string-width: 5.1.2 type-fest: 2.19.0 @@ -5538,7 +5538,7 @@ snapshots: lines-and-columns@1.2.4: {} - lint-staged@15.2.8: + lint-staged@15.2.9: dependencies: chalk: 5.3.0 commander: 12.1.0 @@ -6453,11 +6453,11 @@ snapshots: type-fest@4.24.0: {} - typescript-eslint@8.0.1(eslint@9.9.0)(typescript@5.5.4): + typescript-eslint@8.1.0(eslint@9.9.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.1.0(@typescript-eslint/parser@8.1.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.1.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@9.9.0)(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: From 4b608a9449fcfaa9c6105c96573ed30b599d2800 Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Mon, 19 Aug 2024 03:49:59 +0100 Subject: [PATCH 054/210] refactor(scheduler): remove invalidateJob (#11650) Co-authored-by: Evan You --- .../__tests__/rendererComponent.spec.ts | 99 +++++++++++++++++++ .../runtime-core/__tests__/scheduler.spec.ts | 28 ------ packages/runtime-core/src/renderer.ts | 4 - packages/runtime-core/src/scheduler.ts | 7 -- 4 files changed, 99 insertions(+), 39 deletions(-) diff --git a/packages/runtime-core/__tests__/rendererComponent.spec.ts b/packages/runtime-core/__tests__/rendererComponent.spec.ts index c5faa05de..fefc41370 100644 --- a/packages/runtime-core/__tests__/rendererComponent.spec.ts +++ b/packages/runtime-core/__tests__/rendererComponent.spec.ts @@ -236,6 +236,105 @@ describe('renderer: component', () => { expect(serializeInner(root)).toBe(`

1
1
`) }) + test('child only updates once when triggered in multiple ways', async () => { + const a = ref(0) + const calls: string[] = [] + + const Parent = { + setup() { + return () => { + calls.push('render parent') + return h(Child, { count: a.value }, () => a.value) + } + }, + } + + const Child = { + props: ['count'], + setup(props: any) { + return () => { + calls.push('render child') + return `${props.count} - ${a.value}` + } + }, + } + + render(h(Parent), nodeOps.createElement('div')) + expect(calls).toEqual(['render parent', 'render child']) + + // This will trigger child rendering directly, as well as via a prop change + a.value++ + await nextTick() + expect(calls).toEqual([ + 'render parent', + 'render child', + 'render parent', + 'render child', + ]) + }) + + // #7745 + test(`an earlier update doesn't lead to excessive subsequent updates`, async () => { + const globalCount = ref(0) + const parentCount = ref(0) + const calls: string[] = [] + + const Root = { + setup() { + return () => { + calls.push('render root') + return h(Parent, { count: globalCount.value }) + } + }, + } + + const Parent = { + props: ['count'], + setup(props: any) { + return () => { + calls.push('render parent') + return [ + `${globalCount.value} - ${props.count}`, + h(Child, { count: parentCount.value }), + ] + } + }, + } + + const Child = { + props: ['count'], + setup(props: any) { + watch( + () => props.count, + () => { + calls.push('child watcher') + globalCount.value = props.count + }, + ) + + return () => { + calls.push('render child') + } + }, + } + + render(h(Root), nodeOps.createElement('div')) + expect(calls).toEqual(['render root', 'render parent', 'render child']) + + parentCount.value++ + await nextTick() + expect(calls).toEqual([ + 'render root', + 'render parent', + 'render child', + 'render parent', + 'child watcher', + 'render child', + 'render root', + 'render parent', + ]) + }) + // #2521 test('should pause tracking deps when initializing legacy options', async () => { let childInstance = null as any diff --git a/packages/runtime-core/__tests__/scheduler.spec.ts b/packages/runtime-core/__tests__/scheduler.spec.ts index 8d74330da..5c5b04673 100644 --- a/packages/runtime-core/__tests__/scheduler.spec.ts +++ b/packages/runtime-core/__tests__/scheduler.spec.ts @@ -3,7 +3,6 @@ import { SchedulerJobFlags, flushPostFlushCbs, flushPreFlushCbs, - invalidateJob, nextTick, queueJob, queuePostFlushCb, @@ -444,33 +443,6 @@ describe('scheduler', () => { }) }) - test('invalidateJob', async () => { - const calls: string[] = [] - const job1 = () => { - calls.push('job1') - invalidateJob(job2) - job2() - } - const job2 = () => { - calls.push('job2') - } - const job3 = () => { - calls.push('job3') - } - const job4 = () => { - calls.push('job4') - } - // queue all jobs - queueJob(job1) - queueJob(job2) - queueJob(job3) - queuePostFlushCb(job4) - expect(calls).toEqual([]) - await nextTick() - // job2 should be called only once - expect(calls).toEqual(['job1', 'job2', 'job3', 'job4']) - }) - test('sort job based on id', async () => { const calls: string[] = [] const job1 = () => calls.push('job1') diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 3d1cc6849..ce0639895 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -45,7 +45,6 @@ import { type SchedulerJobs, flushPostFlushCbs, flushPreFlushCbs, - invalidateJob, queueJob, queuePostFlushCb, } from './scheduler' @@ -1255,9 +1254,6 @@ function baseCreateRenderer( } else { // normal update instance.next = n2 - // in case the child component is also queued, remove it to avoid - // double updating the same child component in the same flush. - invalidateJob(instance.update) // instance.update is the reactive effect. instance.update() } diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 256ab2027..aa12b6896 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -122,13 +122,6 @@ function queueFlush() { } } -export function invalidateJob(job: SchedulerJob): void { - const i = queue.indexOf(job) - if (i > flushIndex) { - queue.splice(i, 1) - } -} - export function queuePostFlushCb(cb: SchedulerJobs): void { if (!isArray(cb)) { if (activePostFlushCbs && cb.id === -1) { From ac2a410e46392db63ca4ed2db3c0fa71ebe1e855 Mon Sep 17 00:00:00 2001 From: edison Date: Mon, 19 Aug 2024 16:19:24 +0800 Subject: [PATCH 055/210] fix(runtime-core): ensure suspense content inherit scopeId (#10652) close #5148 --- .../runtime-core/__tests__/scopeId.spec.ts | 44 +++++++++++++++++++ packages/runtime-core/src/renderer.ts | 7 ++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/scopeId.spec.ts b/packages/runtime-core/__tests__/scopeId.spec.ts index 08753e023..d9a7d4dbf 100644 --- a/packages/runtime-core/__tests__/scopeId.spec.ts +++ b/packages/runtime-core/__tests__/scopeId.spec.ts @@ -1,5 +1,6 @@ import { Fragment, + Suspense, createBlock, createCommentVNode, createVNode, @@ -47,6 +48,49 @@ describe('scopeId runtime support', () => { ) }) + // #5148 + test('should attach scopeId to suspense content', async () => { + const deps: Promise[] = [] + const Child = { + async setup() { + const p = new Promise(r => setTimeout(r, 1)) + deps.push(p.then(() => Promise.resolve())) + + await p + return () => h('div', 'async') + }, + } + + const Wrapper = { + setup(_: any, { slots }: any) { + return () => slots.default({ Component: h(Child) }) + }, + } + + const App = { + __scopeId: 'parent', + setup() { + return () => + h(Wrapper, null, { + default: withCtx(({ Component }: any) => + h(Suspense, null, { + default: h(Component), + fallback: h('div', 'fallback'), + }), + ), + }) + }, + } + + const root = nodeOps.createElement('div') + render(h(App), root) + expect(serializeInner(root)).toBe(`
fallback
`) + + await Promise.all(deps) + await nextTick() + expect(serializeInner(root)).toBe(`
async
`) + }) + // :slotted basic test('should work on slots', () => { const Child = { diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index ce0639895..11736e9df 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -62,6 +62,7 @@ import { setRef } from './rendererTemplateRef' import { type SuspenseBoundary, type SuspenseImpl, + isSuspense, queueEffectWithSuspense, } from './components/Suspense' import { @@ -749,7 +750,11 @@ function baseCreateRenderer( subTree = filterSingleRoot(subTree.children as VNodeArrayChildren) || subTree } - if (vnode === subTree) { + if ( + vnode === subTree || + (isSuspense(subTree.type) && + (subTree.ssContent === vnode || subTree.ssFallback === vnode)) + ) { const parentVNode = parentComponent.vnode setScopeId( el, From 98b83e86d16c635547a1e735e5fb675aea2f0f1b Mon Sep 17 00:00:00 2001 From: edison Date: Mon, 19 Aug 2024 16:22:05 +0800 Subject: [PATCH 056/210] fix(ssr): apply ssr props to the the fallback vnode-based branch in ssr (#7247) close #6123 --- .../__tests__/ssrDynamicComponent.spec.ts | 19 ++++++++++++++++++- packages/server-renderer/src/render.ts | 12 ++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/server-renderer/__tests__/ssrDynamicComponent.spec.ts b/packages/server-renderer/__tests__/ssrDynamicComponent.spec.ts index caeb88397..0679c8216 100644 --- a/packages/server-renderer/__tests__/ssrDynamicComponent.spec.ts +++ b/packages/server-renderer/__tests__/ssrDynamicComponent.spec.ts @@ -1,5 +1,5 @@ import { createApp, createVNode } from 'vue' -import { renderToString } from '../src/renderToString' +import { renderToString } from '../src' describe('ssr: dynamic component', () => { test('resolved to component', async () => { @@ -17,6 +17,23 @@ describe('ssr: dynamic component', () => { ).toBe(`
slot
`) }) + test('resolved to component with v-show', async () => { + expect( + await renderToString( + createApp({ + components: { + one: { + template: ``, + }, + }, + template: `hi`, + }), + ), + ).toBe( + `
hi
`, + ) + }) + test('resolve to element', async () => { expect( await renderToString( diff --git a/packages/server-renderer/src/render.ts b/packages/server-renderer/src/render.ts index be51da1b8..4744940e8 100644 --- a/packages/server-renderer/src/render.ts +++ b/packages/server-renderer/src/render.ts @@ -217,7 +217,11 @@ export function renderVNode( parentComponent: ComponentInternalInstance, slotScopeId?: string, ): void { - const { type, shapeFlag, children } = vnode + const { type, shapeFlag, children, dirs, props } = vnode + if (dirs) { + vnode.props = applySSRDirectives(vnode, props, dirs) + } + switch (type) { case Text: push(escapeHtml(children as string)) @@ -283,13 +287,9 @@ function renderElementVNode( slotScopeId?: string, ) { const tag = vnode.type as string - let { props, children, shapeFlag, scopeId, dirs } = vnode + let { props, children, shapeFlag, scopeId } = vnode let openTag = `<${tag}` - if (dirs) { - props = applySSRDirectives(vnode, props, dirs) - } - if (props) { openTag += ssrRenderAttrs(props, tag) } From bb6babca8f206615d4e246457cd54d21bb3bc5a4 Mon Sep 17 00:00:00 2001 From: zhangenming <282126346@qq.com> Date: Mon, 19 Aug 2024 16:25:01 +0800 Subject: [PATCH 057/210] perf( runtime-core): use `apply` to avoid spreading. (#5985) --- packages/runtime-core/src/compat/global.ts | 6 ++---- packages/runtime-core/src/compat/instanceEventEmitter.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/runtime-core/src/compat/global.ts b/packages/runtime-core/src/compat/global.ts index 5356ce790..edc57436a 100644 --- a/packages/runtime-core/src/compat/global.ts +++ b/packages/runtime-core/src/compat/global.ts @@ -622,11 +622,9 @@ function defineReactive(obj: any, key: string, val: any) { if (isObject(val) && !isReactive(val) && !patched.has(val)) { const reactiveVal = reactive(val) if (isArray(val)) { - methodsToPatch.forEach(m => { - // @ts-expect-error + methodsToPatch.forEach((m: any) => { val[m] = (...args: any[]) => { - // @ts-expect-error - Array.prototype[m].call(reactiveVal, ...args) + Array.prototype[m].apply(reactiveVal, args) } }) } else { diff --git a/packages/runtime-core/src/compat/instanceEventEmitter.ts b/packages/runtime-core/src/compat/instanceEventEmitter.ts index 630df1cfe..cdf2d7988 100644 --- a/packages/runtime-core/src/compat/instanceEventEmitter.ts +++ b/packages/runtime-core/src/compat/instanceEventEmitter.ts @@ -53,7 +53,7 @@ export function once( ): ComponentPublicInstance | null { const wrapped = (...args: any[]) => { off(instance, event, wrapped) - fn.call(instance.proxy, ...args) + fn.apply(instance.proxy, args) } wrapped.fn = fn on(instance, event, wrapped) From 44973bb3e790db7d8aa7af4eda21c80cac73a8de Mon Sep 17 00:00:00 2001 From: yangxiuxiu <79584569+yangxiuxiu1115@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:29:43 +0800 Subject: [PATCH 058/210] fix(types): strip non-prop default values from return type of withDefaults (#9998) close #9899 --- packages-private/dts-test/setupHelpers.test-d.ts | 13 +++++++++++++ packages/runtime-core/src/apiSetupHelpers.ts | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages-private/dts-test/setupHelpers.test-d.ts b/packages-private/dts-test/setupHelpers.test-d.ts index 28b3c01cd..64c944e0b 100644 --- a/packages-private/dts-test/setupHelpers.test-d.ts +++ b/packages-private/dts-test/setupHelpers.test-d.ts @@ -227,6 +227,19 @@ describe('withDefaults w/ boolean type', () => { expectType(res2.bool) }) +describe('withDefaults w/ defineProp type is different from the defaults type', () => { + const res1 = withDefaults( + defineProps<{ + bool?: boolean + }>(), + { bool: false, value: false }, + ) + expectType(res1.bool) + + // @ts-expect-error + res1.value +}) + describe('defineProps w/ runtime declaration', () => { // runtime declaration const props = defineProps({ diff --git a/packages/runtime-core/src/apiSetupHelpers.ts b/packages/runtime-core/src/apiSetupHelpers.ts index 7915fa3fd..90bde3aeb 100644 --- a/packages/runtime-core/src/apiSetupHelpers.ts +++ b/packages/runtime-core/src/apiSetupHelpers.ts @@ -328,7 +328,9 @@ type PropsWithDefaults< Defaults extends InferDefaults, BKeys extends keyof T, > = Readonly> & { - readonly [K in keyof Defaults]-?: K extends keyof T + readonly [K in keyof Defaults as K extends keyof T + ? K + : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny, T[K]> : NotUndefined From 205e5b5e277243c3af2c937d9bd46cf671296b72 Mon Sep 17 00:00:00 2001 From: Rizumu Ayaka Date: Tue, 20 Aug 2024 08:21:44 +0800 Subject: [PATCH 059/210] feat(reactivity): base `watch`, `getCurrentWatcher`, and `onWatcherCleanup` (#9927) --- packages/reactivity/__tests__/watch.spec.ts | 196 ++++++++++ packages/reactivity/src/index.ts | 11 + packages/reactivity/src/watch.ts | 368 ++++++++++++++++++ .../runtime-core/__tests__/apiWatch.spec.ts | 30 ++ packages/runtime-core/src/apiWatch.ts | 349 +++-------------- packages/runtime-core/src/componentOptions.ts | 66 +++- packages/runtime-core/src/directives.ts | 3 +- packages/runtime-core/src/errorHandling.ts | 22 +- packages/runtime-core/src/index.ts | 2 + 9 files changed, 723 insertions(+), 324 deletions(-) create mode 100644 packages/reactivity/__tests__/watch.spec.ts create mode 100644 packages/reactivity/src/watch.ts diff --git a/packages/reactivity/__tests__/watch.spec.ts b/packages/reactivity/__tests__/watch.spec.ts new file mode 100644 index 000000000..7a4078166 --- /dev/null +++ b/packages/reactivity/__tests__/watch.spec.ts @@ -0,0 +1,196 @@ +import { + EffectScope, + type Ref, + WatchErrorCodes, + type WatchOptions, + type WatchScheduler, + onWatcherCleanup, + ref, + watch, +} from '../src' + +const queue: (() => void)[] = [] + +// a simple scheduler for testing purposes +let isFlushPending = false +const resolvedPromise = /*#__PURE__*/ Promise.resolve() as Promise +const nextTick = (fn?: () => any) => + fn ? resolvedPromise.then(fn) : resolvedPromise + +const scheduler: WatchScheduler = (job, isFirstRun) => { + if (isFirstRun) { + job() + } else { + queue.push(job) + flushJobs() + } +} + +const flushJobs = () => { + if (isFlushPending) return + isFlushPending = true + resolvedPromise.then(() => { + queue.forEach(job => job()) + queue.length = 0 + isFlushPending = false + }) +} + +describe('watch', () => { + test('effect', () => { + let dummy: any + const source = ref(0) + watch(() => { + dummy = source.value + }) + expect(dummy).toBe(0) + source.value++ + expect(dummy).toBe(1) + }) + + test('with callback', () => { + let dummy: any + const source = ref(0) + watch(source, () => { + dummy = source.value + }) + expect(dummy).toBe(undefined) + source.value++ + expect(dummy).toBe(1) + }) + + test('call option with error handling', () => { + const onError = vi.fn() + const call: WatchOptions['call'] = function call(fn, type, args) { + if (Array.isArray(fn)) { + fn.forEach(f => call(f, type, args)) + return + } + try { + fn.apply(null, args) + } catch (e) { + onError(e, type) + } + } + + watch( + () => { + throw 'oops in effect' + }, + null, + { call }, + ) + + const source = ref(0) + const effect = watch( + source, + () => { + onWatcherCleanup(() => { + throw 'oops in cleanup' + }) + throw 'oops in watch' + }, + { call }, + ) + + expect(onError.mock.calls.length).toBe(1) + expect(onError.mock.calls[0]).toMatchObject([ + 'oops in effect', + WatchErrorCodes.WATCH_CALLBACK, + ]) + + source.value++ + expect(onError.mock.calls.length).toBe(2) + expect(onError.mock.calls[1]).toMatchObject([ + 'oops in watch', + WatchErrorCodes.WATCH_CALLBACK, + ]) + + effect!.stop() + source.value++ + expect(onError.mock.calls.length).toBe(3) + expect(onError.mock.calls[2]).toMatchObject([ + 'oops in cleanup', + WatchErrorCodes.WATCH_CLEANUP, + ]) + }) + + test('watch with onWatcherCleanup', async () => { + let dummy = 0 + let source: Ref + const scope = new EffectScope() + + scope.run(() => { + source = ref(0) + watch(onCleanup => { + source.value + + onCleanup(() => (dummy += 2)) + onWatcherCleanup(() => (dummy += 3)) + onWatcherCleanup(() => (dummy += 5)) + }) + }) + expect(dummy).toBe(0) + + scope.run(() => { + source.value++ + }) + expect(dummy).toBe(10) + + scope.run(() => { + source.value++ + }) + expect(dummy).toBe(20) + + scope.stop() + expect(dummy).toBe(30) + }) + + test('nested calls to baseWatch and onWatcherCleanup', async () => { + let calls: string[] = [] + let source: Ref + let copyist: Ref + const scope = new EffectScope() + + scope.run(() => { + source = ref(0) + copyist = ref(0) + // sync by default + watch( + () => { + const current = (copyist.value = source.value) + onWatcherCleanup(() => calls.push(`sync ${current}`)) + }, + null, + {}, + ) + // with scheduler + watch( + () => { + const current = copyist.value + onWatcherCleanup(() => calls.push(`post ${current}`)) + }, + null, + { scheduler }, + ) + }) + + await nextTick() + expect(calls).toEqual([]) + + scope.run(() => source.value++) + expect(calls).toEqual(['sync 0']) + await nextTick() + expect(calls).toEqual(['sync 0', 'post 0']) + calls.length = 0 + + scope.run(() => source.value++) + expect(calls).toEqual(['sync 1']) + await nextTick() + expect(calls).toEqual(['sync 1', 'post 1']) + calls.length = 0 + + scope.stop() + expect(calls).toEqual(['sync 2', 'post 2']) + }) +}) diff --git a/packages/reactivity/src/index.ts b/packages/reactivity/src/index.ts index b320f1f8c..47302b224 100644 --- a/packages/reactivity/src/index.ts +++ b/packages/reactivity/src/index.ts @@ -80,3 +80,14 @@ export { } from './effectScope' export { reactiveReadArray, shallowReadArray } from './arrayInstrumentations' export { TrackOpTypes, TriggerOpTypes, ReactiveFlags } from './constants' +export { + watch, + getCurrentWatcher, + traverse, + onWatcherCleanup, + WatchErrorCodes, + type WatchOptions, + type WatchScheduler, + type WatchStopHandle, + type WatchHandle, +} from './watch' diff --git a/packages/reactivity/src/watch.ts b/packages/reactivity/src/watch.ts new file mode 100644 index 000000000..2104896b7 --- /dev/null +++ b/packages/reactivity/src/watch.ts @@ -0,0 +1,368 @@ +import { + EMPTY_OBJ, + NOOP, + hasChanged, + isArray, + isFunction, + isMap, + isObject, + isPlainObject, + isSet, + remove, +} from '@vue/shared' +import { warn } from './warning' +import type { ComputedRef } from './computed' +import { ReactiveFlags } from './constants' +import { + type DebuggerOptions, + EffectFlags, + type EffectScheduler, + ReactiveEffect, + pauseTracking, + resetTracking, +} from './effect' +import { isReactive, isShallow } from './reactive' +import { type Ref, isRef } from './ref' +import { getCurrentScope } from './effectScope' + +// These errors were transferred from `packages/runtime-core/src/errorHandling.ts` +// to @vue/reactivity to allow co-location with the moved base watch logic, hence +// it is essential to keep these values unchanged. +export enum WatchErrorCodes { + WATCH_GETTER = 2, + WATCH_CALLBACK, + WATCH_CLEANUP, +} + +type WatchEffect = (onCleanup: OnCleanup) => void +type WatchSource = Ref | ComputedRef | (() => T) +type WatchCallback = ( + value: V, + oldValue: OV, + onCleanup: OnCleanup, +) => any +type OnCleanup = (cleanupFn: () => void) => void + +export interface WatchOptions extends DebuggerOptions { + immediate?: Immediate + deep?: boolean | number + once?: boolean + scheduler?: WatchScheduler + onWarn?: (msg: string, ...args: any[]) => void + /** + * @internal + */ + augmentJob?: (job: (...args: any[]) => void) => void + /** + * @internal + */ + call?: ( + fn: Function | Function[], + type: WatchErrorCodes, + args?: unknown[], + ) => void +} + +export type WatchStopHandle = () => void + +export interface WatchHandle extends WatchStopHandle { + pause: () => void + resume: () => void + stop: () => void +} + +// initial value for watchers to trigger on undefined initial values +const INITIAL_WATCHER_VALUE = {} + +export type WatchScheduler = (job: () => void, isFirstRun: boolean) => void + +const cleanupMap: WeakMap void)[]> = new WeakMap() +let activeWatcher: ReactiveEffect | undefined = undefined + +/** + * Returns the current active effect if there is one. + */ +export function getCurrentWatcher(): ReactiveEffect | undefined { + return activeWatcher +} + +/** + * Registers a cleanup callback on the current active effect. This + * registered cleanup callback will be invoked right before the + * associated effect re-runs. + * + * @param cleanupFn - The callback function to attach to the effect's cleanup. + */ +export function onWatcherCleanup( + cleanupFn: () => void, + failSilently = false, + owner: ReactiveEffect | undefined = activeWatcher, +): void { + if (owner) { + let cleanups = cleanupMap.get(owner) + if (!cleanups) cleanupMap.set(owner, (cleanups = [])) + cleanups.push(cleanupFn) + } else if (__DEV__ && !failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher` + + ` to associate with.`, + ) + } +} + +export function watch( + source: WatchSource | WatchSource[] | WatchEffect | object, + cb?: WatchCallback | null, + options: WatchOptions = EMPTY_OBJ, +): WatchHandle { + const { immediate, deep, once, scheduler, augmentJob, call } = options + + const warnInvalidSource = (s: unknown) => { + ;(options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, ` + + `a reactive object, or an array of these types.`, + ) + } + + const reactiveGetter = (source: object) => { + // traverse will happen in wrapped getter below + if (deep) return source + // for `deep: false | 0` or shallow reactive, only traverse root-level properties + if (isShallow(source) || deep === false || deep === 0) + return traverse(source, 1) + // for `deep: undefined` on a reactive object, deeply traverse all properties + return traverse(source) + } + + let effect: ReactiveEffect + let getter: () => any + let cleanup: (() => void) | undefined + let boundCleanup: typeof onWatcherCleanup + let forceTrigger = false + let isMultiSource = false + + if (isRef(source)) { + getter = () => source.value + forceTrigger = isShallow(source) + } else if (isReactive(source)) { + getter = () => reactiveGetter(source) + forceTrigger = true + } else if (isArray(source)) { + isMultiSource = true + forceTrigger = source.some(s => isReactive(s) || isShallow(s)) + getter = () => + source.map(s => { + if (isRef(s)) { + return s.value + } else if (isReactive(s)) { + return reactiveGetter(s) + } else if (isFunction(s)) { + return call ? call(s, WatchErrorCodes.WATCH_GETTER) : s() + } else { + __DEV__ && warnInvalidSource(s) + } + }) + } else if (isFunction(source)) { + if (cb) { + // getter with cb + getter = call + ? () => call(source, WatchErrorCodes.WATCH_GETTER) + : (source as () => any) + } else { + // no cb -> simple effect + getter = () => { + if (cleanup) { + pauseTracking() + try { + cleanup() + } finally { + resetTracking() + } + } + const currentEffect = activeWatcher + activeWatcher = effect + try { + return call + ? call(source, WatchErrorCodes.WATCH_CALLBACK, [boundCleanup]) + : source(boundCleanup) + } finally { + activeWatcher = currentEffect + } + } + } + } else { + getter = NOOP + __DEV__ && warnInvalidSource(source) + } + + if (cb && deep) { + const baseGetter = getter + const depth = deep === true ? Infinity : deep + getter = () => traverse(baseGetter(), depth) + } + + if (once) { + if (cb) { + const _cb = cb + cb = (...args) => { + _cb(...args) + effect.stop() + } + } else { + const _getter = getter + getter = () => { + _getter() + effect.stop() + } + } + } + + let oldValue: any = isMultiSource + ? new Array((source as []).length).fill(INITIAL_WATCHER_VALUE) + : INITIAL_WATCHER_VALUE + + const job = (immediateFirstRun?: boolean) => { + if ( + !(effect.flags & EffectFlags.ACTIVE) || + (!effect.dirty && !immediateFirstRun) + ) { + return + } + if (cb) { + // watch(source, cb) + const newValue = effect.run() + if ( + deep || + forceTrigger || + (isMultiSource + ? (newValue as any[]).some((v, i) => hasChanged(v, oldValue[i])) + : hasChanged(newValue, oldValue)) + ) { + // cleanup before running cb again + if (cleanup) { + cleanup() + } + const currentWatcher = activeWatcher + activeWatcher = effect + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE + ? undefined + : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE + ? [] + : oldValue, + boundCleanup, + ] + call + ? call(cb!, WatchErrorCodes.WATCH_CALLBACK, args) + : // @ts-expect-error + cb!(...args) + oldValue = newValue + } finally { + activeWatcher = currentWatcher + } + } + } else { + // watchEffect + effect.run() + } + } + + if (augmentJob) { + augmentJob(job) + } + + effect = new ReactiveEffect(getter) + + effect.scheduler = scheduler + ? () => scheduler(job, false) + : (job as EffectScheduler) + + boundCleanup = fn => onWatcherCleanup(fn, false, effect) + + cleanup = effect.onStop = () => { + const cleanups = cleanupMap.get(effect) + if (cleanups) { + if (call) { + call(cleanups, WatchErrorCodes.WATCH_CLEANUP) + } else { + for (const cleanup of cleanups) cleanup() + } + cleanupMap.delete(effect) + } + } + + if (__DEV__) { + effect.onTrack = options.onTrack + effect.onTrigger = options.onTrigger + } + + // initial run + if (cb) { + if (immediate) { + job(true) + } else { + oldValue = effect.run() + } + } else if (scheduler) { + scheduler(job.bind(null, true), true) + } else { + effect.run() + } + + const scope = getCurrentScope() + const watchHandle: WatchHandle = () => { + effect.stop() + if (scope) { + remove(scope.effects, effect) + } + } + + watchHandle.pause = effect.pause.bind(effect) + watchHandle.resume = effect.resume.bind(effect) + watchHandle.stop = watchHandle + + return watchHandle +} + +export function traverse( + value: unknown, + depth: number = Infinity, + seen?: Set, +): unknown { + if (depth <= 0 || !isObject(value) || (value as any)[ReactiveFlags.SKIP]) { + return value + } + + seen = seen || new Set() + if (seen.has(value)) { + return value + } + seen.add(value) + depth-- + if (isRef(value)) { + traverse(value.value, depth, seen) + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen) + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v: any) => { + traverse(v, depth, seen) + }) + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen) + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key as any], depth, seen) + } + } + } + return value +} diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index 67f0bc160..b1eb85f8a 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -6,6 +6,7 @@ import { getCurrentInstance, nextTick, onErrorCaptured, + onWatcherCleanup, reactive, ref, watch, @@ -435,6 +436,35 @@ describe('api: watch', () => { expect(cleanup).toHaveBeenCalledTimes(2) }) + it('onWatcherCleanup', async () => { + const count = ref(0) + const cleanupEffect = vi.fn() + const cleanupWatch = vi.fn() + + const stopEffect = watchEffect(() => { + onWatcherCleanup(cleanupEffect) + count.value + }) + const stopWatch = watch(count, () => { + onWatcherCleanup(cleanupWatch) + }) + + count.value++ + await nextTick() + expect(cleanupEffect).toHaveBeenCalledTimes(1) + expect(cleanupWatch).toHaveBeenCalledTimes(0) + + count.value++ + await nextTick() + expect(cleanupEffect).toHaveBeenCalledTimes(2) + expect(cleanupWatch).toHaveBeenCalledTimes(1) + + stopEffect() + expect(cleanupEffect).toHaveBeenCalledTimes(3) + stopWatch() + expect(cleanupWatch).toHaveBeenCalledTimes(2) + }) + it('flush timing: pre (default)', async () => { const count = ref(0) const count2 = ref(0) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 35b488052..3304f2c75 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -1,50 +1,28 @@ import { + type WatchOptions as BaseWatchOptions, type ComputedRef, type DebuggerOptions, - EffectFlags, - type EffectScheduler, - ReactiveEffect, - ReactiveFlags, type ReactiveMarker, type Ref, - getCurrentScope, - isReactive, - isRef, - isShallow, + type WatchHandle, + watch as baseWatch, } from '@vue/reactivity' import { type SchedulerJob, SchedulerJobFlags, queueJob } from './scheduler' -import { - EMPTY_OBJ, - NOOP, - extend, - hasChanged, - isArray, - isFunction, - isMap, - isObject, - isPlainObject, - isSet, - isString, - remove, -} from '@vue/shared' +import { EMPTY_OBJ, NOOP, extend, isFunction, isString } from '@vue/shared' import { type ComponentInternalInstance, currentInstance, isInSSRComponentSetup, setCurrentInstance, } from './component' -import { - ErrorCodes, - callWithAsyncErrorHandling, - callWithErrorHandling, -} from './errorHandling' +import { callWithAsyncErrorHandling } from './errorHandling' import { queuePostRenderEffect } from './renderer' import { warn } from './warning' -import { DeprecationTypes } from './compat/compatConfig' -import { checkCompatEnabled, isCompatEnabled } from './compat/compatConfig' import type { ObjectWatchOptionItem } from './componentOptions' import { useSSRContext } from './helpers/useSsrContext' +export type { WatchHandle, WatchStopHandle } from '@vue/reactivity' + export type WatchEffect = (onCleanup: OnCleanup) => void export type WatchSource = Ref | ComputedRef | (() => T) @@ -77,14 +55,6 @@ export interface WatchOptions extends WatchOptionsBase { once?: boolean } -export type WatchStopHandle = () => void - -export interface WatchHandle extends WatchStopHandle { - pause: () => void - resume: () => void - stop: () => void -} - // Simple effect. export function watchEffect( effect: WatchEffect, @@ -96,7 +66,7 @@ export function watchEffect( export function watchPostEffect( effect: WatchEffect, options?: DebuggerOptions, -): WatchStopHandle { +): WatchHandle { return doWatch( effect, null, @@ -107,7 +77,7 @@ export function watchPostEffect( export function watchSyncEffect( effect: WatchEffect, options?: DebuggerOptions, -): WatchStopHandle { +): WatchHandle { return doWatch( effect, null, @@ -115,9 +85,6 @@ export function watchSyncEffect( ) } -// initial value for watchers to trigger on undefined initial values -const INITIAL_WATCHER_VALUE = {} - export type MultiWatchSources = (WatchSource | object)[] // overload: single source + cb @@ -178,22 +145,9 @@ export function watch = false>( function doWatch( source: WatchSource | WatchSource[] | WatchEffect | object, cb: WatchCallback | null, - { - immediate, - deep, - flush, - once, - onTrack, - onTrigger, - }: WatchOptions = EMPTY_OBJ, + options: WatchOptions = EMPTY_OBJ, ): WatchHandle { - if (cb && once) { - const _cb = cb - cb = (...args) => { - _cb(...args) - watchHandle() - } - } + const { immediate, deep, flush, once } = options if (__DEV__ && !cb) { if (immediate !== undefined) { @@ -216,230 +170,65 @@ function doWatch( } } - const warnInvalidSource = (s: unknown) => { - warn( - `Invalid watch source: `, - s, - `A watch source can only be a getter/effect function, a ref, ` + - `a reactive object, or an array of these types.`, - ) - } - - const instance = currentInstance - const reactiveGetter = (source: object) => { - // traverse will happen in wrapped getter below - if (deep) return source - // for `deep: false | 0` or shallow reactive, only traverse root-level properties - if (isShallow(source) || deep === false || deep === 0) - return traverse(source, 1) - // for `deep: undefined` on a reactive object, deeply traverse all properties - return traverse(source) - } - - let getter: () => any - let forceTrigger = false - let isMultiSource = false - - if (isRef(source)) { - getter = () => source.value - forceTrigger = isShallow(source) - } else if (isReactive(source)) { - getter = () => reactiveGetter(source) - forceTrigger = true - } else if (isArray(source)) { - isMultiSource = true - forceTrigger = source.some(s => isReactive(s) || isShallow(s)) - getter = () => - source.map(s => { - if (isRef(s)) { - return s.value - } else if (isReactive(s)) { - return reactiveGetter(s) - } else if (isFunction(s)) { - return callWithErrorHandling(s, instance, ErrorCodes.WATCH_GETTER) - } else { - __DEV__ && warnInvalidSource(s) - } - }) - } else if (isFunction(source)) { - if (cb) { - // getter with cb - getter = () => - callWithErrorHandling(source, instance, ErrorCodes.WATCH_GETTER) - } else { - // no cb -> simple effect - getter = () => { - if (cleanup) { - cleanup() - } - return callWithAsyncErrorHandling( - source, - instance, - ErrorCodes.WATCH_CALLBACK, - [onCleanup], - ) - } - } - } else { - getter = NOOP - __DEV__ && warnInvalidSource(source) - } - - // 2.x array mutation watch compat - if (__COMPAT__ && cb && !deep) { - const baseGetter = getter - getter = () => { - const val = baseGetter() - if ( - isArray(val) && - checkCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance) - ) { - traverse(val) - } - return val - } - } - - if (cb && deep) { - const baseGetter = getter - const depth = deep === true ? Infinity : deep - getter = () => traverse(baseGetter(), depth) - } + const baseWatchOptions: BaseWatchOptions = extend({}, options) - let cleanup: (() => void) | undefined - let onCleanup: OnCleanup = (fn: () => void) => { - cleanup = effect.onStop = () => { - callWithErrorHandling(fn, instance, ErrorCodes.WATCH_CLEANUP) - cleanup = effect.onStop = undefined - } - } + if (__DEV__) baseWatchOptions.onWarn = warn - // in SSR there is no need to setup an actual effect, and it should be noop - // unless it's eager or sync flush let ssrCleanup: (() => void)[] | undefined if (__SSR__ && isInSSRComponentSetup) { - // we will also not call the invalidate callback (+ runner is not set up) - onCleanup = NOOP - if (!cb) { - getter() - } else if (immediate) { - callWithAsyncErrorHandling(cb, instance, ErrorCodes.WATCH_CALLBACK, [ - getter(), - isMultiSource ? [] : undefined, - onCleanup, - ]) - } if (flush === 'sync') { const ctx = useSSRContext()! ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []) + } else if (!cb || immediate) { + // immediately watch or watchEffect + baseWatchOptions.once = true } else { - const watchHandle: WatchHandle = () => {} - watchHandle.stop = NOOP - watchHandle.resume = NOOP - watchHandle.pause = NOOP - return watchHandle + return { + stop: NOOP, + resume: NOOP, + pause: NOOP, + } as WatchHandle } } - let oldValue: any = isMultiSource - ? new Array((source as []).length).fill(INITIAL_WATCHER_VALUE) - : INITIAL_WATCHER_VALUE - const job: SchedulerJob = (immediateFirstRun?: boolean) => { - if ( - !(effect.flags & EffectFlags.ACTIVE) || - (!effect.dirty && !immediateFirstRun) - ) { - return + const instance = currentInstance + baseWatchOptions.call = (fn, type, args) => + callWithAsyncErrorHandling(fn, instance, type, args) + + // scheduler + let isPre = false + if (flush === 'post') { + baseWatchOptions.scheduler = job => { + queuePostRenderEffect(job, instance && instance.suspense) } - if (cb) { - // watch(source, cb) - const newValue = effect.run() - if ( - deep || - forceTrigger || - (isMultiSource - ? (newValue as any[]).some((v, i) => hasChanged(v, oldValue[i])) - : hasChanged(newValue, oldValue)) || - (__COMPAT__ && - isArray(newValue) && - isCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance)) - ) { - // cleanup before running cb again - if (cleanup) { - cleanup() - } - callWithAsyncErrorHandling(cb, instance, ErrorCodes.WATCH_CALLBACK, [ - newValue, - // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE - ? undefined - : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE - ? [] - : oldValue, - onCleanup, - ]) - oldValue = newValue + } else if (flush !== 'sync') { + // default: 'pre' + isPre = true + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job() + } else { + queueJob(job) } - } else { - // watchEffect - effect.run() } } - // important: mark the job as a watcher callback so that scheduler knows - // it is allowed to self-trigger (#1727) - if (cb) job.flags! |= SchedulerJobFlags.ALLOW_RECURSE - - const effect = new ReactiveEffect(getter) - - let scheduler: EffectScheduler - if (flush === 'sync') { - scheduler = job as any // the scheduler function gets called directly - } else if (flush === 'post') { - scheduler = () => queuePostRenderEffect(job, instance && instance.suspense) - } else { - // default: 'pre' - job.flags! |= SchedulerJobFlags.PRE - if (instance) { - job.id = instance.uid - job.i = instance + baseWatchOptions.augmentJob = (job: SchedulerJob) => { + // important: mark the job as a watcher callback so that scheduler knows + // it is allowed to self-trigger (#1727) + if (cb) { + job.flags! |= SchedulerJobFlags.ALLOW_RECURSE } - scheduler = () => queueJob(job) - } - effect.scheduler = scheduler - - const scope = getCurrentScope() - const watchHandle: WatchHandle = () => { - effect.stop() - if (scope) { - remove(scope.effects, effect) + if (isPre) { + job.flags! |= SchedulerJobFlags.PRE + if (instance) { + job.id = instance.uid + ;(job as SchedulerJob).i = instance + } } } - watchHandle.pause = effect.pause.bind(effect) - watchHandle.resume = effect.resume.bind(effect) - watchHandle.stop = watchHandle - - if (__DEV__) { - effect.onTrack = onTrack - effect.onTrigger = onTrigger - } - - // initial run - if (cb) { - if (immediate) { - job(true) - } else { - oldValue = effect.run() - } - } else if (flush === 'post') { - queuePostRenderEffect( - effect.run.bind(effect), - instance && instance.suspense, - ) - } else { - effect.run() - } + const watchHandle = baseWatch(source, cb, baseWatchOptions) if (__SSR__ && ssrCleanup) ssrCleanup.push(watchHandle) return watchHandle @@ -481,41 +270,3 @@ export function createPathGetter(ctx: any, path: string) { return cur } } - -export function traverse( - value: unknown, - depth: number = Infinity, - seen?: Set, -): unknown { - if (depth <= 0 || !isObject(value) || (value as any)[ReactiveFlags.SKIP]) { - return value - } - - seen = seen || new Set() - if (seen.has(value)) { - return value - } - seen.add(value) - depth-- - if (isRef(value)) { - traverse(value.value, depth, seen) - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - traverse(value[i], depth, seen) - } - } else if (isSet(value) || isMap(value)) { - value.forEach((v: any) => { - traverse(v, depth, seen) - }) - } else if (isPlainObject(value)) { - for (const key in value) { - traverse(value[key], depth, seen) - } - for (const key of Object.getOwnPropertySymbols(value)) { - if (Object.prototype.propertyIsEnumerable.call(value, key)) { - traverse(value[key as any], depth, seen) - } - } - } - return value -} diff --git a/packages/runtime-core/src/componentOptions.ts b/packages/runtime-core/src/componentOptions.ts index c59b0428f..2a39f45b6 100644 --- a/packages/runtime-core/src/componentOptions.ts +++ b/packages/runtime-core/src/componentOptions.ts @@ -1,11 +1,12 @@ -import type { - Component, - ComponentInternalInstance, - ComponentInternalOptions, - ConcreteComponent, - Data, - InternalRenderFunction, - SetupContext, +import { + type Component, + type ComponentInternalInstance, + type ComponentInternalOptions, + type ConcreteComponent, + type Data, + type InternalRenderFunction, + type SetupContext, + currentInstance, } from './component' import { type LooseRequired, @@ -18,7 +19,7 @@ import { isPromise, isString, } from '@vue/shared' -import { type Ref, isRef } from '@vue/reactivity' +import { type Ref, getCurrentScope, isRef, traverse } from '@vue/reactivity' import { computed } from './apiComputed' import { type WatchCallback, @@ -71,7 +72,7 @@ import { warn } from './warning' import type { VNodeChild } from './vnode' import { callWithAsyncErrorHandling } from './errorHandling' import { deepMergeData } from './compat/data' -import { DeprecationTypes } from './compat/compatConfig' +import { DeprecationTypes, checkCompatEnabled } from './compat/compatConfig' import { type CompatConfig, isCompatEnabled, @@ -848,18 +849,55 @@ export function createWatcher( publicThis: ComponentPublicInstance, key: string, ): void { - const getter = key.includes('.') + let getter = key.includes('.') ? createPathGetter(publicThis, key) : () => (publicThis as any)[key] + + const options: WatchOptions = {} + if (__COMPAT__) { + const instance = + currentInstance && getCurrentScope() === currentInstance.scope + ? currentInstance + : null + + const newValue = getter() + if ( + isArray(newValue) && + isCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance) + ) { + options.deep = true + } + + const baseGetter = getter + getter = () => { + const val = baseGetter() + if ( + isArray(val) && + checkCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance) + ) { + traverse(val) + } + return val + } + } + if (isString(raw)) { const handler = ctx[raw] if (isFunction(handler)) { - watch(getter, handler as WatchCallback) + if (__COMPAT__) { + watch(getter, handler as WatchCallback, options) + } else { + watch(getter, handler as WatchCallback) + } } else if (__DEV__) { warn(`Invalid watch handler specified by key "${raw}"`, handler) } } else if (isFunction(raw)) { - watch(getter, raw.bind(publicThis)) + if (__COMPAT__) { + watch(getter, raw.bind(publicThis), options) + } else { + watch(getter, raw.bind(publicThis)) + } } else if (isObject(raw)) { if (isArray(raw)) { raw.forEach(r => createWatcher(r, ctx, publicThis, key)) @@ -868,7 +906,7 @@ export function createWatcher( ? raw.handler.bind(publicThis) : (ctx[raw.handler] as WatchCallback) if (isFunction(handler)) { - watch(getter, handler, raw) + watch(getter, handler, __COMPAT__ ? extend(raw, options) : raw) } else if (__DEV__) { warn(`Invalid watch handler specified by key "${raw.handler}"`, handler) } diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index 964bb7dc2..f6a33f5a2 100644 --- a/packages/runtime-core/src/directives.ts +++ b/packages/runtime-core/src/directives.ts @@ -23,8 +23,7 @@ import { currentRenderingInstance } from './componentRenderContext' import { ErrorCodes, callWithAsyncErrorHandling } from './errorHandling' import type { ComponentPublicInstance } from './componentPublicInstance' import { mapCompatDirectiveHook } from './compat/customDirective' -import { pauseTracking, resetTracking } from '@vue/reactivity' -import { traverse } from './apiWatch' +import { pauseTracking, resetTracking, traverse } from '@vue/reactivity' export interface DirectiveBinding< Value = any, diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index 05cee54ff..c4bdf0bac 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -4,16 +4,20 @@ import type { ComponentInternalInstance } from './component' import { popWarningContext, pushWarningContext, warn } from './warning' import { EMPTY_OBJ, isArray, isFunction, isPromise } from '@vue/shared' import { LifecycleHooks } from './enums' +import { WatchErrorCodes } from '@vue/reactivity' // contexts where user provided function may be executed, in addition to // lifecycle hooks. export enum ErrorCodes { SETUP_FUNCTION, RENDER_FUNCTION, - WATCH_GETTER, - WATCH_CALLBACK, - WATCH_CLEANUP, - NATIVE_EVENT_HANDLER, + // The error codes for the watch have been transferred to the reactivity + // package along with baseWatch to maintain code compatibility. Hence, + // it is essential to keep these values unchanged. + // WATCH_GETTER, + // WATCH_CALLBACK, + // WATCH_CLEANUP, + NATIVE_EVENT_HANDLER = 5, COMPONENT_EVENT_HANDLER, VNODE_HOOK, DIRECTIVE_HOOK, @@ -27,7 +31,7 @@ export enum ErrorCodes { APP_UNMOUNT_CLEANUP, } -export const ErrorTypeStrings: Record = { +export const ErrorTypeStrings: Record = { [LifecycleHooks.SERVER_PREFETCH]: 'serverPrefetch hook', [LifecycleHooks.BEFORE_CREATE]: 'beforeCreate hook', [LifecycleHooks.CREATED]: 'created hook', @@ -44,9 +48,9 @@ export const ErrorTypeStrings: Record = { [LifecycleHooks.RENDER_TRIGGERED]: 'renderTriggered hook', [ErrorCodes.SETUP_FUNCTION]: 'setup function', [ErrorCodes.RENDER_FUNCTION]: 'render function', - [ErrorCodes.WATCH_GETTER]: 'watcher getter', - [ErrorCodes.WATCH_CALLBACK]: 'watcher callback', - [ErrorCodes.WATCH_CLEANUP]: 'watcher cleanup function', + [WatchErrorCodes.WATCH_GETTER]: 'watcher getter', + [WatchErrorCodes.WATCH_CALLBACK]: 'watcher callback', + [WatchErrorCodes.WATCH_CLEANUP]: 'watcher cleanup function', [ErrorCodes.NATIVE_EVENT_HANDLER]: 'native event handler', [ErrorCodes.COMPONENT_EVENT_HANDLER]: 'component event handler', [ErrorCodes.VNODE_HOOK]: 'vnode hook', @@ -61,7 +65,7 @@ export const ErrorTypeStrings: Record = { [ErrorCodes.APP_UNMOUNT_CLEANUP]: 'app unmount cleanup function', } -export type ErrorTypes = LifecycleHooks | ErrorCodes +export type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes export function callWithErrorHandling( fn: Function, diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index f20baf241..68a6aac90 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -28,6 +28,8 @@ export { // effect effect, stop, + getCurrentWatcher, + onWatcherCleanup, ReactiveEffect, // effect scope effectScope, From fdcb06b5e05209ec7e688dc1a91b3261e23e11ca Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 20 Aug 2024 08:22:32 +0800 Subject: [PATCH 060/210] chore: log more precise digits for size script [ci skip] --- scripts/usage-size.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/usage-size.ts b/scripts/usage-size.ts index aa8a29fa9..5b915866c 100644 --- a/scripts/usage-size.ts +++ b/scripts/usage-size.ts @@ -111,9 +111,10 @@ async function generateBundle(preset: Preset) { } console.log( - `${pico.green(pico.bold(preset.name))} - min:${prettyBytes( - size, - )} / gzip:${prettyBytes(gzip)} / brotli:${prettyBytes(brotli)}`, + `${pico.green(pico.bold(preset.name))} - ` + + `min:${prettyBytes(size, { minimumFractionDigits: 3 })} / ` + + `gzip:${prettyBytes(gzip, { minimumFractionDigits: 3 })} / ` + + `brotli:${prettyBytes(brotli, { minimumFractionDigits: 3 })}`, ) return { From 8c3fdd1a7d4060680f8379fac8848d9f5f6e5620 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 20 Aug 2024 08:24:06 +0800 Subject: [PATCH 061/210] release: v3.5.0-beta.3 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ package.json | 2 +- packages/compiler-core/package.json | 2 +- packages/compiler-dom/package.json | 2 +- packages/compiler-sfc/package.json | 2 +- packages/compiler-ssr/package.json | 2 +- packages/reactivity/package.json | 2 +- packages/runtime-core/package.json | 2 +- packages/runtime-dom/package.json | 2 +- packages/server-renderer/package.json | 2 +- packages/shared/package.json | 2 +- packages/vue-compat/package.json | 2 +- packages/vue/package.json | 2 +- 13 files changed, 38 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7af327bf..81bfe1cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# [3.5.0-beta.3](https://github.com/vuejs/core/compare/v3.5.0-beta.2...v3.5.0-beta.3) (2024-08-20) + + +### Bug Fixes + +* **reactivity:** extended methods respect reactive ([#11629](https://github.com/vuejs/core/issues/11629)) ([9de1d10](https://github.com/vuejs/core/commit/9de1d101f98bf6081f41038f6974826f190330a0)), closes [#11628](https://github.com/vuejs/core/issues/11628) +* **runtime-core:** correct type inference for PascalCase emits ([#11579](https://github.com/vuejs/core/issues/11579)) ([d7d0371](https://github.com/vuejs/core/commit/d7d0371e74707ee601020f67de88e091cdae2673)), closes [vuejs/language-tools#4269](https://github.com/vuejs/language-tools/issues/4269) +* **runtime-core:** ensure suspense content inherit scopeId ([#10652](https://github.com/vuejs/core/issues/10652)) ([ac2a410](https://github.com/vuejs/core/commit/ac2a410e46392db63ca4ed2db3c0fa71ebe1e855)), closes [#5148](https://github.com/vuejs/core/issues/5148) +* **runtime-core:** pre jobs without an id should run first ([#7746](https://github.com/vuejs/core/issues/7746)) ([b332f80](https://github.com/vuejs/core/commit/b332f80f0edb018229a23b43b93bb402b6368a3c)) +* **ssr:** apply ssr props to the the fallback vnode-based branch in ssr ([#7247](https://github.com/vuejs/core/issues/7247)) ([98b83e8](https://github.com/vuejs/core/commit/98b83e86d16c635547a1e735e5fb675aea2f0f1b)), closes [#6123](https://github.com/vuejs/core/issues/6123) +* **types/custom-element:** `defineCustomElement` with required props ([#11578](https://github.com/vuejs/core/issues/11578)) ([5e0f6d5](https://github.com/vuejs/core/commit/5e0f6d5f8fe7c4eb8f247357c3e2e281726f36db)) +* **types:** strip non-prop default values from return type of withDefaults ([#9998](https://github.com/vuejs/core/issues/9998)) ([44973bb](https://github.com/vuejs/core/commit/44973bb3e790db7d8aa7af4eda21c80cac73a8de)), closes [#9899](https://github.com/vuejs/core/issues/9899) +* **watch:** handle errors in computed used as watch source ([#11626](https://github.com/vuejs/core/issues/11626)) ([8bcaad4](https://github.com/vuejs/core/commit/8bcaad4a32cf0f1f89e0259f6a53036620b7fe9f)), closes [#11624](https://github.com/vuejs/core/issues/11624) + + +### Features + +* **reactivity:** base `watch`, `getCurrentWatcher`, and `onWatcherCleanup` ([#9927](https://github.com/vuejs/core/issues/9927)) ([205e5b5](https://github.com/vuejs/core/commit/205e5b5e277243c3af2c937d9bd46cf671296b72)) + + +### Performance Improvements + +* ** runtime-core:** use `apply` to avoid spreading. ([#5985](https://github.com/vuejs/core/issues/5985)) ([bb6babc](https://github.com/vuejs/core/commit/bb6babca8f206615d4e246457cd54d21bb3bc5a4)) + + + # [3.5.0-beta.2](https://github.com/vuejs/core/compare/v3.5.0-beta.1...v3.5.0-beta.2) (2024-08-15) diff --git a/package.json b/package.json index 3ed2ceea8..cb3c2de8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "packageManager": "pnpm@9.7.1", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 028bd629f..ca07d47bf 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/compiler-core", "main": "index.js", "module": "dist/compiler-core.esm-bundler.js", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index a23e66f58..bb453aa9f 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/compiler-dom", "main": "index.js", "module": "dist/compiler-dom.esm-bundler.js", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index c228933b1..c81453cd3 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index 5927015fc..57f40fb04 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index 2099737e4..90be7e338 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 77263a90f..de9e0317b 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 63a72e0b2..459fa3a7d 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 47bab1419..0a1d38c05 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index eb5fa68b7..f2767bf65 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index 3bd457db4..357e684e4 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index 18eed0969..095d1fa05 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.0-beta.2", + "version": "3.5.0-beta.3", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From 7dbab278d5f5a5b441393d1e0b433528abbbd0b9 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 20 Aug 2024 10:42:12 +0800 Subject: [PATCH 062/210] chore: fix typo (#11663)[ci skip] * chore: fix typo * chore: update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81bfe1cb3..a6e342710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ### Performance Improvements -* ** runtime-core:** use `apply` to avoid spreading. ([#5985](https://github.com/vuejs/core/issues/5985)) ([bb6babc](https://github.com/vuejs/core/commit/bb6babca8f206615d4e246457cd54d21bb3bc5a4)) +* **runtime-core:** use `apply` to avoid spreading. ([#5985](https://github.com/vuejs/core/issues/5985)) ([bb6babc](https://github.com/vuejs/core/commit/bb6babca8f206615d4e246457cd54d21bb3bc5a4)) From f2ea25dc5493b9baaefd7fe6caed1d76765b2fe4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 20 Aug 2024 16:15:08 +0800 Subject: [PATCH 063/210] refactor(watch): reuse watch types --- packages/reactivity/src/index.ts | 4 ++++ packages/reactivity/src/watch.ts | 11 +++++---- packages/runtime-core/src/apiWatch.ts | 32 ++++++++++++--------------- packages/runtime-core/src/index.ts | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/packages/reactivity/src/index.ts b/packages/reactivity/src/index.ts index 47302b224..f0445e87d 100644 --- a/packages/reactivity/src/index.ts +++ b/packages/reactivity/src/index.ts @@ -90,4 +90,8 @@ export { type WatchScheduler, type WatchStopHandle, type WatchHandle, + type WatchEffect, + type WatchSource, + type WatchCallback, + type OnCleanup, } from './watch' diff --git a/packages/reactivity/src/watch.ts b/packages/reactivity/src/watch.ts index 2104896b7..96da5ffe5 100644 --- a/packages/reactivity/src/watch.ts +++ b/packages/reactivity/src/watch.ts @@ -34,14 +34,17 @@ export enum WatchErrorCodes { WATCH_CLEANUP, } -type WatchEffect = (onCleanup: OnCleanup) => void -type WatchSource = Ref | ComputedRef | (() => T) -type WatchCallback = ( +export type WatchEffect = (onCleanup: OnCleanup) => void + +export type WatchSource = Ref | ComputedRef | (() => T) + +export type WatchCallback = ( value: V, oldValue: OV, onCleanup: OnCleanup, ) => any -type OnCleanup = (cleanupFn: () => void) => void + +export type OnCleanup = (cleanupFn: () => void) => void export interface WatchOptions extends DebuggerOptions { immediate?: Immediate diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 3304f2c75..a14823beb 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -1,10 +1,11 @@ import { type WatchOptions as BaseWatchOptions, - type ComputedRef, type DebuggerOptions, type ReactiveMarker, - type Ref, + type WatchCallback, + type WatchEffect, type WatchHandle, + type WatchSource, watch as baseWatch, } from '@vue/reactivity' import { type SchedulerJob, SchedulerJobFlags, queueJob } from './scheduler' @@ -21,17 +22,14 @@ import { warn } from './warning' import type { ObjectWatchOptionItem } from './componentOptions' import { useSSRContext } from './helpers/useSsrContext' -export type { WatchHandle, WatchStopHandle } from '@vue/reactivity' - -export type WatchEffect = (onCleanup: OnCleanup) => void - -export type WatchSource = Ref | ComputedRef | (() => T) - -export type WatchCallback = ( - value: V, - oldValue: OV, - onCleanup: OnCleanup, -) => any +export type { + WatchHandle, + WatchStopHandle, + WatchEffect, + WatchSource, + WatchCallback, + OnCleanup, +} from '@vue/reactivity' type MaybeUndefined = I extends true ? T | undefined : T @@ -43,13 +41,11 @@ type MapSources = { : never } -export type OnCleanup = (cleanupFn: () => void) => void - -export interface WatchOptionsBase extends DebuggerOptions { +export interface WatchEffectOptions extends DebuggerOptions { flush?: 'pre' | 'post' | 'sync' } -export interface WatchOptions extends WatchOptionsBase { +export interface WatchOptions extends WatchEffectOptions { immediate?: Immediate deep?: boolean | number once?: boolean @@ -58,7 +54,7 @@ export interface WatchOptions extends WatchOptionsBase { // Simple effect. export function watchEffect( effect: WatchEffect, - options?: WatchOptionsBase, + options?: WatchEffectOptions, ): WatchHandle { return doWatch(effect, null, options) } diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index 68a6aac90..7f716b5f4 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -229,7 +229,7 @@ export type { MultiWatchSources, WatchEffect, WatchOptions, - WatchOptionsBase, + WatchEffectOptions as WatchOptionsBase, WatchCallback, WatchSource, WatchHandle, From fbc0c42bcf6dea5a6ae664223fa19d4375ca39f0 Mon Sep 17 00:00:00 2001 From: yangxiuxiu <79584569+yangxiuxiu1115@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:35:08 +0800 Subject: [PATCH 064/210] fix(reactivity): ensure watcher with once: true are properly removed from effect scope (#11665) --- packages/reactivity/src/watch.ts | 20 +++++++++---------- .../runtime-core/__tests__/apiWatch.spec.ts | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/reactivity/src/watch.ts b/packages/reactivity/src/watch.ts index 96da5ffe5..9c1eea00b 100644 --- a/packages/reactivity/src/watch.ts +++ b/packages/reactivity/src/watch.ts @@ -206,18 +206,26 @@ export function watch( getter = () => traverse(baseGetter(), depth) } + const scope = getCurrentScope() + const watchHandle: WatchHandle = () => { + effect.stop() + if (scope) { + remove(scope.effects, effect) + } + } + if (once) { if (cb) { const _cb = cb cb = (...args) => { _cb(...args) - effect.stop() + watchHandle() } } else { const _getter = getter getter = () => { _getter() - effect.stop() + watchHandle() } } } @@ -317,14 +325,6 @@ export function watch( effect.run() } - const scope = getCurrentScope() - const watchHandle: WatchHandle = () => { - effect.stop() - if (scope) { - remove(scope.effects, effect) - } - } - watchHandle.pause = effect.pause.bind(effect) watchHandle.resume = effect.resume.bind(effect) watchHandle.stop = watchHandle diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index b1eb85f8a..7a800949e 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -1771,6 +1771,11 @@ describe('api: watch', () => { expect(scope.effects.length).toBe(1) unwatch!() expect(scope.effects.length).toBe(0) + + scope.run(() => { + watch(num, () => {}, { once: true, immediate: true }) + }) + expect(scope.effects.length).toBe(0) }) // simplified case of VueUse syncRef From 342657b717a8e1de7792fde6c418bfa5eb5245cd Mon Sep 17 00:00:00 2001 From: edison Date: Mon, 26 Aug 2024 18:08:46 +0800 Subject: [PATCH 065/210] chore: correct the issue number (#11715) [ci skip] --- packages/runtime-core/src/apiDefineComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 0dde68f88..760689eeb 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -297,7 +297,7 @@ export function defineComponent( extraOptions?: ComponentOptions, ) { return isFunction(options) - ? // #8326: extend call and options.name access are considered side-effects + ? // #8236: extend call and options.name access are considered side-effects // by Rollup, so we have to wrap it in a pure-annotated IIFE. /*#__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() From 42e8df62030e7f2c287d9103f045e67b34a63e3b Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 28 Aug 2024 15:00:23 +0800 Subject: [PATCH 066/210] fix(types): GlobalDirective / GlobalComponents should not be records --- packages/runtime-core/src/component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 46608ae2d..fe1b340c5 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -150,7 +150,7 @@ export interface ComponentCustomProps {} * } * ``` */ -export interface GlobalDirectives extends Record {} +export interface GlobalDirectives {} /** * For globally defined Components @@ -167,7 +167,7 @@ export interface GlobalDirectives extends Record {} * } * ``` */ -export interface GlobalComponents extends Record { +export interface GlobalComponents { Teleport: DefineComponent Suspense: DefineComponent KeepAlive: DefineComponent From d875de54e9e03e0768fe550aa4c4886a4baf3bd7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 28 Aug 2024 17:37:39 +0800 Subject: [PATCH 067/210] fix(runtime-dom): setting innerHTML when patching props should go through trusted types --- packages/runtime-dom/src/modules/props.ts | 13 +++++++------ packages/runtime-dom/src/nodeOps.ts | 5 ++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index 7b7b700e0..4dfcee6ae 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -1,9 +1,6 @@ -// __UNSAFE__ -// Reason: potentially setting innerHTML. -// This can come from explicit usage of v-html or innerHTML as a prop in render - import { DeprecationTypes, compatUtils, warn } from '@vue/runtime-core' import { includeBooleanAttr } from '@vue/shared' +import { unsafeToTrustedHTML } from '../nodeOps' // functions. The user is responsible for using them with only trusted content. export function patchDOMProp( @@ -12,11 +9,15 @@ export function patchDOMProp( value: any, parentComponent: any, ): void { + // __UNSAFE__ + // Reason: potentially setting innerHTML. + // This can come from explicit usage of v-html or innerHTML as a prop in render if (key === 'innerHTML' || key === 'textContent') { // null value case is handled in renderer patchElement before patching // children - if (value == null) return - el[key] = value + if (value != null) { + el[key] = key === 'innerHTML' ? unsafeToTrustedHTML(value) : value + } return } diff --git a/packages/runtime-dom/src/nodeOps.ts b/packages/runtime-dom/src/nodeOps.ts index 8ed70c7d3..d7422bf61 100644 --- a/packages/runtime-dom/src/nodeOps.ts +++ b/packages/runtime-dom/src/nodeOps.ts @@ -31,9 +31,8 @@ if (tt) { // This function merely perform a type-level trusted type conversion // for use in `innerHTML` assignment, etc. // Be careful of whatever value passed to this function. -const unsafeToTrustedHTML: (value: string) => TrustedHTML | string = policy - ? val => policy.createHTML(val) - : val => val +export const unsafeToTrustedHTML: (value: string) => TrustedHTML | string = + policy ? val => policy.createHTML(val) : val => val export const svgNS = 'http://www.w3.org/2000/svg' export const mathmlNS = 'http://www.w3.org/1998/Math/MathML' From d6ccce9049e41932550f25c327c85b5dc761b2fe Mon Sep 17 00:00:00 2001 From: Rudy Date: Wed, 28 Aug 2024 17:48:10 +0800 Subject: [PATCH 068/210] test(types): component type check when props is an empty object (#7419) ref #4051 ref #8825 --- .../dts-test/defineComponent.test-d.tsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages-private/dts-test/defineComponent.test-d.tsx b/packages-private/dts-test/defineComponent.test-d.tsx index 79ce6d695..0124a8b15 100644 --- a/packages-private/dts-test/defineComponent.test-d.tsx +++ b/packages-private/dts-test/defineComponent.test-d.tsx @@ -480,6 +480,26 @@ describe('type inference w/ options API', () => { }) }) +// #4051 +describe('type inference w/ empty prop object', () => { + const MyComponent = defineComponent({ + props: {}, + setup(props) { + return {} + }, + render() {}, + }) + expectType() + // AllowedComponentProps + expectType() + // ComponentCustomProps + expectType() + // VNodeProps + expectType() + // @ts-expect-error + expectError() +}) + describe('with mixins', () => { const MixinA = defineComponent({ emits: ['bar'], From 334d47ddf3fc0c94fe364cbd5a9e4a5d9334b82d Mon Sep 17 00:00:00 2001 From: Paul Werner <52678724+paulwer@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:49:33 +0200 Subject: [PATCH 069/210] dx(compiler-sfc): improve error message for missing template and script tag in vue file (#11723) --- packages/compiler-sfc/src/parse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-sfc/src/parse.ts b/packages/compiler-sfc/src/parse.ts index 01a4bec6e..32c26d3ac 100644 --- a/packages/compiler-sfc/src/parse.ts +++ b/packages/compiler-sfc/src/parse.ts @@ -235,7 +235,7 @@ export function parse( if (!descriptor.template && !descriptor.script && !descriptor.scriptSetup) { errors.push( new SyntaxError( - `At least one