From ca41b9202a26672273dce659a34f1351bfc97a68 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 16 Aug 2024 17:53:02 +0800 Subject: [PATCH 001/242] 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 d9145507f3b..1ae85e2077f 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 6c2bfa8c571..00000000000 --- 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 002/242] 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 25adf7c85f4..b3e963ececa 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 003/242] 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 079ced4bd1a..8d74330da44 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 354ebb3a4e8..bcad9962996 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 004/242] 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 bcad9962996..256ab202780 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 005/242] 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 83fd352df4b..419529b043d 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 50f0a6d2f41..8b9d975214a 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 975f879b8e1..3fc091562fb 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 006/242] 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 c7a358a95ca..c228933b1e2 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 3fc091562fb..e88daa6b880 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 007/242] 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 419529b043d..c02b8f1abd9 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 e88daa6b880..9b204babfc3 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 008/242] 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 c02b8f1abd9..3ed2ceea8f6 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 9b204babfc3..361cbfd8b9d 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 009/242] 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 c5faa05de83..fefc4137034 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 8d74330da44..5c5b04673ab 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 3d1cc6849c7..ce063989502 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 256ab202780..aa12b6896a7 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 010/242] 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 08753e023a1..d9a7d4dbfa4 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 ce063989502..11736e9dff2 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 011/242] 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 caeb88397b1..0679c82168b 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 be51da1b86d..4744940e827 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 012/242] 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 5356ce790d7..edc57436a56 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 630df1cfe7f..cdf2d798864 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 013/242] 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 28b3c01cd0f..64c944e0be2 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 7915fa3fd49..90bde3aebd2 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 014/242] 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 00000000000..7a4078166b7 --- /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 b320f1f8cb0..47302b224d7 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 00000000000..2104896b7ae --- /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 67f0bc160e3..b1eb85f8a13 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 35b488052f9..3304f2c75b6 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 c59b0428f40..2a39f45b685 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 964bb7dc208..f6a33f5a289 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 05cee54fffc..c4bdf0baccd 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 f20baf2410b..68a6aac9027 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 015/242] 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 aa8a29fa932..5b915866c1d 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 016/242] 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 c7af327bf7e..81bfe1cb31b 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 3ed2ceea8f6..cb3c2de8d37 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 028bd629fd7..ca07d47bf0c 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 a23e66f5892..bb453aa9f97 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 c228933b1e2..c81453cd3bd 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 5927015fc43..57f40fb04a2 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 2099737e422..90be7e33874 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 77263a90fe5..de9e0317b7a 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 63a72e0b21b..459fa3a7d5e 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 47bab1419af..0a1d38c0587 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 eb5fa68b7b8..f2767bf6548 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 3bd457db4d8..357e684e4c8 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 18eed09694b..095d1fa05ba 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 017/242] 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 81bfe1cb31b..a6e34271000 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 018/242] 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 47302b224d7..f0445e87da0 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 2104896b7ae..96da5ffe5c2 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 3304f2c75b6..a14823beb62 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 68a6aac9027..7f716b5f4e8 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 019/242] 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 96da5ffe5c2..9c1eea00b9b 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 b1eb85f8a13..7a800949eea 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 020/242] 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 0dde68f888c..760689eeb2e 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 021/242] 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 46608ae2d5d..fe1b340c52e 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 022/242] 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 7b7b700e048..4dfcee6aee6 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 8ed70c7d330..d7422bf6164 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 023/242] 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 79ce6d6956d..0124a8b1525 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 024/242] 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 01a4bec6eeb..32c26d3acac 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