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

Migrate from Vue2 to Vue3 #42

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Migrate from Vue2 to Vue3 #42

wants to merge 21 commits into from

Conversation

s-egge
Copy link
Member

@s-egge s-egge commented Dec 12, 2024

This started as a dependency update, but the majority of vulnerabilities were in dependencies related to Vue CLI. Migrating from Vue CLI to Vite took the vulnerabilities from over 100 down to under 20. This PR will have a LOT of changes.

Vue CLI to Vite

I followed this tutorial for migrating to Vite, at the recommendation of the Vue3 documentation. They also recommend migrating from Vuex to Pinia, which was created as a prototype for Vuex 5, but that should probably be saved for another PR.

Prettier / ESLint

  • Babel is no longer needed
  • I added the ESLint and Prettier rules from the Energy Dashboard, so there are some changes that are just in the formatting.

Incompatible Libraries

  • vue2-leaflet -> vue-leaflet
  • vue-svg-loader -> vite-svg-loader
  • ElementUI -> ElementPlus

TODO

  • Vue2 -> Vue3

    • Sass (@import is deprecated)
      • We can still do global variables with @use in the vite config, but we needed to update all of the SCSS variables to start with $ instead of $--, otherwise they would not be recognized.
    • Element-UI -> ElementPlus
      • Navbar
      • sideView
      • popup
      • map
  • Merge main after this PR is approved.

  • Update README with new library docs

@s-egge s-egge linked an issue Dec 12, 2024 that may be closed by this pull request
@s-egge
Copy link
Member Author

s-egge commented Dec 23, 2024

There are still two warnings in the console, they are from the leaflet library so we cannot fix them at this time. image

Copy link

@brandovlee brandovlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor adjustments that should be made before merging. See comments.

src/store/index.js Show resolved Hide resolved
vite.config.mjs Show resolved Hide resolved
README.md Show resolved Hide resolved
src/components/navBar.vue Show resolved Hide resolved
package.json Show resolved Hide resolved
- Override xmldom to fix vulnerability
- Update README
- Minor formatting
- fix SVG warning in Chrome browser
@s-egge s-egge marked this pull request as ready for review December 30, 2024 18:50
@s-egge
Copy link
Member Author

s-egge commented Dec 30, 2024

ESLint 8.x is deprecated which has lead to some deprecation warnings (no vulnerabilities), but it's a dependency for some libraries that seem like they aren't being maintained any more. I made an issue for this as well to work on in a separate PR since this one is getting very large.

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.

Dependencies Update
2 participants