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 + vue cli to vue3 + vitejs #199

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

Conversation

ZaynChen
Copy link
Contributor

this PR upgrade project to Vue 3 + Vitejs.

Note

  • This needs more testing before merging it, but it just works on my machine.

Dependencies changes

  • Vue2 -> Vue3
  • Vue CLI -> Vitejs

Changes

  • Rewrite vue components in Composition API style(<script setup>).
  • Remove secondary.html
  • settings, backgroud, color are wrapped by ref and reactive. They are global reactive now, and watchers are setup to automatically save the new settings, background, color to localstorage once their value changes, so we don't need to manually call localstorage to save them in Setup, Theming pages, just change their value, and let the watchers do the rest.
  • using new URL(imagepath, import.meta.url).href to deal with static assets(images), so that vitejs can automatically resolve them and copy the corresponding assets to dist dir when build. Otherwise, the assets need to place under the public dir. Note that import.meta.url is module specific, so I've using getImageUrl in some different files.
  • router history using createWebHashHistory()(hash mode). If using createWebHistory() (html5 mode), the webkit2gtk 2.40+ will raise the SecurityError
  • getLocal now using the settings.user.language to produce lang, this fix wrong language detection when lightdm.language is a language name string. user.language is a language code(zh_CN.UTF-8 on my archlinux), which comes from lightdm.users. But this may need more test to confirm(maybe user.language is only on my system)

Test

I test it on my arch linux pc, and it just works, below is my machine environment.

Environment

  • lightdm 1:1.32.0-4
  • lightdm-webkit2-greeter 2.2.5-6
  • webkit2gtk 2.40.1-1
  • webkit2gtk-4.1 2.40.1-1

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