Skip to content

Conversation

@94726
Copy link
Contributor

@94726 94726 commented Mar 5, 2025

Description

This adds type hints for hmr event names (hot.on, hot.off, hot.send).
These are pretty much only for QOL as types aren't enforced, to still allow untyped custom events by vite plugins.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 6, 2025
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds a nice addition to me 👍

@sapphi-red
Copy link
Member

/ecosystem-ci run

@sapphi-red sapphi-red changed the title feat: type hints for hmr events feat(types): type hints for hmr events Mar 6, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2025

Open in Stackblitz

npm i https://pkg.pr.new/vite@19579

commit: c364e37

@vite-ecosystem-ci

This comment was marked as outdated.

@vite-ecosystem-ci
Copy link

@sapphi-red sapphi-red added this to the 6.3 milestone Mar 6, 2025
@sapphi-red
Copy link
Member

The SvelteKit error is caused by this line.
https://github.com/sveltejs/kit/blob/75efd882e09ba7a1bd7f617de99b4b1a802c27c9/packages/kit/test/apps/basics/src/routes/load/fetch-asset/%2Bpage.js#L1-L3
#19566 added the module definition and thus this @ts-expect-error is no longer used. So it should be fine.

@sapphi-red sapphi-red merged commit 95424b2 into vitejs:main Mar 19, 2025
19 checks passed
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants