feat: devtools#24
Conversation
✅ Deploy Preview for vue-termui ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
| const app = express() | ||
| app.use('/__open-in-editor', launchMiddleware()) | ||
| app.listen(SERVER_PORT) |
There was a problem hiding this comment.
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.
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)
posva
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.