installer: manage daisyui via mix.exs#6713
Conversation
361448b to
66d9a28
Compare
Ooops?! 🤷 |
|
Yeah, looks like the daisyUI repo is very large and the older version doesn't support shallow checkouts? |
|
Oh, so that would explain the failure! How unfortunate, save disk space in one move, use lots of disk space elsewhere. While Phoenix itself supports older versions, does the installer ( I don't have the data, but would imagine all the incentives are to start a greenfield project on a more recent version (1.18-1.20). |
|
Shallow clones is from 1.17: "[mix deps] Add :depth option to Mix.SCM.Git, thus supporting shallow clones of Git dependencies" https://mix.hexdocs.pm/1.20.1/Mix.Tasks.Deps.html#module-git-options-git Sparse checkouts much earlier. |
|
Lines 14 to 17 in 811a849 |
|
@SteffenDE saadeghi/daisyui#3834, saadeghi/daisyui#2997, the large repo size is a known "issue". I didn't recall it. One way around would be a fork, or fork + github action to pull updates, but then we're defeating the ability to point straight upstream instead of maintaining a level of indirection. At that point we could have an auto-published Hex package as well. |
|
For reference, the requirement of 1.15+ in the installer dates back to Oct 2024 (#5957) |
|
Yeah, it’s probably fine to bump the requirement for new apps. cc @josevalim |
|
Yes, it is fine to bump it for new apps! |
66d9a28 to
198339b
Compare
|
@SteffenDE @josevalim rebased on top of main (to pick up recent CI changes) and bumped the Elixir version requirement for the installer and new apps in a separate commit for easier review. The patch in the original commit has not changed. Unfortunately I think in https://github.com/phoenixframework/phoenix/actions/runs/27549626721/job/81432108238?pr=6713 we ran into elixir-lang/elixir#14425, untracked files in CI cache affecting Any suggestions? Both sound non-ideal to me:
If nothing else, I'd pick 1 with a note to remove the hack once we require Elixir v1.19+. |
|
1 sounds good! |
Similar to how we replaced vendored Heroicons with a Git/GitHub Mix dependency, replace the vendored daisyUI with a mix dependency. This offers a few benefits: - Improved supply chain awareness (easily verify which version is in use) - Easier updates by bumping a tag in mix.exs - Avoids bloating the installer templates, new apps, Docker images, etc, with large static files See: - saadeghi/daisyui#3749 - phoenixframework#5622
While the installer itself doesn't depend on Elixir v1.17, it would be a strange UX to use say Elixir v1.15 to scaffold an app just to realize you cannot run the generated app without upgrading. Requiring Elixir v1.17 ensures every supported version can handle the `:depth` option for Git Mix dependencies, required for shallow clones. This feature is used both for heroicons and daisyui, and is fundamental for daisyui as otherwise cloning the repository incurs over 10 GB of disk space.
c857194 to
a45b9c6
Compare
Sorry, I made a mistake. It turns out I let the wrong daisyui commit hash slip into The deps hack (c857194) might not be necessary. |
|
This is ready for a final review. It's the original implementation + bumping version requirement for installer and new apps. |
Similar to how we replaced vendored Heroicons with a Git/GitHub Mix dependency, replace the vendored daisyUI with a mix dependency.
This offers a few benefits:
See: