Skip to content

Commit

Permalink
Merge branch 'main' into fix/errorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue authored Dec 19, 2023
2 parents baee3a5 + 7c49a9c commit 59eef95
Show file tree
Hide file tree
Showing 48 changed files with 1,275 additions and 370 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@ jobs:
- name: Run ssr unit tests
run: pnpm run test-unit server-renderer

benchmarks:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install

- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
run: pnpm vitest bench --run
token: ${{ secrets.CODSPEED_TOKEN }}

e2e-test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
## [3.3.13](https://github.com/vuejs/core/compare/v3.3.12...v3.3.13) (2023-12-19)


### Bug Fixes

* **compiler-core:** fix v-on with modifiers on inline expression of undefined ([#9866](https://github.com/vuejs/core/issues/9866)) ([bae79dd](https://github.com/vuejs/core/commit/bae79ddf8564a2da4a5365cfeb8d811990f42335)), closes [#9865](https://github.com/vuejs/core/issues/9865)
* **runtime-dom:** cache event handlers by key/modifiers ([#9851](https://github.com/vuejs/core/issues/9851)) ([04d2c05](https://github.com/vuejs/core/commit/04d2c05054c26b02fbc1d84839b0ed5cd36455b6)), closes [#9849](https://github.com/vuejs/core/issues/9849)
* **types:** extract properties from extended collections ([#9854](https://github.com/vuejs/core/issues/9854)) ([24b1c1d](https://github.com/vuejs/core/commit/24b1c1dd57fd55d998aa231a147500e010b10219)), closes [#9852](https://github.com/vuejs/core/issues/9852)



## [3.3.12](https://github.com/vuejs/core/compare/v3.3.11...v3.3.12) (2023-12-16)


### Bug Fixes

* **hydration:** handle appear transition before patch props ([#9837](https://github.com/vuejs/core/issues/9837)) ([e70f4c4](https://github.com/vuejs/core/commit/e70f4c47c553b6e16d8fad70743271ca23802fe7)), closes [#9832](https://github.com/vuejs/core/issues/9832)
* **sfc/cssVars:** fix loss of CSS v-bind variables when setting inline style with string value ([#9824](https://github.com/vuejs/core/issues/9824)) ([0a387df](https://github.com/vuejs/core/commit/0a387dfb1d04afb6eae4296b6da76dfdaca77af4)), closes [#9821](https://github.com/vuejs/core/issues/9821)
* **ssr:** fix suspense hydration of fallback content ([#7188](https://github.com/vuejs/core/issues/7188)) ([60415b5](https://github.com/vuejs/core/commit/60415b5d67df55f1fd6b176615299c08640fa142))
* **types:** add `xmlns:xlink` to `SVGAttributes` ([#9300](https://github.com/vuejs/core/issues/9300)) ([0d61b42](https://github.com/vuejs/core/commit/0d61b429ecf63591d31e09702058fa4c7132e1a7)), closes [#9299](https://github.com/vuejs/core/issues/9299)
* **types:** fix `shallowRef` type error ([#9839](https://github.com/vuejs/core/issues/9839)) ([9a57158](https://github.com/vuejs/core/commit/9a571582b53220270e498d8712ea59312c0bef3a))
* **types:** support for generic keyof slots ([#8374](https://github.com/vuejs/core/issues/8374)) ([213eba4](https://github.com/vuejs/core/commit/213eba479ce080efc1053fe636f6be4a4c889b44))



## [3.3.11](https://github.com/vuejs/core/compare/v3.3.10...v3.3.11) (2023-12-08)


Expand Down
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"version": "3.3.11",
"packageManager": "pnpm@8.11.0",
"version": "3.3.13",
"packageManager": "pnpm@8.12.0",
"type": "module",
"scripts": {
"dev": "node scripts/dev.js",
Expand All @@ -22,6 +22,7 @@
"test-dts": "run-s build-dts test-dts-only",
"test-dts-only": "tsc -p ./packages/dts-test/tsconfig.test.json",
"test-coverage": "vitest -c vitest.unit.config.ts --coverage",
"test-bench": "vitest bench",
"release": "node scripts/release.js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"dev-esm": "node scripts/dev.js -if esm-bundler-runtime",
Expand Down Expand Up @@ -60,38 +61,39 @@
"devDependencies": {
"@babel/parser": "^7.23.5",
"@babel/types": "^7.23.5",
"@codspeed/vitest-plugin": "^2.3.1",
"@rollup/plugin-alias": "^5.0.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@types/hash-sum": "^1.0.2",
"@types/node": "^20.10.3",
"@typescript-eslint/parser": "^6.13.0",
"@vitest/coverage-istanbul": "^0.34.6",
"@types/node": "^20.10.4",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/coverage-istanbul": "^1.0.4",
"@vue/consolidate": "0.17.3",
"conventional-changelog-cli": "^4.1.0",
"enquirer": "^2.4.1",
"esbuild": "^0.19.5",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"eslint-plugin-jest": "^27.6.0",
"estree-walker": "^2.0.2",
"execa": "^8.0.1",
"jsdom": "^22.1.0",
"lint-staged": "^15.1.0",
"jsdom": "^23.0.1",
"lint-staged": "^15.2.0",
"lodash": "^4.17.21",
"magic-string": "^0.30.5",
"markdown-table": "^3.0.3",
"marked": "^9.1.6",
"marked": "^11.0.1",
"minimist": "^1.2.8",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"pretty-bytes": "^6.1.1",
"pug": "^3.0.2",
"puppeteer": "~21.5.2",
"puppeteer": "~21.6.0",
"rimraf": "^5.0.5",
"rollup": "^4.1.4",
"rollup-plugin-dts": "^6.1.0",
Expand All @@ -106,6 +108,6 @@
"tsx": "^4.6.2",
"typescript": "^5.2.2",
"vite": "^5.0.5",
"vitest": "^1.0.0"
"vitest": "^1.0.4"
}
}
4 changes: 4 additions & 0 deletions packages/compiler-core/__tests__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ describe('isMemberExpression', () => {
expect(fn(`123[a]`)).toBe(true)
expect(fn(`foo() as string`)).toBe(false)
expect(fn(`a + b as string`)).toBe(false)
// #9865
expect(fn('""')).toBe(false)
expect(fn('undefined')).toBe(false)
expect(fn('null')).toBe(false)
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-core",
"version": "3.3.11",
"version": "3.3.13",
"description": "@vue/compiler-core",
"main": "index.js",
"module": "dist/compiler-core.esm-bundler.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const isMemberExpressionNode = __BROWSER__
return (
ret.type === 'MemberExpression' ||
ret.type === 'OptionalMemberExpression' ||
ret.type === 'Identifier'
(ret.type === 'Identifier' && ret.name !== 'undefined')
)
} catch (e) {
return false
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-dom",
"version": "3.3.11",
"version": "3.3.13",
"description": "@vue/compiler-dom",
"main": "index.js",
"module": "dist/compiler-dom.esm-bundler.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,6 @@ return { props }
})"
`;

exports[`defineProps > custom element retains the props type w/ production mode 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
export default /*#__PURE__*/_defineComponent({
__name: 'app.ce',
props: {
foo: {type: Number}
},
setup(__props: any, { expose: __expose }) {
__expose();
const props = __props
return { props }
}
})"
`;

exports[`defineProps > defineProps w/ runtime options 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-sfc",
"version": "3.3.11",
"version": "3.3.13",
"description": "@vue/compiler-sfc",
"main": "dist/compiler-sfc.cjs.js",
"module": "dist/compiler-sfc.esm-browser.js",
Expand Down
1 change: 1 addition & 0 deletions packages/compiler-sfc/src/script/resolveType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ export function inferRuntimeType(
scope
)
}
break
case 'TSMethodSignature':
case 'TSFunctionType':
return ['Function']
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-ssr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-ssr",
"version": "3.3.11",
"version": "3.3.13",
"description": "@vue/compiler-ssr",
"main": "dist/compiler-ssr.cjs.js",
"types": "dist/compiler-ssr.d.ts",
Expand Down
23 changes: 23 additions & 0 deletions packages/dts-test/reactivity.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ describe('should unwrap Map correctly', () => {
expectType<number>(wm2.get({})!.wrap)
})

describe('should unwrap extended Map correctly', () => {
class ExtendendMap1 extends Map<string, { wrap: Ref<number> }> {
foo = ref('foo')
bar = 1
}

const emap1 = reactive(new ExtendendMap1())
expectType<string>(emap1.foo)
expectType<number>(emap1.bar)
expectType<number>(emap1.get('a')!.wrap)
})

describe('should unwrap Set correctly', () => {
const set = reactive(new Set<Ref<number>>())
expectType<Set<Ref<number>>>(set)
Expand All @@ -90,3 +102,14 @@ describe('should unwrap Set correctly', () => {
const ws2 = reactive(new WeakSet<{ wrap: Ref<number> }>())
expectType<WeakSet<{ wrap: number }>>(ws2)
})

describe('should unwrap extended Set correctly', () => {
class ExtendendSet1 extends Set<{ wrap: Ref<number> }> {
foo = ref('foo')
bar = 1
}

const eset1 = reactive(new ExtendendSet1())
expectType<string>(eset1.foo)
expectType<number>(eset1.bar)
})
34 changes: 31 additions & 3 deletions packages/dts-test/ref.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ const state = reactive({

expectType<string>(state.foo.label)

describe('ref with generic', <T extends { name: string }>() => {
const r = {} as T
const s = ref(r)
expectType<string>(s.value.name)

const rr = {} as MaybeRef<T>
// should at least allow casting
const ss = ref(rr) as Ref<T>
expectType<string>(ss.value.name)
})

// shallowRef
type Status = 'initial' | 'ready' | 'invalidating'
const shallowStatus = shallowRef<Status>('initial')
Expand Down Expand Up @@ -201,11 +212,28 @@ if (refStatus.value === 'initial') {
expectType<IsAny<typeof a>>(false)
}

describe('shallowRef with generic', <T>() => {
const r = ref({}) as MaybeRef<T>
expectType<ShallowRef<T> | Ref<T>>(shallowRef(r))
describe('shallowRef with generic', <T extends { name: string }>() => {
const r = {} as T
const s = shallowRef(r)
expectType<string>(s.value.name)
expectType<ShallowRef<T>>(shallowRef(r))

const rr = {} as MaybeRef<T>
// should at least allow casting
const ss = shallowRef(rr) as Ref<T> | ShallowRef<T>
expectType<string>(ss.value.name)
})

{
// should return ShallowRef<T> | Ref<T>, not ShallowRef<T | Ref<T>>
expectType<ShallowRef<{ name: string }> | Ref<{ name: string }>>(
shallowRef({} as MaybeRef<{ name: string }>)
)
expectType<ShallowRef<number> | Ref<string[]> | ShallowRef<string>>(
shallowRef('' as Ref<string[]> | string | number)
)
}

// proxyRefs: should return `reactive` directly
const r1 = reactive({
k: 'v'
Expand Down
Loading

0 comments on commit 59eef95

Please sign in to comment.