Skip to content

Standardize FontAwesome usage#20334

Merged
mvdbeek merged 24 commits intogalaxyproject:devfrom
dannon:fontawesome-standardization
Nov 3, 2025
Merged

Standardize FontAwesome usage#20334
mvdbeek merged 24 commits intogalaxyproject:devfrom
dannon:fontawesome-standardization

Conversation

@dannon
Copy link
Member

@dannon dannon commented May 22, 2025

Replace the string-based FontAwesome library approach with direct SVG icon imports for better tree-shaking and type safety.

  • Better tree-shaking (only used icons get bundled)
  • Type safety improvements
  • Reduced global state pollution
  • More explicit dependencies

Changes:

Removed library.add() calls: Eliminated all library.add() statements that were registering icons globally
Removed library imports: Removed import { library } from "@fortawesome/fontawesome-svg-core"
Updated icon usage patterns: Changed from string-based icon references to direct icon object references

Before:

  import { library } from "@fortawesome/fontawesome-svg-core";
  import { faCopy } from "@fortawesome/free-regular-svg-icons";
  library.add(faCopy);

  // Template usage:
  <FontAwesomeIcon icon="copy" />
  // or
  <FontAwesomeIcon :icon="['far', 'copy']" />

After:

  import { faCopy } from "@fortawesome/free-regular-svg-icons";

  // Template usage:
  <FontAwesomeIcon :icon="faCopy" />

The icon plugin/mixin are still up in the air. I could see pushing it all through a GIcon if we wanted, instead of FontAwesome directly, and can make that changes. This first standardization pass is important though, either way, just to get it all aligned.

@dannon
Copy link
Member Author

dannon commented May 22, 2025

There are a few remaining instances and some linting to fix, but I'll keep rebasing into this so we have a clear cutover changeset.

@dannon dannon force-pushed the fontawesome-standardization branch 2 times, most recently from 65f0d92 to d057818 Compare May 22, 2025 13:47
@dannon dannon force-pushed the fontawesome-standardization branch from 3e38a9e to 6ed61e7 Compare August 5, 2025 20:49
@dannon dannon changed the title [WIP] Standardize FontAwesome usage Standardize FontAwesome usage Aug 6, 2025
@dannon
Copy link
Member Author

dannon commented Oct 29, 2025

Ouch. I'll rebase this, just ran into it get again in the context of pulling changes over from vite/vue/etc.

@dannon dannon force-pushed the fontawesome-standardization branch from bf8ac97 to f2a2358 Compare October 31, 2025 12:50
dannon added 20 commits November 2, 2025 12:58
Updated components to import icon objects directly instead of using library.add(). Components now bind icons with :icon="faIconName" rather than icon="fa-icon-name".
Updated Workflow and Libraries icon files to export icon arrays instead of calling library.add(). Also updated useInvocationGraph to remove library registration.
Changed icon prop documentation to reflect using icon objects instead of library.add().
Deleted the icon plugin file and removed it from the plugin index, mountVueComponent, and test helpers. Some tests will fail temporarily because a few components still use string-based icon references that relied on the global icon library.
Created a script to auto-generate TypeScript exports from the Galaxy icon JSON. The gulpfile now runs this during the icon build step, creating galaxyIcons.ts with properly typed IconDefinition exports.
Imported galaxyLogo from the generated Galaxy icons and used it directly instead of the string array format.
Update Heading, MastheadItem, and icon generation to accept both FontAwesome and Galaxy icons through the new IconLike type.
Improved icon generation to use manual formatting instead of JSON.stringify for better readability and consistency with other icon files.
Updated various components to use direct icon imports instead of string-based references. Removed remaining library.add() calls and updated templates to bind icon objects.
Updated DataDialog, GridBoolean, GridList, GridPage, and Masthead to use FontAwesomeIcon instead of the custom Icon component.
@dannon dannon force-pushed the fontawesome-standardization branch 2 times, most recently from 7e24eef to adf9c09 Compare November 2, 2025 19:44
@dannon dannon marked this pull request as ready for review November 2, 2025 19:57
@github-actions github-actions bot added this to the 26.0 milestone Nov 2, 2025
@mvdbeek mvdbeek merged commit 322c5a1 into galaxyproject:dev Nov 3, 2025
33 of 35 checks passed
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

This PR was merged without a "kind/" label, please correct.

@itisAliRH itisAliRH deleted the fontawesome-standardization branch November 17, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants