From 7ab432d74bc5eca33b88ec8845c978bfb104bd2c Mon Sep 17 00:00:00 2001 From: Surmon Date: Thu, 15 Aug 2024 17:58:37 +0800 Subject: [PATCH] feat: v1.0.0-beta.2 --- CHANGELOG.md | 4 + package.json | 4 +- pnpm-lock.yaml | 256 ++++++++++++++++++--------------------- src/watch/watch.ts | 3 +- src/watch/watchEffect.ts | 2 +- tests/readonly.spec.ts | 26 +++- 6 files changed, 149 insertions(+), 146 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 303edb0..6f12e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +### v1.0.0-beta.2 (2024-08-15) + +No changes, just synced with `@vue/reactivity` [v3.5.0-beta.2](https://github.com/vuejs/core/blob/main/CHANGELOG.md#350-beta2-2024-08-15). + ### v1.0.0-beta.1 (2024-08-12) #### Added diff --git a/package.json b/package.json index 5eec5ef..b4e4d71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "veact", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "description": "Mutable state enhancer library for React by @vue/reactivity", "keywords": [ "React", @@ -50,7 +50,7 @@ "react-dom": "^16.8.0 || ^17 || ^18 || ^19" }, "dependencies": { - "@vue/reactivity": "^3.5.0-beta.1" + "@vue/reactivity": "^3.5.0-beta.2" }, "devDependencies": { "@eslint/js": "^9.x", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7000f79..709dba0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@vue/reactivity': - specifier: ^3.5.0-beta.1 - version: 3.5.0-beta.1 + specifier: ^3.5.0-beta.2 + version: 3.5.0-beta.2 devDependencies: '@eslint/js': specifier: ^9.x @@ -29,10 +29,10 @@ importers: version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.x - version: 4.3.1(vite@5.4.0(@types/node@22.2.0)) + version: 4.3.1(vite@5.4.0) '@vitest/coverage-v8': specifier: ^2.0.5 - version: 2.0.5(vitest@2.0.5(@types/node@22.2.0)(jsdom@24.1.1)) + version: 2.0.5(vitest@2.0.5(jsdom@24.1.1)) eslint: specifier: ^9.x version: 9.9.0 @@ -62,16 +62,16 @@ importers: version: 5.5.4 typescript-eslint: specifier: ^8.x - version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) + version: 8.1.0(eslint@9.9.0)(typescript@5.5.4) vite: specifier: ^5.x - version: 5.4.0(@types/node@22.2.0) + version: 5.4.0 vite-plugin-dts: specifier: ^4.0.3 - version: 4.0.3(@types/node@22.2.0)(rollup@4.20.0)(typescript@5.5.4)(vite@5.4.0(@types/node@22.2.0)) + version: 4.0.3(rollup@4.20.0)(typescript@5.5.4)(vite@5.4.0) vitest: specifier: ^2.x - version: 2.0.5(@types/node@22.2.0)(jsdom@24.1.1) + version: 2.0.5(jsdom@24.1.1) packages: @@ -561,9 +561,6 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@22.2.0': - resolution: {integrity: sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==} - '@types/prop-types@15.7.12': resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} @@ -573,8 +570,8 @@ packages: '@types/react@18.3.3': resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} - '@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 @@ -584,8 +581,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 @@ -594,12 +591,12 @@ packages: typescript: optional: true - '@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: '*' @@ -607,12 +604,12 @@ packages: typescript: optional: true - '@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@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: '*' @@ -620,14 +617,14 @@ packages: typescript: optional: true - '@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 - '@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-react@4.3.1': @@ -677,11 +674,11 @@ packages: '@volar/typescript@2.4.0-alpha.18': resolution: {integrity: sha512-sXh5Y8sqGUkgxpMWUGvRXggxYHAVxg0Pa1C42lQZuPDrW6vHJPR0VCK8Sr7WJsAW530HuNQT/ZIskmXtxjybMQ==} - '@vue/compiler-core@3.4.37': - resolution: {integrity: sha512-ZDDT/KiLKuCRXyzWecNzC5vTcubGz4LECAtfGPENpo0nrmqJHwuWtRLxk/Sb9RAKtR9iFflFycbkjkY+W/PZUQ==} + '@vue/compiler-core@3.4.38': + resolution: {integrity: sha512-8IQOTCWnLFqfHzOGm9+P8OPSEDukgg3Huc92qSG49if/xI2SAwLHQO2qaPQbjCWPBcQoO1WYfXfTACUrWV3c5A==} - '@vue/compiler-dom@3.4.37': - resolution: {integrity: sha512-rIiSmL3YrntvgYV84rekAtU/xfogMUJIclUMeIKEtVBFngOL3IeZHhsH3UaFEgB5iFGpj6IW+8YuM/2Up+vVag==} + '@vue/compiler-dom@3.4.38': + resolution: {integrity: sha512-Osc/c7ABsHXTsETLgykcOwIxFktHfGSUDkb05V61rocEfsFDcjDLH/IHJSNJP+/Sv9KeN2Lx1V6McZzlSb9EhQ==} '@vue/compiler-vue2@2.7.16': resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==} @@ -694,14 +691,14 @@ packages: typescript: optional: true - '@vue/reactivity@3.5.0-beta.1': - resolution: {integrity: sha512-3dBZPdQxGcVCgeJv9KlGuK8a++PUj+OAJ8U89h+77SHMDAKXpLLjnpL+VfreAl37Z39ye4AJyfeYvaXV7fdlcA==} + '@vue/reactivity@3.5.0-beta.2': + resolution: {integrity: sha512-/OMAO+vGHfPAPvofdW9lRJEBNBoLt6vpRYS4TMbbz+wMgQQ23vvOvp6W8s0pkcSsw0mm697Z3WDz1ZZhUW/NzA==} - '@vue/shared@3.4.37': - resolution: {integrity: sha512-nIh8P2fc3DflG8+5Uw8PT/1i17ccFn0xxN/5oE9RfV5SVnd7G0XEFRwakrnNFE/jlS95fpGXDVG5zDETS26nmg==} + '@vue/shared@3.4.38': + resolution: {integrity: sha512-q0xCiLkuWWQLzVrecPb0RMsNWyxICOjPrcrwxTUEHb1fsnvni4dcuyG7RT/Ie7VPTvnjzIaWzRMUBsrqNj/hhw==} - '@vue/shared@3.5.0-beta.1': - resolution: {integrity: sha512-RbjXOkVFA+92CWL8HLexUKIl3yUH0PGuzfjDtaNmr4WRP8vlA7xOyRm4iX+jl/KCbZb9JjC0r8yYWqNiMdeSJQ==} + '@vue/shared@3.5.0-beta.2': + resolution: {integrity: sha512-cexku/B2Ezno4tBTSfgNwaY+WUAF1rI3S3D9mOOYDn3gEpRn+HR5cLNW3bVC8yxoH4cNd4YMpbELuhMv67+/cw==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -918,8 +915,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.5.6: - resolution: {integrity: sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==} + electron-to-chromium@1.5.7: + resolution: {integrity: sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -931,10 +928,6 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - entities@5.0.0: - resolution: {integrity: sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==} - engines: {node: '>=0.12'} - esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -1166,8 +1159,8 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} import-fresh@3.3.0: @@ -1715,8 +1708,8 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - 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: '*' @@ -1737,9 +1730,6 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} - undici-types@6.13.0: - resolution: {integrity: sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==} - universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -2138,7 +2128,7 @@ snapshots: debug: 4.3.6 espree: 10.1.0 globals: 14.0.0 - ignore: 5.3.1 + ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -2182,23 +2172,23 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@microsoft/api-extractor-model@7.29.4(@types/node@22.2.0)': + '@microsoft/api-extractor-model@7.29.4': dependencies: '@microsoft/tsdoc': 0.15.0 '@microsoft/tsdoc-config': 0.17.0 - '@rushstack/node-core-library': 5.5.1(@types/node@22.2.0) + '@rushstack/node-core-library': 5.5.1 transitivePeerDependencies: - '@types/node' - '@microsoft/api-extractor@7.47.4(@types/node@22.2.0)': + '@microsoft/api-extractor@7.47.4': dependencies: - '@microsoft/api-extractor-model': 7.29.4(@types/node@22.2.0) + '@microsoft/api-extractor-model': 7.29.4 '@microsoft/tsdoc': 0.15.0 '@microsoft/tsdoc-config': 0.17.0 - '@rushstack/node-core-library': 5.5.1(@types/node@22.2.0) + '@rushstack/node-core-library': 5.5.1 '@rushstack/rig-package': 0.5.3 - '@rushstack/terminal': 0.13.3(@types/node@22.2.0) - '@rushstack/ts-command-line': 4.22.3(@types/node@22.2.0) + '@rushstack/terminal': 0.13.3 + '@rushstack/ts-command-line': 4.22.3 lodash: 4.17.21 minimatch: 3.0.8 resolve: 1.22.8 @@ -2290,7 +2280,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.20.0': optional: true - '@rushstack/node-core-library@5.5.1(@types/node@22.2.0)': + '@rushstack/node-core-library@5.5.1': dependencies: ajv: 8.13.0 ajv-draft-04: 1.0.0(ajv@8.13.0) @@ -2300,24 +2290,20 @@ snapshots: jju: 1.4.0 resolve: 1.22.8 semver: 7.5.4 - optionalDependencies: - '@types/node': 22.2.0 '@rushstack/rig-package@0.5.3': dependencies: resolve: 1.22.8 strip-json-comments: 3.1.1 - '@rushstack/terminal@0.13.3(@types/node@22.2.0)': + '@rushstack/terminal@0.13.3': dependencies: - '@rushstack/node-core-library': 5.5.1(@types/node@22.2.0) + '@rushstack/node-core-library': 5.5.1 supports-color: 8.1.1 - optionalDependencies: - '@types/node': 22.2.0 - '@rushstack/ts-command-line@4.22.3(@types/node@22.2.0)': + '@rushstack/ts-command-line@4.22.3': dependencies: - '@rushstack/terminal': 0.13.3(@types/node@22.2.0) + '@rushstack/terminal': 0.13.3 '@types/argparse': 1.0.38 argparse: 1.0.10 string-argv: 0.3.2 @@ -2379,11 +2365,6 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/node@22.2.0': - dependencies: - undici-types: 6.13.0 - optional: true - '@types/prop-types@15.7.12': {} '@types/react-dom@18.3.0': @@ -2395,17 +2376,17 @@ snapshots: '@types/prop-types': 15.7.12 csstype: 3.1.3 - '@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 + ignore: 5.3.2 natural-compare: 1.4.0 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -2413,12 +2394,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: @@ -2426,15 +2407,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@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: @@ -2443,12 +2424,12 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@8.0.1': {} + '@typescript-eslint/types@8.1.0': {} - '@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 @@ -2460,34 +2441,34 @@ snapshots: transitivePeerDependencies: - supports-color - '@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 - typescript - '@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-react@4.3.1(vite@5.4.0(@types/node@22.2.0))': + '@vitejs/plugin-react@4.3.1(vite@5.4.0)': dependencies: '@babel/core': 7.25.2 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.0(@types/node@22.2.0) + vite: 5.4.0 transitivePeerDependencies: - supports-color - '@vitest/coverage-v8@2.0.5(vitest@2.0.5(@types/node@22.2.0)(jsdom@24.1.1))': + '@vitest/coverage-v8@2.0.5(vitest@2.0.5(jsdom@24.1.1))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -2501,7 +2482,7 @@ snapshots: std-env: 3.7.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@22.2.0)(jsdom@24.1.1) + vitest: 2.0.5(jsdom@24.1.1) transitivePeerDependencies: - supports-color @@ -2562,18 +2543,18 @@ snapshots: path-browserify: 1.0.1 vscode-uri: 3.0.8 - '@vue/compiler-core@3.4.37': + '@vue/compiler-core@3.4.38': dependencies: '@babel/parser': 7.25.3 - '@vue/shared': 3.4.37 - entities: 5.0.0 + '@vue/shared': 3.4.38 + entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.0 - '@vue/compiler-dom@3.4.37': + '@vue/compiler-dom@3.4.38': dependencies: - '@vue/compiler-core': 3.4.37 - '@vue/shared': 3.4.37 + '@vue/compiler-core': 3.4.38 + '@vue/shared': 3.4.38 '@vue/compiler-vue2@2.7.16': dependencies: @@ -2583,9 +2564,9 @@ snapshots: '@vue/language-core@2.0.29(typescript@5.5.4)': dependencies: '@volar/language-core': 2.4.0-alpha.18 - '@vue/compiler-dom': 3.4.37 + '@vue/compiler-dom': 3.4.38 '@vue/compiler-vue2': 2.7.16 - '@vue/shared': 3.4.37 + '@vue/shared': 3.4.38 computeds: 0.0.1 minimatch: 9.0.5 muggle-string: 0.4.1 @@ -2593,13 +2574,13 @@ snapshots: optionalDependencies: typescript: 5.5.4 - '@vue/reactivity@3.5.0-beta.1': + '@vue/reactivity@3.5.0-beta.2': dependencies: - '@vue/shared': 3.5.0-beta.1 + '@vue/shared': 3.5.0-beta.2 - '@vue/shared@3.4.37': {} + '@vue/shared@3.4.38': {} - '@vue/shared@3.5.0-beta.1': {} + '@vue/shared@3.5.0-beta.2': {} acorn-jsx@5.3.2(acorn@8.12.1): dependencies: @@ -2692,7 +2673,7 @@ snapshots: browserslist@4.23.3: dependencies: caniuse-lite: 1.0.30001651 - electron-to-chromium: 1.5.6 + electron-to-chromium: 1.5.7 node-releases: 2.0.18 update-browserslist-db: 1.1.0(browserslist@4.23.3) @@ -2790,7 +2771,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.6: {} + electron-to-chromium@1.5.7: {} emoji-regex@8.0.0: {} @@ -2798,8 +2779,6 @@ snapshots: entities@4.5.0: {} - entities@5.0.0: {} - esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -2879,7 +2858,7 @@ snapshots: file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - ignore: 5.3.1 + ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -3026,7 +3005,7 @@ snapshots: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.1 + ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -3070,7 +3049,7 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ignore@5.3.1: {} + ignore@5.3.2: {} import-fresh@3.3.0: dependencies: @@ -3574,11 +3553,11 @@ snapshots: dependencies: prelude-ls: 1.2.1 - 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: @@ -3591,9 +3570,6 @@ snapshots: ufo@1.5.4: {} - undici-types@6.13.0: - optional: true - universalify@0.1.2: {} universalify@0.2.0: {} @@ -3613,13 +3589,13 @@ snapshots: querystringify: 2.2.0 requires-port: 1.0.0 - vite-node@2.0.5(@types/node@22.2.0): + vite-node@2.0.5: dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@22.2.0) + vite: 5.4.0 transitivePeerDependencies: - '@types/node' - less @@ -3631,9 +3607,9 @@ snapshots: - supports-color - terser - vite-plugin-dts@4.0.3(@types/node@22.2.0)(rollup@4.20.0)(typescript@5.5.4)(vite@5.4.0(@types/node@22.2.0)): + vite-plugin-dts@4.0.3(rollup@4.20.0)(typescript@5.5.4)(vite@5.4.0): dependencies: - '@microsoft/api-extractor': 7.47.4(@types/node@22.2.0) + '@microsoft/api-extractor': 7.47.4 '@rollup/pluginutils': 5.1.0(rollup@4.20.0) '@volar/typescript': 2.3.4 '@vue/language-core': 2.0.29(typescript@5.5.4) @@ -3645,22 +3621,21 @@ snapshots: typescript: 5.5.4 vue-tsc: 2.0.29(typescript@5.5.4) optionalDependencies: - vite: 5.4.0(@types/node@22.2.0) + vite: 5.4.0 transitivePeerDependencies: - '@types/node' - rollup - supports-color - vite@5.4.0(@types/node@22.2.0): + vite@5.4.0: dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.20.0 optionalDependencies: - '@types/node': 22.2.0 fsevents: 2.3.3 - vitest@2.0.5(@types/node@22.2.0)(jsdom@24.1.1): + vitest@2.0.5(jsdom@24.1.1): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -3678,11 +3653,10 @@ snapshots: tinybench: 2.9.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@22.2.0) - vite-node: 2.0.5(@types/node@22.2.0) + vite: 5.4.0 + vite-node: 2.0.5 why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.2.0 jsdom: 24.1.1 transitivePeerDependencies: - less diff --git a/src/watch/watch.ts b/src/watch/watch.ts index 7e83f22..a54e9c7 100644 --- a/src/watch/watch.ts +++ b/src/watch/watch.ts @@ -21,6 +21,8 @@ import { } from './patch' // fork form: https://github.com/vuejs/core/blob/main/packages/runtime-core/src/apiWatch.ts +// commits: https://github.com/vuejs/core/commits/main/packages/runtime-core/src/apiWatch.ts +// changelog: https://github.com/vuejs/core/blob/main/CHANGELOG.md // initial value for watchers to trigger on undefined initial values const INITIAL_WATCHER_VALUE = {} @@ -232,7 +234,6 @@ export function watch = false>( } effect = new ReactiveEffect(getter) - ;(effect as any).flags |= EffectFlags.NO_BATCH effect.scheduler = scheduler effect.onTrack = onTrack effect.onTrigger = onTrigger diff --git a/src/watch/watchEffect.ts b/src/watch/watchEffect.ts index a361dca..f2264a9 100644 --- a/src/watch/watchEffect.ts +++ b/src/watch/watchEffect.ts @@ -63,7 +63,7 @@ export function watchEffect(effectFn: WatchEffect, options: WatchEffectOptions = effect.run() } - // effector + // effect effect = new ReactiveEffect(getter) effect.scheduler = scheduler effect.onTrack = options.onTrack diff --git a/tests/readonly.spec.ts b/tests/readonly.spec.ts index 03554e8..5383fdb 100644 --- a/tests/readonly.spec.ts +++ b/tests/readonly.spec.ts @@ -1,7 +1,13 @@ -import { test, expect } from 'vitest' +import { test, expect, vi, afterEach } from 'vitest' import { renderHook, act } from '@testing-library/react' import { reactive, isReactive, isReadonly, onUpdated, useReadonly, useShallowReadonly } from '../src' +// for: [Vue warn] Set operation on key "xxx" failed: target is readonly. +const consoleMock = vi.spyOn(console, 'warn').mockImplementation(() => undefined) +afterEach(() => { + consoleMock.mockReset() +}) + const dataObject = reactive({ data: 10, nested: { data: 1 }, @@ -30,6 +36,18 @@ test('', () => { act(() => result.current.nested.data++) expect(result.current.nested.data).toBe(1) expect(renderCount).toBe(0) + + expect(consoleMock).toHaveBeenCalledTimes(2) + expect(consoleMock).toHaveBeenNthCalledWith( + 1, + `[Vue warn] Set operation on key "data" failed: target is readonly.`, + result.current, + ) + expect(consoleMock).toHaveBeenNthCalledWith( + 2, + `[Vue warn] Set operation on key "data" failed: target is readonly.`, + result.current.nested, + ) }) test('', () => { @@ -54,4 +72,10 @@ test('', () => { act(() => result.current.nested.data++) expect(result.current.nested.data).toBe(2) expect(renderCount).toBe(0) + + expect(consoleMock).toHaveBeenCalledOnce() + expect(consoleMock).toHaveBeenLastCalledWith( + `[Vue warn] Set operation on key "data" failed: target is readonly.`, + result.current, + ) })