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

fix(dev): fix hot-reload with e2e test #1021

Merged
merged 24 commits into from
Nov 30, 2024
Merged

fix(dev): fix hot-reload with e2e test #1021

merged 24 commits into from
Nov 30, 2024

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Nov 28, 2024

fix #1016

It's a regression with various changes. Adding the e2e test will help for the future.

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
waku ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2024 0:55am

Copy link

codesandbox-ci bot commented Nov 28, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi dai-shi changed the title chore(tests): hot-reload e2e test fix(dev): fix hot-reload with e2e test Nov 28, 2024
@@ -225,7 +225,6 @@ export const fsRouterTypegenPlugin = (opts: { srcDir: string }): Plugin => {
await writeFile(outputFile, formatted, 'utf-8');
};

server.watcher.add(opts.srcDir);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Removing this fixes the issue of failing on windows and ubuntu. @tylersayshi

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we did server.watcher.add(pagesDir) instead? .gen.ts will be outside the pages dir so this should be fine I'd think

Copy link
Owner Author

Choose a reason for hiding this comment

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

We can try, but is removing this a problem? It still generates .gen.ts file.

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea for adding it here is that it will updates pages.gen.ts when new pages are added or removed. Without the watcher I don't think it will be able to update while the dev server is running. Just on startup only.

Copy link
Contributor

Choose a reason for hiding this comment

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

works on mac... I'll watch to see if the other tests pass but I expect them to 🤞

#1023

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like it passed 🎉

@dai-shi dai-shi marked this pull request as ready for review November 29, 2024 12:55
return code.replace(
INNER_ROUTER_LINE,
INNER_ROUTER_LINE +
/\nconst InnerRouter = \(.*?\)=>\{/,
Copy link
Owner Author

Choose a reason for hiding this comment

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

We need to change this to NewInnerRouter for #1003.

Copy link
Owner Author

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Let's merge.

@dai-shi dai-shi merged commit ed90c54 into main Nov 30, 2024
26 checks passed
@dai-shi dai-shi deleted the chore/test/hot-reload branch December 1, 2024 08:39
This was referenced Dec 2, 2024
dai-shi added a commit that referenced this pull request Dec 3, 2024
#1021 was incomplete. This should fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hot reloading doesn't work even in the reference example
2 participants