]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: Merge branch 'main' into minor
authorEvan You <yyx990803@gmail.com>
Tue, 21 Nov 2023 01:48:26 +0000 (09:48 +0800)
committerEvan You <yyx990803@gmail.com>
Tue, 21 Nov 2023 01:48:26 +0000 (09:48 +0800)
26 files changed:
1  2 
CHANGELOG.md
package.json
packages/compiler-core/package.json
packages/compiler-dom/package.json
packages/compiler-sfc/package.json
packages/compiler-sfc/src/index.ts
packages/compiler-sfc/src/script/defineProps.ts
packages/compiler-sfc/src/script/resolveType.ts
packages/compiler-ssr/package.json
packages/reactivity-transform/package.json
packages/reactivity/package.json
packages/reactivity/src/baseHandlers.ts
packages/reactivity/src/collectionHandlers.ts
packages/reactivity/src/reactive.ts
packages/reactivity/src/ref.ts
packages/runtime-core/__tests__/apiWatch.spec.ts
packages/runtime-core/package.json
packages/runtime-core/src/apiWatch.ts
packages/runtime-core/src/componentPublicInstance.ts
packages/runtime-core/src/components/BaseTransition.ts
packages/runtime-core/src/renderer.ts
packages/runtime-dom/package.json
packages/server-renderer/package.json
packages/vue-compat/package.json
packages/vue/package.json
scripts/release.js

diff --cc CHANGELOG.md
index 858b722d1923bb6430f07fed98c59bb2367dc628,bf0c8591f54949351c23fef96e522c4298ecf57b..5863fc31aa6a2dba80c261194dc5bcb3e4fe773d
@@@ -1,16 -1,19 +1,32 @@@
+ ## [3.3.8](https://github.com/vuejs/core/compare/v3.3.7...v3.3.8) (2023-11-06)
+ ### Bug Fixes
+ * **compile-sfc:** support `Error` type in `defineProps` ([#5955](https://github.com/vuejs/core/issues/5955)) ([a989345](https://github.com/vuejs/core/commit/a9893458ec519aae442e1b99e64e6d74685cd22c))
+ * **compiler-core:** known global should be shadowed by local variables in expression rewrite ([#9492](https://github.com/vuejs/core/issues/9492)) ([a75d1c5](https://github.com/vuejs/core/commit/a75d1c5c6242e91a73cc5ba01e6da620dea0b3d9)), closes [#9482](https://github.com/vuejs/core/issues/9482)
+ * **compiler-sfc:** fix dynamic directive arguments usage check for slots ([#9495](https://github.com/vuejs/core/issues/9495)) ([b39fa1f](https://github.com/vuejs/core/commit/b39fa1f8157647859331ce439c42ae016a49b415)), closes [#9493](https://github.com/vuejs/core/issues/9493)
+ * **deps:** update dependency @vue/repl to ^2.6.2 ([#9536](https://github.com/vuejs/core/issues/9536)) ([5cef325](https://github.com/vuejs/core/commit/5cef325f41e3b38657c72fa1a38dedeee1c7a60a))
+ * **deps:** update dependency @vue/repl to ^2.6.3 ([#9540](https://github.com/vuejs/core/issues/9540)) ([176d590](https://github.com/vuejs/core/commit/176d59058c9aecffe9da4d4311e98496684f06d4))
+ * **hydration:** fix tagName access eeror on comment/text node hydration mismatch ([dd8a0cf](https://github.com/vuejs/core/commit/dd8a0cf5dcde13d2cbd899262a0e07f16e14e489)), closes [#9531](https://github.com/vuejs/core/issues/9531)
+ * **types:** avoid exposing lru-cache types in generated dts ([462aeb3](https://github.com/vuejs/core/commit/462aeb3b600765e219ded2ee9a0ed1e74df61de0)), closes [#9521](https://github.com/vuejs/core/issues/9521)
+ * **warn:** avoid warning on empty children with Suspense ([#3962](https://github.com/vuejs/core/issues/3962)) ([405f345](https://github.com/vuejs/core/commit/405f34587a63a5f1e3d147b9848219ea98acc22d))
 +# [3.4.0-alpha.1](https://github.com/vuejs/core/compare/v3.3.7...v3.4.0-alpha.1) (2023-10-28)
 +
 +
 +### Features
 +
 +* **compiler-core:** export error message ([#8729](https://github.com/vuejs/core/issues/8729)) ([f7e80ee](https://github.com/vuejs/core/commit/f7e80ee4a065a9eaba98720abf415d9e87756cbd))
 +* **compiler-sfc:** expose resolve type-based props and emits ([#8874](https://github.com/vuejs/core/issues/8874)) ([9e77580](https://github.com/vuejs/core/commit/9e77580c0c2f0d977bd0031a1d43cc334769d433))
 +* export runtime error strings ([#9301](https://github.com/vuejs/core/issues/9301)) ([feb2f2e](https://github.com/vuejs/core/commit/feb2f2edce2d91218a5e9a52c81e322e4033296b))
 +* **reactivity:** more efficient reactivity system ([#5912](https://github.com/vuejs/core/issues/5912)) ([16e06ca](https://github.com/vuejs/core/commit/16e06ca08f5a1e2af3fc7fb35de153dbe0c3087d)), closes [#311](https://github.com/vuejs/core/issues/311) [#1811](https://github.com/vuejs/core/issues/1811) [#6018](https://github.com/vuejs/core/issues/6018) [#7160](https://github.com/vuejs/core/issues/7160) [#8714](https://github.com/vuejs/core/issues/8714) [#9149](https://github.com/vuejs/core/issues/9149) [#9419](https://github.com/vuejs/core/issues/9419) [#9464](https://github.com/vuejs/core/issues/9464)
 +* **runtime-core:** add `once` option to watch ([#9034](https://github.com/vuejs/core/issues/9034)) ([a645e7a](https://github.com/vuejs/core/commit/a645e7aa51006516ba668b3a4365d296eb92ee7d))
 +
 +
 +
  ## [3.3.7](https://github.com/vuejs/core/compare/v3.3.6...v3.3.7) (2023-10-24)
  
  
diff --cc package.json
index 1655ff8b546139cd5cf3c77eb9dde4a64dbd28f4,59d405b8a155b0cd7ca7ccd6302be858e1d11c71..7f0a46bc14d729bab52a27696b5ed3357d16bb33
@@@ -1,7 -1,7 +1,7 @@@
  {
    "private": true,
 -  "version": "3.3.8",
 +  "version": "3.4.0-alpha.1",
-   "packageManager": "pnpm@8.9.2",
+   "packageManager": "pnpm@8.10.5",
    "type": "module",
    "scripts": {
      "dev": "node scripts/dev.js",
Simple merge
Simple merge
Simple merge
Simple merge
index 12666341e73d2080513a410e5b842686a3d4e4e7,cf96007beee4ce4b9a573bccd03be4be0ccd6bc9..9fde5e97e5e5e9a33992569c45aab7573a9533f6
@@@ -39,16 -39,10 +39,17 @@@ import { parse as babelParse } from '@b
  import { parse } from '../parse'
  import { createCache } from '../cache'
  import type TS from 'typescript'
- import { extname, dirname } from 'path'
+ import { extname, dirname, join } from 'path'
  import { minimatch as isMatch } from 'minimatch'
+ import * as process from 'process'
  
 +export type SimpleTypeResolveOptions = Partial<
 +  Pick<
 +    SFCScriptCompileOptions,
 +    'globalTypeFiles' | 'fs' | 'babelParserPlugins' | 'isProd'
 +  >
 +>
 +
  /**
   * TypeResolveContext is compatible with ScriptCompileContext
   * but also allows a simpler version of it with minimal required properties
Simple merge
Simple merge
Simple merge
index 5a4dd710eab8a57f095d2b4ac16235d19610bec7,201766158ed167a43d8d5cb137c48122bbcc78a6..705d442dcfd03e92b4de65460b4d4eb9d6d75bae
@@@ -1,10 -1,12 +1,11 @@@
+ import type { ComputedRef } from './computed'
  import {
    activeEffect,
 -  getDepFromReactive,
    shouldTrack,
 -  trackEffects,
 +  trackEffect,
    triggerEffects
  } from './effect'
 -import { TrackOpTypes, TriggerOpTypes } from './operations'
 +import { DirtyLevels, TrackOpTypes, TriggerOpTypes } from './constants'
  import { isArray, hasChanged, IfAny, isFunction, isObject } from '@vue/shared'
  import {
    isProxy,
index bddfc5ff541cdf298ece965d274ba96daabf00f2,48fdd2888ec02df65bddca2e9513925a8bf2d0e2..1bc012bb36b5a6eb527206faba4b1f434fd9bd35
@@@ -1206,41 -1206,38 +1206,76 @@@ describe('api: watch', () => 
      expect(countW).toBe(2)
    })
  
 +  const options = [
 +    { name: 'only trigger once watch' },
 +    {
 +      deep: true,
 +      name: 'only trigger once watch with deep'
 +    },
 +    {
 +      flush: 'sync',
 +      name: 'only trigger once watch with flush: sync'
 +    },
 +    {
 +      flush: 'pre',
 +      name: 'only trigger once watch with flush: pre'
 +    },
 +    {
 +      immediate: true,
 +      name: 'only trigger once watch with immediate'
 +    }
 +  ] as const
 +  test.each(options)('$name', async option => {
 +    const count = ref(0)
 +    const cb = vi.fn()
 +
 +    watch(count, cb, { once: true, ...option })
 +
 +    count.value++
 +    await nextTick()
 +
 +    expect(count.value).toBe(1)
 +    expect(cb).toHaveBeenCalledTimes(1)
 +
 +    count.value++
 +    await nextTick()
 +
 +    expect(count.value).toBe(2)
 +    expect(cb).toHaveBeenCalledTimes(1)
 +  })
++
+   // #5151
+   test('OnCleanup also needs to be cleaned,', async () => {
+     const spy1 = vi.fn()
+     const spy2 = vi.fn()
+     const num = ref(0)
+     watch(num, (value, oldValue, onCleanup) => {
+       if (value > 1) {
+         return
+       }
+       spy1()
+       onCleanup(() => {
+         // OnCleanup also needs to be cleaned
+         spy2()
+       })
+     })
+     num.value++
+     await nextTick()
+     expect(spy1).toHaveBeenCalledTimes(1)
+     expect(spy2).toHaveBeenCalledTimes(0)
+     num.value++
+     await nextTick()
+     expect(spy1).toHaveBeenCalledTimes(1)
+     expect(spy2).toHaveBeenCalledTimes(1)
+     num.value++
+     await nextTick()
+     // would not be calld when value>1
+     expect(spy1).toHaveBeenCalledTimes(1)
+     expect(spy2).toHaveBeenCalledTimes(1)
+   })
  })
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 36a304877c14772b40180d1622a2978b757ebefa,10623eedb7518d9a85cabb8ce0dfef98103ef63d..a9484ff5f45d621f34ac13a474132798e0a85fab
@@@ -335,10 -333,22 +343,22 @@@ async function isInSyncWithRemote() 
        `https://api.github.com/repos/vuejs/core/commits/${branch}?per_page=1`
      )
      const data = await res.json()
-     return data.sha === (await getSha())
 -    if (data.sha === sha) {
++    if (data.sha === (await getSha())) {
+       return true
+     } else {
+       // @ts-ignore
+       const { yes } = await prompt({
+         type: 'confirm',
+         name: 'yes',
+         message: pico.red(
+           `Local HEAD is not up-to-date with remote. Are you sure you want to continue?`
+         )
+       })
+       return yes
+     }
    } catch (e) {
      console.error(
-       'Failed to check whether local HEAD is up-to-date with remote.'
+       pico.red('Failed to check whether local HEAD is up-to-date with remote.')
      )
      return false
    }
@@@ -420,10 -417,11 +435,10 @@@ async function publishPackage(pkgName, 
          ...(releaseTag ? ['--tag', releaseTag] : []),
          '--access',
          'public',
 -        ...(isDryRun ? ['--dry-run'] : []),
 -        ...(skipGit ? ['--no-git-checks'] : [])
 +        ...additionalFlags
        ],
        {
-         cwd: pkgRoot,
+         cwd: getPkgRoot(pkgName),
          stdio: 'pipe'
        }
      )