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

Switch frontend build process from Webpack to Vite #1725

Merged
merged 31 commits into from
Dec 7, 2023
Merged

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented Oct 23, 2023

This PR switches our frontend build process from vue-cli/Webpack to Vite. Vite is the default tooling for Vue 3, so this will help ease the upgrade to that.

The way I did this PR was

  1. Use create-vue to bootstrap a new Vue 2 project with Vite in the vite/ subdirectory
  2. Copy all vue components from web/ to the new vite project in vite/
  3. Copy rest of files to vite/, converting them to their vite equivalents when needed (for example, vue.config.js => vite.config.ts.
  4. Rename vite/ to web/.

Other things to note -

  • The eslint config for the vite app was being applied to the e2e tests as well, as they were located inside the web/test/ subdirectory. This didn't seem to be a problem before as both applications used the same eslint version and build tooling (i.e. vue-cli/Webpack); but now, the main app is using vite while the e2e tests use webpack. To resolve this, I just moved the e2e tests into the root of the repo to the e2e directory.
  • The frontend build process now requires node >= 18 (node 16 is EOL now).

@mvandenburgh mvandenburgh changed the title Switch frontend build process from Webpack to Vite [draft] Switch frontend build process from Webpack to Vite Oct 23, 2023
@mvandenburgh mvandenburgh force-pushed the vite branch 5 times, most recently from 6581c32 to f2e78c0 Compare November 7, 2023 19:15
@mvandenburgh mvandenburgh changed the title [draft] Switch frontend build process from Webpack to Vite Switch frontend build process from Webpack to Vite Nov 7, 2023
@mvandenburgh mvandenburgh force-pushed the vite branch 5 times, most recently from 3759711 to cb639d4 Compare November 7, 2023 21:34
@mvandenburgh mvandenburgh force-pushed the vite branch 3 times, most recently from 678a896 to 818604b Compare November 17, 2023 20:21
@waxlamp
Copy link
Member

waxlamp commented Dec 1, 2023

@mvandenburgh could you remind me of the showstoppers on this one? Are we pinned to a version of one of the libraries for some reason?

@mvandenburgh
Copy link
Member Author

@mvandenburgh could you remind me of the showstoppers on this one? Are we pinned to a version of one of the libraries for some reason?

The current blocker is vue-tsc is misconfigured in some way and is reporting type errors when it shouldn't. I just have to dig into it a bit and figure out why that's happening. But, the actual build works fine as the deploy preview demonstrates.

@mvandenburgh mvandenburgh force-pushed the vite branch 2 times, most recently from ea74efe to 16a6fd9 Compare December 1, 2023 20:52
Options used -
✔ Project name: dandi-archive
✔ Add TypeScript? Yes
✔ Add JSX Support? No
✔ Add Vue Router for Single Page Application development? Yes
✔ Add Pinia for state management? Yes
✔ Add Vitest for Unit Testing? No
✔ Add Cypress for both Unit and End-to-End testing? No
✔ Add ESLint for code quality? Yes
✔ Add Prettier for code formatting? No
@mvandenburgh
Copy link
Member Author

I resolved the type checking issues, so I'll coordinate with the rest of the team on Monday to get this reviewed.

@mvandenburgh mvandenburgh marked this pull request as ready for review December 4, 2023 18:06
Copy link
Member

@jjnesbitt jjnesbitt 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 questions/comments but otherwise makes sense

web/src/components/AppBar/AppBar.vue Show resolved Hide resolved
web/.eslintrc.js Outdated Show resolved Hide resolved
web/components.d.ts Outdated Show resolved Hide resolved
web/env.d.ts Outdated Show resolved Hide resolved
@mvandenburgh mvandenburgh merged commit a1d22a7 into master Dec 7, 2023
10 checks passed
@mvandenburgh mvandenburgh deleted the vite branch December 7, 2023 17:57
@dandibot
Copy link
Member

🚀 PR was released in v0.3.67 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants