-
-
Notifications
You must be signed in to change notification settings - Fork 341
fix: recreating keyboardShortcuts interface on file changes. #1465
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: recreating keyboardShortcuts interface on file changes. #1465
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Was noticing this too but wouldn't this potentially be a memory leak since we keep creating it?
Yeah, now that I think about it, it really can be. as such there are already existing issues for windows. |
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
const reloadOnChange = createFileReloader(server); | ||
const reloadOnChange = () => { | ||
keyboardShortcuts.start(); | ||
keyboardShortcuts.printHelp({ | ||
canReopenBrowser: | ||
!wxt.config.runnerConfig.config.disabled && !!runner.canOpen?.(), | ||
}); | ||
return createFileReloader(server); | ||
}; | ||
server.watcher.on('all', reloadOnChange); | ||
keyboardShortcuts.start(); | ||
keyboardShortcuts.printHelp({ | ||
canReopenBrowser: | ||
!wxt.config.runnerConfig.config.disabled && !!runner.canOpen?.(), | ||
}); |
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.
One side-effect to this change is that the help message is printed after every file is saved, right? Should we leave the printHelp
call outside the reloadOnChange
where it was before so we only print the message when the server is started/restarted?
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.
Yeah, we can keep it outside, users can see it once when they restart the server.
Vite is also doing the same.
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.
Do we know why the readline interface stops working when a file is saved? Or are we just making a change in hopes that it fixes the problem?
…t into keyboardshortcut-onchange
…t into keyboardshortcut-onchange
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.
Let's merge this and give it a go.
Edit: hmm, for some reason checks aren't running. I'll get the going when I get home.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1465 +/- ##
==========================================
- Coverage 81.27% 80.90% -0.37%
==========================================
Files 130 130
Lines 6642 6642
Branches 1087 1086 -1
==========================================
- Hits 5398 5374 -24
- Misses 1233 1257 +24
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for helping make WXT better! |
Overview
I noticed that keyboard shortcuts weren't working after files were being saved or HMR was triggered.
Hope this fixes it.