-
Notifications
You must be signed in to change notification settings - Fork 17
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
Switch from vue-cli to vite #1026
base: main
Are you sure you want to change the base?
Conversation
695e0a4
to
1222921
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1026 +/- ##
=======================================
Coverage 70.04% 70.04%
=======================================
Files 62 62
Lines 3996 3996
=======================================
Hits 2799 2799
Misses 1197 1197 |
52e306e
to
5cbd538
Compare
42814f6
to
7bb9e9f
Compare
da60bee
to
5a7a0d7
Compare
First attempt to switch from vue-cli to vite Remove a 'process' that I missed Fix a few thing to make vite work Fix a few thing to make vite work Fix a few thing to make vite work Downgrade Bokeh to 2.4.0 Downgrade tinymce to v5 Temp commit Update yarn build with vite Update yarn build with vite Update yarn build with vite Update yarn build with vite Update docker build for vite Add serve into package.json Update env variable fron VUE_ to VITE_
2fa241e
to
ba6115f
Compare
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.
Comments for myself:
- check docker build version info with vite
- think about migrating env vars too
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.
Thanks @BenjaminCharmes, great to remove 4000 lines from our lockfile, though we might need to review some of the deps upgrades carefully to make sure they still work. Some initial comments below
@@ -1,10 +1,10 @@ | |||
import { createStore } from "vuex"; | |||
import UserBubbleLogin from "@/components/UserBubbleLogin.vue"; | |||
import NotificationDot from "@/components/NotificationDot.vue"; | |||
import crypto from "crypto"; | |||
import MD5 from "crypto-js/md5"; |
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.
Think we need to be careful here too, I had a lot of fun getting the crypto-browserify stuff to work recently. The crypto-js library itself is deprecated (see README here: https://www.npmjs.com/package/crypto-js) -- we may need another solution
"serve": "^14.2.1", | ||
"qrcode-vue3": "^1.7.1", | ||
"redis": "^4.7.0", | ||
"serve": "^14.2.4", | ||
"stream-browserify": "^3.0.0", |
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.
We may not need stream-browserify anymore
args[0].meta = { | ||
x_datalab_api_url: process.env.VUE_APP_API_URL, | ||
}; |
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.
This is used by the client code quite a lot, we should make sure that the equivalent is done with vite too (I couldn't see it above), should be doable in the same way as the website title
datalab Run #2890
Run Properties:
|
Project |
datalab
|
Branch Review |
bc/switch-to-vite
|
Run status |
Errored #2890
|
Run duration | 02m 01s |
Commit |
db47357ce4 ℹ️: Merge d8f1254aad43c50b08118e4365879ba87a4c9433 into 7e63cdd881e18e08c30fff6e1332...
|
Committer | Ben Charmes |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
15
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
0
|
View all changes introduced in this branch ↗︎ |
Fix aliases in package.json
…lt title in index.html
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.
Two things left:
- fix whatever is going on with
cypress/support/e2e.js
(maybe just try removing it) - at some point, update our package.json so that it launches the dev server for you before running tests, as vue-cli did
Closes #1005
First attempt to switch from vue-cli to vite and a few things to discuss:
I had to use
cryptojs
instead ofcrypto
(MD5(value).toString();
instead ofcrypto.createHash("md5").update(value).digest("hex");
)I had to use
import.meta.env.BASE_URL
instead ofprocess.env.BASE_URL
I remove
.browserslistrc
andbabel.config.js
, not useful with vite ?vite 6.x.x
not supported bycypress
? (warning message)In
vite.config.js
, I useextensions: [".vue", ".js", ".json"]
to not rename all the imports in all the files, but it could be better to take the time to do it ? (e.g.import Navbar from "@/components/Navbar";
toimport Navbar from "@/components/Navbar.vue";
Had to rename env variables from
VUE_
toVITE_
to make it work without having to import all of them. Should we keep it that way (and also rename them where ever it's needed, e.g. github?) or just import them in the vite.config.js ?To do:
package.json
?Bokeh
.Just need to downgrade to Bokeh 2.4.0
import "tinymce/plugins/hr";
not workingDowngrade tinymce to v5