A React project built with Vite. It features TypeScript.
I scaffolded this project with npm's awesome init
command in combination
with Vite's init
initializer which let me easily declare "I want a React and TypeScript project". Very cool. I wish
Gradle had this feature. I'm sure they have been thinking about it for a long time and will one day get it. Here is the
related Gradle feature request.
Follow these instructions to build and serve the app:
- Pre-requisite: Node.js
- I used version 18.16.0
- Install dependencies:
-
npm install
-
- Run the server:
-
npm run dev
-
- Open the browser:
Vite is nice. Vite uses esbuild though? In my continual quest to prevent and reduce complexity, I feel like I should use esbuild directly. And it's also a little surprising that esbuild is still a 0.x release. In a lot of cases, 0.x is actually very stable and for whatever reason the authors haven't prioritized a 1.0 release (as is their right), but this makes it harder to commit at face value.
General clean-ups, todos and things I wish to implement for this project:
- What is the Vite way to do CSS? Do we bundle the CSS into the JavaScript bundle file (the Webpack way)?
- DONE Upgrade React
- DONE Upgrade to Vite 3.x
- Very cool that there is a migration guide. The documentation culture of front-end open source is very good. Link: https://v3.vitejs.dev/guide/migration.html. It's interesting that there are entirely different Vite doc sites. That means it reduces that chances of link rot.
- What version of the Vite React plugin scales with a Vite 3.x migration? I don't want to overshoot. UPDATE: this is frustrating the npm page only has 3.x and the GitHub repo only has 3.x releases. I'm assuming there existed a 2.x line, but I can't even find the 1.x line release notes. I'll jump straight to 3.x when I upgrade to Vite 4.
- DONE Upgrade to Vite 4.x.