-
Notifications
You must be signed in to change notification settings - Fork 62
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 nextjs and TS server hot-reload #1183
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 21068e8 in 20 seconds
More details
- Looked at
71
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_cDA0b2OJketCnO74
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
try { | ||
// some filewatchers don't trigger unless the file is touched. Creating the new dir alone doesn't work. | ||
// if we remove this, TS will still have the old types, and nextjs will not hot-reload. | ||
g.files.map((f) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using map
here is misleading since the result is not used. Consider using forEach
instead for clarity and performance.
g.files.map((f) => { | |
g.files.forEach((f) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on 7c891bc in 18 seconds
More details
- Looked at
21
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_Bxi8RHVYLet6b82v
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
const fpath = path.join(g.output_dir, f.path_in_output_dir) | ||
const currentTime = new Date() | ||
const newTime = new Date(currentTime.getTime() + 100) | ||
utimes(fpath, newTime, newTime, (err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using fs.promises.utimes
for better consistency and error handling.
utimes(fpath, newTime, newTime, (err) => { | |
await fs.promises.utimes(fpath, newTime, newTime) |
Important
Fixes Next.js and TypeScript server hot-reload by changing
restartTSServerOnSave
default and modifying file timestamps.restartTSServerOnSave
default tofalse
inbamlConfig.ts
andpackage.json
.baml_project_manager.ts
to trigger file watchers for hot-reload.utimes
import fromfs
inbaml_project_manager.ts
.This description was created by for 7c891bc. It will automatically update as commits are pushed.