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

Client-side HMR message types #55009

Merged
merged 11 commits into from Sep 5, 2023
Merged

Conversation

timneutkens
Copy link
Member

Continuation of the previous PRs that introduce HMR event types for the server-side code, this leverages those types client-side too.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team type: next labels Sep 5, 2023
@timneutkens
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

export default function initializeBuildWatcher(
toggleCallback: (cb: (obj: Record<string, any>) => void) => void,
toggleCallback: (handlers: ShowHideHandler) => void,
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed this as previously it relied on building and built faked HMR events which wasn't needed, just a way to show/hide the building indicator.

if (pages.includes(router.query.__NEXT_PAGE)) {
return window.location.reload()
addMessageListener((payload) => {
if ('action' in payload) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the same code as before, the diff is a bit messed up but had to split it by 'action' in payload in order to do type narrowing.

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@timneutkens timneutkens marked this pull request as ready for review September 5, 2023 14:37
Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 1   low 0   info 0 View in Orca

@kodiakhq kodiakhq bot merged commit bf3c3ce into canary Sep 5, 2023
49 of 53 checks passed
@kodiakhq kodiakhq bot deleted the 09-05-Client-side_HMR_message_types branch September 5, 2023 15:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants