-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate from vue-cli to vite #23
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
Conversation
|
@codex review |
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.
💡 Codex Review
morphocluster/morphocluster/frontend/src/views/Bisect.vue
Lines 325 to 333 in 4c413f4
| mounted() { | |
| window.addEventListener("keypress", this.keypress); | |
| this.setupNodeIntersectionObserver(); | |
| }, | |
| beforeDestroy() { | |
| window.removeEventListener("keypress", this.keypress); | |
| if (this.nodeObserver) { | |
| this.nodeObserver.disconnect(); | |
| } |
The migration replaces Vue 2 with Vue 3, but BisectView still declares the lifecycle hook as beforeDestroy. In the standard Vue 3 build this hook name is no longer invoked, so the global keypress listener and the IntersectionObserver registered in mounted are never removed. Navigating away from and back to the view keeps adding listeners, causing duplicated keypress handling and leaked observers. Rename the hook to beforeUnmount so the teardown code executes.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review the new commit |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| base: '/morphocluster/frontend/', | ||
| resolve: { | ||
| alias: { | ||
| '@': fileURLToPath(new URL('./src', import.meta.url)) | ||
| } | ||
| }, | ||
| server: { | ||
| port: 8080, | ||
| proxy: { | ||
| '/labeling': { | ||
| target: 'http://localhost:5000', | ||
| changeOrigin: true, | ||
| ws: true | ||
| }, | ||
| '/config.js': { | ||
| target: 'http://localhost:5000', | ||
| changeOrigin: true | ||
| }, | ||
| '/static': { | ||
| target: 'http://localhost:5000', | ||
| changeOrigin: true | ||
| }, | ||
| '/api': { | ||
| target: 'http://localhost:5000', | ||
| changeOrigin: true, | ||
| ws: true | ||
| }, | ||
| '/get_obj_image': { | ||
| target: 'http://localhost:5000', | ||
| changeOrigin: true | ||
| } |
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.
Prefix proxy contexts with Vite base path
The dev server sets base: '/morphocluster/frontend/', so the browser will request config.js, static, and get_obj_image under /morphocluster/frontend/…. The proxy configuration still matches only /config.js, /static, and /get_obj_image, which means these requests no longer hit the backend in dev—they fall through to Vite and 404. In Vue CLI this worked because the webpack dev server stripped publicPath before applying proxies, but Vite does not. Either remove the base prefix from the requests (e.g. load /config.js in index.html) or update the proxy keys to include /morphocluster/frontend/… so that config and static assets load during development.
Useful? React with 👍 / 👎.
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
No description provided.