Hi,
I have a current Phoenix 1.8 project, and was just wandering what the best way of making sure that Daisy UI was at the latest version?
Thanks
Richard
Hi,
I have a current Phoenix 1.8 project, and was just wandering what the best way of making sure that Daisy UI was at the latest version?
Thanks
Richard
A 1.8 install should have this bit in your app.css:
/* daisyUI theme plugin. You can update this file by fetching the latest version with:
curl -sLO https://github.com/saadeghi/daisyui/releases/latest/download/daisyui-theme.js
We ship with two themes, a light one inspired on Phoenix colors and a dark one inspired
on Elixir colors. Build your own at: https://daisyui.com/theme-generator/ */
Is that what you mean?
DaisyUI is vendored directly into the installer templates and therefore directly into your app. Both daisyui.js and daisyui-theme.js can be upgraded with the commands specified in app.css, as suggested above.
It looks like they release a lot and the Phoenix installer version has not been upgraded since it was added (6 months ago), but of course the installer only affects new apps anyway.
Maybe it would be more user-friendly to have a wrapper Hex package like tailwind/esbuild?
Oh I really disliked when people started creating Ruby gems to bundle JavaScript libraries. I hope Elixir doesn’t start trending that way.
What we did for heroicons back then, and I aimed to do for daisyUI too is pull it in using a mix dependency pointing to GitHub.
I even asked the daisyUI maintainer to include a pre-built set of JS files within the releases to make it viable.
It has some downsides, like it won’t show in the output of mix deps.outdated, and some third-party tools like security scanners had trouble with it. I think the latter has been overcome.
On the positive side, the version number is cleared stamped in mix.exs and upgrading becomes trivial.
I didn’t have the urge to work on it as I decided not to prioritize moving from Tailwind v3 to v4, one day!
curl -sL "https://github.com/saadeghi/daisyui/releases/download/v5.5.5/daisyui-theme.js" -o /assets/vendor/daisyui-theme.js
curl -sL "https://github.com/saadeghi/daisyui/releases/download/v5.5.5/daisyui.js" -o /assets/vendor/daisyui.js
Yes, I think that’s it.
Which directory should I run this in?
Richard
In the same folder where the daisy-ui.jscurrently is located.