Skip to content

Read runtime icons from every loaded application's manifest - #4

Merged
dannote merged 1 commit into
masterfrom
feature/library-manifests
Oct 4, 2026
Merged

dannote merged 1 commit into
masterfrom
feature/library-manifests

Conversation

@dannote

@dannote dannote commented Oct 4, 2026

Copy link
Copy Markdown
Member

Only one manifest was read per node: the host application's in development, or the first loaded application shipping one in a release. A library that uses icons in its own components could not ship them. The host's compiler scans only the host's sources, and the library's own manifest was never read.

I hit this adding icons to PhoenixReplay's dashboard, which renders inside host applications.

Change

  • Runtime icons come from every loaded application's manifest. get_icons/0 and reload/0 merge the manifests of loaded applications, sorted by name, with the application's own manifest last so it wins on conflicts. A library now ships priv/iconify/manifest.json, and hosts need no configuration.
  • Applications without a code path are skipped, rather than resolving priv/ against the working directory.
  • The compiler and the mix phoenix_iconify.* tasks are unchanged: they read and write only the current project's own manifest.
  • add_icon/3 with persist: true writes the application's own manifest plus the new icon. It used to write the merged runtime set, which would copy a library's icons into the host's manifest.
  • Manifest.read_all/1 and Manifest.manifest_paths/0 expose the merged view.
  • README: an "Icons in libraries" section on committing the manifest and listing it in the package files. CHANGELOG: Unreleased entries.

Tests

library_manifests_test.exs loads fixture applications with their own priv/iconify/manifest.json on the code path. It covers merge precedence, a library's icons rendering with the host winning on a clash, and add_icon/3 persisting only the own icons. Making get_icons/0 read only the own manifest, or persisting the merged set, each fails a test. mix ci passes.

Only one manifest was read per node: the host application's in
development, or the first loaded application shipping one in a release.
A library using icons in its own components could not ship them, since
the host's compiler scans only the host's sources and the library's
manifest was never read.

At runtime, icons now come from the manifests of every loaded
application, sorted by name, with the application's own manifest last so
it wins on conflicts. Applications without a code path are skipped
rather than resolved against the working directory. The compiler and the
mix tasks still read and write only the project's own manifest, and
add_icon/3 with persist: true writes the own manifest plus the new icon
instead of the merged runtime set, so a host never copies a library's
icons into its manifest.
@dannote
dannote merged commit 152d40a into master Oct 4, 2026
2 checks passed
@dannote
dannote deleted the feature/library-manifests branch October 4, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant