-
Notifications
You must be signed in to change notification settings - Fork 215
chore: Upgrade UI vite and tailwind packages #443
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
Conversation
This gets us current for everything except:
|
2ef0ee7
to
883e55b
Compare
Vite 5.2.0 -> 6.3.5 @vitejs/plugin-basic-ssl 1.2.0 -> 2.0.0 cva: 1.0.0-beta.1 -> 1.0.0-beta.3 focus-trap-react 10.2.3 -> 11.0.3 framer-motion 11.15.0 -> 12.11.0 @tailwindcss/postcss 4.1.6 @tailwindcss/vite 4.1.6 tailwind 3.4.17 -> 4.1.6 tailwind-merge 2.5.5 -> 3.3.0 Minor updates: @headlessui/react 2.2.2 -> 2.2.3 @types/react 19.1.3 -> 19.1.4 @types/react-dom 19.1.3 -> 19.1.5 @typescript-eslint/eslint-plugin 8.32.0 -> 8.32.1 @typescript-eslint/parser 8.32.0 -> 8.32.1 react-simple-keyboard 3.8.71 -> 3.8.72 The new version of vite required an Node 22.15 (since that's current LTS and node 21.x is EOL) The changes to css due to the tailwind 3 to 4 upgrade were done following [the upgrade guide](https://tailwindcss.com/docs/upgrade-guide#changes-from-v3) Done in this order (important): `shadow-sm` -> `shadow-xs` `shadow` -> `shadown-sm` `rounded` -> `rounded-sm` `outline-none` -> `outline-hidden` `32rem_32rem_at_center` -> `center_at_32rem_32rem` (revised order of gradient props) `ring-1 ring-black ring-opacity-5` -> `ring-1 ring-black/50` `flex-shrink-0` -> `shrink-0` `flex-grow-0` -> `grow-0` `outline outline-1` -> `outline-1` ALSO removed the **extra** `opacity-0` on the video element (trips up latest tailwind causing the video to be invisible) FocusTrap is now not exported as the default, so change those imports headlessui's Menu completely changed, so upgrade to the new syntax which necessitated a reorganization of the Header.tsx to enable the "menu" to still work
883e55b
to
7616730
Compare
"type": "module", | ||
"engines": { | ||
"node": "21.1.0" | ||
"node": "22.15.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.
This is required for current vite since node 21.1.0 is EoL
Jump to current LTS version of 22.x, current release is 22.15.0
"@headlessui/tailwindcss": "^0.2.2", | ||
"@heroicons/react": "^2.2.0", | ||
"@vitejs/plugin-basic-ssl": "^1.2.0", | ||
"@vitejs/plugin-basic-ssl": "^2.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.
This has to be upgraded for vite 6.x
"@xterm/addon-webgl": "^0.18.0", | ||
"@xterm/xterm": "^5.5.0", | ||
"cva": "^1.0.0-beta.1", | ||
"cva": "^1.0.0-beta.3", |
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.
... odd there seems to be no tag on the cva repo for the old beta.1
release we referenced.
}, | ||
"dependencies": { | ||
"@headlessui/react": "^2.2.2", | ||
"@headlessui/react": "^2.2.3", |
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.
trivial
"eslint-import-resolver-alias": "^1.1.2", | ||
"focus-trap-react": "^10.2.3", | ||
"framer-motion": "^11.15.0", | ||
"focus-trap-react": "^11.0.3", |
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 causes the syntax for importing FocusTrap to change (no longer exported as the module default), but trivial change.
"focus-trap-react": "^10.2.3", | ||
"framer-motion": "^11.15.0", | ||
"focus-trap-react": "^11.0.3", | ||
"framer-motion": "^12.11.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.
This is a pretty large change, but review shows it to be safe and tests works fine
"react-icons": "^5.5.0", | ||
"react-router-dom": "^6.22.3", | ||
"react-simple-keyboard": "^3.8.71", | ||
"react-simple-keyboard": "^3.8.72", |
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.
trivial
"react-xtermjs": "^1.0.10", | ||
"recharts": "^2.15.3", | ||
"tailwind-merge": "^2.5.5", | ||
"tailwind-merge": "^3.3.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.
This is a medium change, but required no code churn and works fine.
}, | ||
"devDependencies": { | ||
"@tailwindcss/forms": "^0.5.10", | ||
"@tailwindcss/postcss": "^4.1.6", |
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.
Now required because vite+tailwind+postcss is done differently now.
"@tailwindcss/typography": "^0.5.16", | ||
"@types/react": "^19.1.3", | ||
"@types/react-dom": "^19.1.3", | ||
"@tailwindcss/vite": "^4.1.6", |
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.
Now required because vite+tailwind+postcss is done differently now.
"@types/react": "^19.1.3", | ||
"@types/react-dom": "^19.1.3", | ||
"@tailwindcss/vite": "^4.1.6", | ||
"@types/react": "^19.1.4", |
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.
trivial
"@types/validator": "^13.15.0", | ||
"@typescript-eslint/eslint-plugin": "^8.32.0", | ||
"@typescript-eslint/parser": "^8.32.0", | ||
"@typescript-eslint/eslint-plugin": "^8.32.1", |
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.
trivial
"prettier": "^3.5.3", | ||
"prettier-plugin-tailwindcss": "^0.6.11", | ||
"tailwindcss": "^3.4.17", | ||
"tailwindcss": "^4.1.6", |
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.
Major upgrade, changed the Menu
Menu.Button
-> MenuButton
Menu.Items
-> MenuItems
Menu.Item
-> MenuItem
Additionally the menu no longer works with Card
embedded as the parent for the items, so restructured the Header.tsx
"tailwindcss": "^4.1.6", | ||
"typescript": "^5.8.3", | ||
"vite": "^5.2.0", | ||
"vite": "^6.3.5", |
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.
Major update, followed the upgrade process.
import { useNavigate } from "react-router-dom"; | ||
import { ArrowLeftEndOnRectangleIcon, ChevronDownIcon } from "@heroicons/react/16/solid"; | ||
import { Menu, MenuButton } from "@headlessui/react"; | ||
import { Button, Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react"; |
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.
Restructured due to the new Menu code. Using the headlessui's version of Button
because it works more reliably with their MenuItem
(s)
|
||
const usbState = useHidStore(state => state.usbState); | ||
|
||
// for testing |
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.
I can delete this if desired, but helpful when testing to be able to "fake" the cloud login information.
<div className="hidden w-[159px] md:block"> | ||
<USBStateStatus | ||
state={usbState} | ||
<div className="hidden items-center gap-x-2 md:flex"> |
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.
First big change here is putting the three right-side things in a single row so the heights line up.
anchor="bottom end" | ||
className="right-0 mt-1 w-56 origin-top-right data-closed:opacity-0 focus:outline-hidden"> | ||
<MenuItem> | ||
<Card className="overflow-hidden"> |
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.
Big change here is putting the Card
inside the MenuItem
(of which there is now only one) because trying to wrap the Menu.Items
in theCard
completely breaks this version of headlessui.
<div className="absolute w-screen h-screen overflow-hidden isolate opacity-60"> | ||
<svg | ||
className="absolute inset-x-0 top-0 -z-10 h-[64rem] w-full stroke-gray-300 [mask-image:radial-gradient(32rem_32rem_at_center,white,transparent)] dark:stroke-slate-300/20" | ||
className="absolute inset-x-0 top-0 -z-10 h-[64rem] w-full stroke-gray-300 [mask-image:radial-gradient(center_at_32rem_32rem,white,transparent)] dark:stroke-slate-300/20" |
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.
The gradient syntax is now whined about unless it is in attachment then offset order...
hdmiError || | ||
peerConnectionState !== "connected", | ||
"!opacity-60": showPointerLockBar, | ||
"animate-slideUpFade border border-slate-800/30 opacity-0 shadow dark:border-slate-300/20": |
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.
Note that we no longer can or should declare the opacity-0
in the source, as the slideUpFade
or fadeIn
implies and enforces it. If you leave it in here, the contents of the all the little dialog boxes never appears when clicking.
This change happens a lot of places, and is required.
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@import "tailwindcss"; |
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.
New syntax for tailwind 4.x
4cc3950
to
ad8dd37
Compare
@@ -0,0 +1,93 @@ | |||
const { |
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.
Converted the .eslintrc.cjs to the new format. Followed the migration instructions
ad8dd37
to
bccb03d
Compare
"zustand": "^4.5.2" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.2.9", |
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.
These are for new eslint
"eslint-plugin-react": "^7.37.5", | ||
"eslint-plugin-react-hooks": "^5.2.0", | ||
"eslint-plugin-react-refresh": "^0.4.20", | ||
"globals": "^16.1.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.
For new eslint
import LoginRoute from "@routes/login"; | ||
import SetupRoute from "@routes/devices.$id.setup"; | ||
import DevicesRoute, { loader as DeviceListLoader } from "@routes/devices"; | ||
import DevicesRoute from "@routes/devices"; |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
import * as SettingsIndexRoute from "./routes/devices.$id.settings._index"; | ||
import SettingsAdvancedRoute from "./routes/devices.$id.settings.advanced"; | ||
import * as SettingsAccessIndexRoute from "./routes/devices.$id.settings.access._index"; | ||
import SettingsAccessIndexRoute from "./routes/devices.$id.settings.access._index"; |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
{ | ||
path: "devices", | ||
element: <DevicesRoute />, | ||
loader: DevicesRoute.loader }, |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
{ | ||
index: true, | ||
element: <SettingsAccessIndexRoute.default />, | ||
element: <SettingsAccessIndexRoute />, |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
{ | ||
index: true, | ||
element: <SettingsAccessIndexRoute.default />, | ||
element: <SettingsAccessIndexRoute />, |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
); | ||
} | ||
|
||
SettingsAccessIndexRoute.loader = loader; |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
); | ||
} | ||
|
||
DevicesRoute.loader = loader; |
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.
Fixing the eslint warning about the export const loader
requires a change here to follow the same pattern as other routes.
a0ea665
to
5e9d03d
Compare
primaryLinks={[{ title: "Cloud Devices", to: "/devices" }]} | ||
userEmail={user?.email} | ||
picture={user?.picture} | ||
kvmName={device?.name} |
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 ensures we have the device's name in the deregister screen
primaryLinks={[{ title: "Cloud Devices", to: "/devices" }]} | ||
userEmail={user?.email} | ||
picture={user?.picture} | ||
kvmName={device?.name} |
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 ensures we have the device's name in the rename screen
} from "react-router-dom"; | ||
import { useInterval } from "usehooks-ts"; | ||
import FocusTrap from "focus-trap-react"; | ||
import { FocusTrap } from "focus-trap-react"; |
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.
FocusTrap no longer exported as the default
5e9d03d
to
d48c2ee
Compare
<div className="relative flex select-none items-center gap-x-3"> | ||
<div | ||
className={cx("opacity-0 transition-opacity duration-200", { | ||
className={cx("opacity-0 transition-opacity duration-200", { |
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 a unique animation pattern, I think this one stays.
Resolved merge conflicts, ready for review @ym @adamshiervani |
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.
A great PR as usual! Thanks, @IDisposable
* chore: Upgrade UI vite and tailwind packages Vite 5.2.0 -> 6.3.5 @vitejs/plugin-basic-ssl 1.2.0 -> 2.0.0 cva: 1.0.0-beta.1 -> 1.0.0-beta.3 focus-trap-react 10.2.3 -> 11.0.3 framer-motion 11.15.0 -> 12.11.0 @tailwindcss/postcss 4.1.6 @tailwindcss/vite 4.1.6 tailwind 3.4.17 -> 4.1.6 tailwind-merge 2.5.5 -> 3.3.0 Minor updates: @headlessui/react 2.2.2 -> 2.2.3 @types/react 19.1.3 -> 19.1.4 @types/react-dom 19.1.3 -> 19.1.5 @typescript-eslint/eslint-plugin 8.32.0 -> 8.32.1 @typescript-eslint/parser 8.32.0 -> 8.32.1 react-simple-keyboard 3.8.71 -> 3.8.72 The new version of vite required an Node 22.15 (since that's current LTS and node 21.x is EOL) The changes to css due to the tailwind 3 to 4 upgrade were done following [the upgrade guide](https://tailwindcss.com/docs/upgrade-guide#changes-from-v3) Done in this order (important): `shadow-sm` -> `shadow-xs` `shadow` -> `shadown-sm` `rounded` -> `rounded-sm` `outline-none` -> `outline-hidden` `32rem_32rem_at_center` -> `center_at_32rem_32rem` (revised order of gradient props) `ring-1 ring-black ring-opacity-5` -> `ring-1 ring-black/50` `flex-shrink-0` -> `shrink-0` `flex-grow-0` -> `grow-0` `outline outline-1` -> `outline-1` ALSO removed the **extra** `opacity-0` on the video element (trips up latest tailwind causing the video to be invisible) FocusTrap is now not exported as the default, so change those imports headlessui's Menu completely changed, so upgrade to the new syntax which necessitated a reorganization of the Header.tsx to enable the "menu" to still work * Update eslint config and fix errors
Vite 5.2.0 -> 6.3.5
@vitejs/plugin-basic-ssl 1.2.0 -> 2.0.0
cva: 1.0.0-beta.1 -> 1.0.0-beta.3
focus-trap-react 10.2.3 -> 11.0.3
framer-motion 11.15.0 -> 12.11.0
@tailwindcss/postcss 4.1.6
@tailwindcss/vite 4.1.6
tailwind 3.4.17 -> 4.1.6
tailwind-merge 2.5.5 -> 3.3.0
Minor updates:
@headlessui/react 2.2.2 -> 2.2.3
@types/react 19.1.3 -> 19.1.4
@types/react-dom 19.1.3 -> 19.1.5
@typescript-eslint/eslint-plugin 8.32.0 -> 8.32.1
@typescript-eslint/parser 8.32.0 -> 8.32.1
react-simple-keyboard 3.8.71 -> 3.8.72
The new version of vite required an Node 22.15 (since that's current LTS and node 21.x is EOL)
The changes to css due to the tailwind 3 to 4 upgrade were done following the upgrade guide
Done in this order (important):
shadow-sm
->shadow-xs
shadow
->shadown-sm
rounded
->rounded-sm
outline-none
->outline-hidden
32rem_32rem_at_center
->center_at_32rem_32rem
(revised order of gradient props)ring-1 ring-black ring-opacity-5
->ring-1 ring-black/50
flex-shrink-0
->shrink-0
outline outline-1
->outline-1
ALSO removed the extra
opacity-0
on the any element that animates into view as that trips up latest tailwind causing the element to be invisible (also holds for the remote video)FocusTrap
is now not exported as the default, so change those importsheadlessui's
Menu
completely changed, so upgrade to the new syntax which necessitated a reorganization of the Header.tsx to enable the "menu" to still work