Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(types): type hints for hmr events #19579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

94726
Copy link

@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
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.

@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.

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