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

chore(client)!: remove never implemented hot.decline #11036

Merged
merged 1 commit into from Dec 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/guide/api-hmr.md
Expand Up @@ -30,7 +30,6 @@ interface ViteHotContext {

dispose(cb: (data: any) => void): void
prune(cb: (data: any) => void): void
decline(): void
invalidate(message?: string): void

// `InferCustomEventPayload` provides types for built-in Vite events
Expand Down Expand Up @@ -134,7 +133,7 @@ The `import.meta.hot.data` object is persisted across different instances of the

## `hot.decline()`

Calling `import.meta.hot.decline()` indicates this module is not hot-updatable, and the browser should perform a full reload if this module is encountered while propagating HMR updates.
This is currently a noop and is there for backward compatibility. This could change in the future if there is a new usage for it. To indicate that the module is not hot-updatable, use `hot.invalidate()`.

## `hot.invalidate(message?: string)`

Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/client/client.ts
Expand Up @@ -552,7 +552,8 @@ export function createHotContext(ownerPath: string): ViteHotContext {
pruneMap.set(ownerPath, cb)
},

// TODO
// Kept for backward compatibility (#11036)
// @ts-expect-error untyped
// eslint-disable-next-line @typescript-eslint/no-empty-function
decline() {},

Expand Down
1 change: 0 additions & 1 deletion packages/vite/types/hot.d.ts
Expand Up @@ -23,7 +23,6 @@ export interface ViteHotContext {

dispose(cb: (data: any) => void): void
prune(cb: (data: any) => void): void
decline(): void
invalidate(message?: string): void

on<T extends string>(
Expand Down