Skip to content
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

Vue 3 Migration #2178

Merged
merged 88 commits into from
Feb 14, 2025
Merged

Vue 3 Migration #2178

merged 88 commits into from
Feb 14, 2025

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented Feb 11, 2025

#2167

Vue 3 Migration

This is the first in a series of PRs that upgrade the web client from Vue 2 to Vue 3. This PR bootstraps the Vue 3 app, configures Vite, updates most of the typescript code to Vue 3 syntax, and updates all Vuetify components for the breaking changes introduced in Vuetify v3 (there are many).

Approach / how are the commits organized?

My plan is to open a series of PRs for the Vue 3 migration, all targeting the vue3-feature-branch branch. Once all the Vue 3 migration work has been merged into that branch, we can merge it into master.

This initial PR has a substantial number of commits. I took care to commit things in the same order that I worked. So, you should be able to more or less follow the exact process that I took to implement this by going in commit order.

The approach I took to doing this migration was the following:

  1. Bootstrap a new Vuetify 3 app in the vue3/ subdirectory, parallel to the existing web/ directory containing the current Vuetify 2 app.
  2. Move each file in the web/ directory (one by one when possible, or in groups in the case of shared components) into the vue3/ subdirectory, applying any changes as needed.
  3. Continue to iterate on the files in the vue3/ until the UI renders properly
  4. Repeat steps 2 and 3 for the whole code base.

Along the way, I kept running the eslint-plugin-vuetify eslint plugin, which automatically applied a lot of the Vuetify changes needed. However, this plugin doesn't account for all the breaking changes, so in many cases I needed to follow the Vuetify 3 upgrade guide an fix things manually.

Finally, there were some cases where Vuetify 3 simply broke things visually (this was the case for a lot of v-row/v-col usage; it appears they've switched away from using Flexbox for those); most of those issues I fixed by hand in the commit titled Fix vuetify styles manually.

Once the vue3-feature-branch is fully converted to Vue 3, I'll rename the vue3/ directory back to the old web/.

Remaining work

To keep the scope/complexity of the PR as low as possible, I left out some other work that needs to be done to completely migrate to Vue 3. These will all be done in follow up PRs to the vue3-feature-branch.

  • Migrate Meditor/VJSF to Vue 3
  • Migrate CopyButton to Vue 3
  • Replace vue-social-sharing package with a Vue 3-compatible alternative
  • Replace vue-cookie-law package with a Vue 3-compatible alternative (or implement this manually, maybe a 3rd party package isn't needed)

Options used:
✔ Project name: … dandi-archive
✔ Which preset would you like to install? › Default (Adds routing, ESLint & SASS variables)
✔ Use TypeScript? … Yes
✔ Would you like to install dependencies with yarn, npm, pnpm, or bun? › yarn
[plugin:vite:vue] <template v-for> key should be placed on the <template> tag.
Uncaught SyntaxError:
The requested module '/node_modules/.vite/deps/filesize.js?v=b525104e' does not provide an export named 'default'
This library is not compatible with Vue 3. Removing temporarily
until a replacement is found.
The `vue-social-sharing` package is not compatible with Vue 3.
We will need to find an alternative package or implement
the functionality ourselves.
This requires a rewrite to work with Vue 3, so it will be done in a
separate PR.
@mvandenburgh mvandenburgh marked this pull request as ready for review February 14, 2025 15:10
@mvandenburgh mvandenburgh merged commit 47b5fbf into vue3-feature-branch Feb 14, 2025
7 of 10 checks passed
@mvandenburgh mvandenburgh deleted the vue3-migration branch February 14, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant