-
Notifications
You must be signed in to change notification settings - Fork 22
Switch from vue-cli to vite #1026
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
base: main
Are you sure you want to change the base?
Conversation
695e0a4
to
1222921
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1026 +/- ##
=======================================
Coverage 74.84% 74.84%
=======================================
Files 67 67
Lines 4631 4631
=======================================
Hits 3466 3466
Misses 1165 1165 🚀 New features to boost your workflow:
|
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
webapp/package.json
Outdated
"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
webapp/vue.config.js
Outdated
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
|
Project |
datalab
|
Branch Review |
bc/switch-to-vite
|
Run status |
|
Run duration | 08m 48s |
Commit |
|
Committer | Ben Charmes |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
15
|
|
0
|
|
0
|
|
0
|
|
408
|
View all changes introduced in this branch ↗︎ |
Tests for review
ChemicalFormulaTest.cy.jsx • 1 failed test • Component tests (chrome)
Test | Artifacts | |
---|---|---|
ChemFormulaInput > renders single element formula correctly |
Test Replay
Screenshots
|
CollectionTableTest.cy.jsx • 1 failed test • Component tests (chrome)
Test | Artifacts | |
---|---|---|
An uncaught error was detected outside of a test |
Test Replay
Screenshots
|
EquipmentTableTest.cy.jsx • 1 failed test • Component tests (chrome)
Test | Artifacts | |
---|---|---|
An uncaught error was detected outside of a test |
Test Replay
Screenshots
|
SampleTableTest.cy.jsx • 1 failed test • Component tests (chrome)
Test | Artifacts | |
---|---|---|
An uncaught error was detected outside of a test |
Test Replay
Screenshots
|
StartingMaterialTableTest.cy.jsx • 1 failed test • Component tests (chrome)
Test | Artifacts | |
---|---|---|
An uncaught error was detected outside of a test |
Test Replay
Screenshots
|
The first 5 failed specs are shown, see all 15 specs in Cypress Cloud.
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
60265fe
to
42c34e9
Compare
42c34e9
to
e893628
Compare
I've pushed a bit further on this in the last few commits, though its really unsatisfactory still. The component tests rae failing with
Of the remaining failures, the |
…js allows test to pass
See e.g. 337b718 for the fix required to |
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