Skip to content

feat(icon): register icons without an IgbIcon instance - #563

Open
MayaKirova wants to merge 3 commits into
masterfrom
mkirova/reg-icon
Open

MayaKirova wants to merge 3 commits into
masterfrom
mkirova/reg-icon

Conversation

@MayaKirova

Copy link
Copy Markdown
Contributor

Description

Add RegisterIconAsync, RegisterIconFromTextAsync and SetIconRefAsync on IIgniteUIBlazor, backed by new api.js exports, and obsolete the IgbIcon and IgbIconButton instance methods. The icon registry now loads at startup (~25 KB gzip).

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code
  • This PR includes API docs for newly added methods/properties
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Closes #561

Add RegisterIconAsync, RegisterIconFromTextAsync and SetIconRefAsync on
IIgniteUIBlazor, backed by new api.js exports, and obsolete the IgbIcon
and IgbIconButton instance methods. The icon registry now loads at
startup (~25 KB gzip).

Closes #561

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MayaKirova
MayaKirova requested review from damyanpetev and a balanced review from Copilot and removed request for Copilot November 12, 2026 12:58
Let vite read the tsconfig paths (resolve.tsconfigPaths) instead of
repeating each deep import as an alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 13:38
@MayaKirova MayaKirova added the ❌ status: awaiting-test PRs awaiting manual verification label Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Browser validation is needed to verify that the eager registry/lit chunk graph shares registrations with subsequently loaded icons, since the added tests do not exercise that path.

No open issues 🎉

What changed in this PR

Addresses #561 by exposing the global icon registry through IIgniteUIBlazor extension methods and the public JavaScript API, removing the need for a hidden icon instance.

Changes:

  • Adds asynchronous registration and alias methods while deprecating existing component instance methods.
  • Adjusts bundling to load the icon registry at startup while keeping component bundles lazy.
  • Adds interop tests and updates stories, usage guidance, and the changelog.
File Description
vite.config.mts Adds path resolution and separate registry/Lit chunks.
tsconfig.json Maps the direct icon registry import.
tests/​js/​static-web-assets.test.mjs Checks registry exports and lazy component loading.
tests/​IgniteUI.Blazor.Tests/​IconTests.cs Retains legacy method tests with obsolete warnings suppressed.
tests/​IgniteUI.Blazor.Tests/​IconRegistryTests.cs Tests service interop arguments, import reuse, and null checks.
tests/​IgniteUI.Blazor.Tests/​IconButtonTests.cs Retains legacy method tests with obsolete warnings suppressed.
stories/​wwwroot/​icons/​star.svg Supplies an icon for URL registration examples.
stories/​Components/​Stories/​Icon.stories.razor Demonstrates registration, metadata stripping, and aliases.
stories/​Components/​Shared/​IconRegistrar.razor Replaces the hidden icon with service-based registration.
src/​src/​api.ts Exposes registry functions and standalone TypeScript types.
src/​componentsBase/​InteropModule.cs Defines the public API module path.
src/​componentsBase/​IgniteUIBlazorIconExtensions.cs Adds asynchronous service-based icon registry methods.
src/​components/​Blazor/​IconButton.cs Deprecates instance registration methods.
src/​components/​Blazor/​Icon.cs Deprecates instance registration and alias methods.
skills/​igniteui-blazor-components/​references/​data-display.md Documents service-based and direct JavaScript registration.
CHANGELOG.md Records the new APIs and instance-method deprecations.

Review effort: Balanced

Replace the optional collection with overloads, leave unset options
members out of the call, and complete the XML docs. Assert the JSON
sent to api.js and cover WebAssembly with trimming in the smoke app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register icons without an IgbIcon instance

3 participants