-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: devtools #24
base: main
Are you sure you want to change the base?
feat: devtools #24
Conversation
✅ Deploy Preview for vue-termui ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov ReportBase: 64.64% // Head: 64.64% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #24 +/- ##
=======================================
Coverage 64.64% 64.64%
=======================================
Files 44 44
Lines 4135 4135
Branches 195 195
=======================================
Hits 2673 2673
Misses 1462 1462 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
} | ||
const app = express() | ||
app.use('/__open-in-editor', launchMiddleware()) | ||
app.listen(SERVER_PORT) |
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.
I reused the @vue/devtools
server instead of create new server.
I think reused the @vue/devtools
server is enough, which that we can also focus all the logic on the devtools package. (I’ve tried reuse the vtui dev server,but it doesn’t work fine)
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
If we move this server to the cli we can probably ensure it's always created before the app starts. It would also ensure only one express app is created even when restarting the app (force reload that isn't yet implemented)
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.
I think creating an extra package is a bit overkill here as we should be able to add it to the CLI and connect to the devtolls automatically without the user needing to add anything.
@@ -0,0 +1,44 @@ | |||
import devtools from '@vue/devtools' | |||
import express from 'express' | |||
// @ts-ignore |
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 add one of these for later:
// @ts-ignore | |
// @ts-ignore: TODO: type the module |
if (process.env.NODE_ENV === 'development') { | ||
import('@vue-termui/devtools').then(({ createDevtools }) => { | ||
createDevtools().connect() | ||
}) | ||
} |
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.
It's weird it needs to be first though 🤔 if it goes after the othor imports, it gives an error about the port being already used
I think there might be some other bugs pending in vue-devtools
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.
I think we should probably find a way to add this directly from the vtui
cli in development and skip it in production. That way the user doesn't need to write anything
title = 'vue-termui devtools', | ||
} = options | ||
|
||
// workaround for @vue/devtools |
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.
This should be fixable in @vue/devtools as it has been done in the past like https://github.com/vuejs/devtools/pull/1780/files
} | ||
const app = express() | ||
app.use('/__open-in-editor', launchMiddleware()) | ||
app.listen(SERVER_PORT) |
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
If we move this server to the cli we can probably ensure it's always created before the app starts. It would also ensure only one express app is created even when restarting the app (force reload that isn't yet implemented)
No description provided.