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
Migrate to vue3 #1034
Migrate to vue3 #1034
Conversation
4d45907
to
461c039
Compare
66b7c93
to
b90f207
Compare
ebcccd5
to
bc66159
Compare
Ready for review |
bc66159
to
5a632da
Compare
rebased |
There was a weird issue with indexedDB, in which the db transactions were not completing. So there's a workaround. According to issues I've been reading in the Apparently, I noticed that the |
705b58b
to
4a02ae0
Compare
I see the warnings too. The |
I could also help take a look if I can fix this, if you don't mind. |
After the fix for |
It should be fixed now |
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.
from my point of view stuff works, and I cannot spot anything in the code.
All i can spot in the build are these warnings:
emcc: warning: warnings in JS library compilation [-Wjs-compiler]
emcc: warning: running limited binaryen optimizations because DWARF info requested (or indirectly required) [-Wlimited-postlink-optimizations]
vite v4.2.0 building for production...
✓ 490 modules transformed.
rendering chunks (60)...warnings when minifying css:
▲ [WARNING] Unexpected ";" [css-syntax-error]
<stdin>:10223:1:
10223 │ };
╵ ^
about the css warning @hannyle pointed out these lines: https://github.com/CSCfi/swift-browser-ui/blob/feature/vue3/swift_browser_ui_frontend/src/components/SearchResultItem.vue#L106-L109 |
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.
from my point of view it works, but please wait for other reviewers
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'm experiencing a bug, where after login the navbar is partially empty because the username wasn't in the URL from the beginning, maybe it's breaking reactivity? After refreshing everything is properly rendered, but if I manually navigate to /browse
again, the bug is repeated.
It might have something to do with router being more strict about the router parameters, complaining that the initial /browse
doesn't have those defined while some component tries accessing them.
I noticed that bug as well, I think @csc-felipe created a separate issue for it? |
Seems like it, thanks for the info 👍🏼 |
These issues are because of the reactivity model in Vue3, and it wraps everything with The trick is to use |
Makes me think that we may not even need the workaround... But well, it's a good workaround anyway |
What it means is that the array with tags, for example, becomes a |
I wonder why it happens only with Edit tags but not with creating folder or copy folder? Or maybe Share Modal when we change the list of Shared IDs ? |
It happens only when the Proxy object is passed to Dexie, and Dexie tries to do something with it. And I exagerated that everything becomes a reactive proxy object. This same case probably doesn't apply to the previous issue. |
Vue wraps the tags array into a proxy, and dexie was crashing. Using toRaw(this.tags) returns the actual array.
That's hopefully fixed now! |
Yes it's fixed 👍 |
I'm not sure I understand the suggestion to use |
Well that's true, hm.. 🤔 |
It should be fixed now. |
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.
Looks good to me! Great job! 🎉
Bugfix/fix search issues Closes #1034 See merge request sds-dev/sd-connect/swift-browser-ui!55
Description
Migrate vue2 → vue3.
Most of the breaking changes don't apply to our code, so it's not such a big code change. But still quite a large PR.
https://v3-migration.vuejs.org/breaking-changes/#template-directives
https://v3-migration.vuejs.org/breaking-changes/v-model.html
https://vuejs.org/guide/reusability/custom-directives.html#directive-hooks
Related issues
GL 943
needs #982 #1006Type of change
Changes Made
LAST_ACTIVE
cookie reference, as it's not being set anywhere:query
instead ofv-model
toRaw()
fromvue
Testing
Mentions
In VSCode, the Vue extension change from Vetur to Volar. So you might want to update your setup.
Also, remember to
pnpm install
to update the libraries.Vue development browser extension now works