altdsoy

altdsoy

Hi there :wave:,
I hope everyone is doing well…

Tl;Dr: Is there a use case to have Heroicons from an actual hex.pm package instead of Github?


Right now, Heroicons is integrated in Phoenix in the following way:

  • A github: dependency, which really only downloads Heroicons assets in the deps folder
    {:heroicons,
     github: "tailwindlabs/heroicons",
     tag: "v2.1.1",
     sparse: "optimized",
     app: false,
     compile: false,
     depth: 1},
    
  • A Tailwind config file, instructed to read the files from the deps folder:
    plugin(function ({ matchComponents, theme }) {
      let iconsDir = path.join(__dirname, "../deps/heroicons/optimized")
      let values = {}
      let icons = [
        ["", "/24/outline"],
        ["-solid", "/24/solid"],
        ["-mini", "/20/solid"],
        ["-micro", "/16/solid"]
      ]
    

So far so good…

However, I had two use cases where this was not ideal:

  • in one project using github dependency broke the CI as it needs git installed on the Elixir runner.. Okay it was fairly easy to fix.. Just install git..
  • It’s not possible to update easily using Renovate for example (depandabot like tool).

So these two reasons are the incentives for me to make a package that will just do the same thing… I.e. to only import the assets into the deps folder.
This is done by leveraging the files: config option for the package: property of the package.

Then, it’ll be imported as a regular Hex dep:

{:heroicons_css, "~> 0.0.1", compile: false, app: false},

And still used the exact same way as it’s currently.

I was thinking to have this dep’s version in sync with the original github repo. e.g as of now:

{:heroicons_css, "~> 2.1.3", compile: false, app: false},

Also the sync will be entirely automated by CI..
From a repo forked from the original Tailwindlabs repo, added with the mix.exs file to configure the package.

What do you think?


Note:
Maybe, I should have asked this first..
But Tailwind 4 is around the corner: Open-sourcing our progress on Tailwind CSS v4.0 - Tailwind CSS
It seems a config file will no longer be needed.
And I was wondering if in our Phoenix’s use case (using Tailwind with the CLI) https://tailwindcss.com/blog/tailwindcss-v4-alpha#using-the-cli
it’ll still be possible to use the plugin() function?

Showing Posts 1 to 2

carlgleisner

carlgleisner

For other readers’ convenience, there is an issue for this insofar it concerns Dependabot.

https://github.com/dependabot/dependabot-core/issues/10186

carlgleisner

carlgleisner

Update on the Heroicons package and Dependabot which seems to work:

https://github.com/dependabot/dependabot-core/issues/10186#issuecomment-2622418484

The comment:

After the latest updates to elixir version for dependabot, this issue is no longer happening for me.
Apparently fixed.

I do get dependabot to open new pull request for new version of heroicons.

— All posts loaded —

Where Next? Top

Trending in Proposals: Ideas Top

woylie
We are seeing a lot of warning logs like this: navigate event to "https://someurl" failed because you are redirecting across live_sessio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews