Skip to content

chore: remove the legacy bundled inline icon data - #3345

Merged
interactivellama merged 1 commit into
masterfrom
chore/remove-legacy-icons
Nov 20, 2026
Merged

interactivellama merged 1 commit into
masterfrom
chore/remove-legacy-icons

Conversation

@interactivellama

Copy link
Copy Markdown
Contributor

Fixes #

Additional description

Removes the legacy icons/{action,custom,doctype,standard,utility}/ inline-icon data (5.9 MB in the repo). scripts/inline-icons.js generated it from @salesforce-ux/icons; that script was deleted in 422e4b3 and the data hadn't been regenerated in years.

Why: the inline path was already dead. Each category barrel wrapped its data in if ('__EXCLUDE_SLDS_ICONS__' === '__INCLUDE_SLDS_ICONS__'), which is always false, so each barrel exported {} and UtilityIcon never found inline data by name. Because the Vite build uses preserveModules, the unreachable barrel code still shipped: about 880 KB each in dist/es/icons and dist/cjs/icons. package.json exports doesn't expose icons/, so it isn't public API.

Changes

  • Deleted icons/.
  • UtilityIcon: removed the five icons/* imports, the inlineIcons map, the IconBundle type and the name-lookup branch. It renders the icon prop's inline SVG if given, otherwise a sprite <use> resolved from path or IconSettings.
  • Icon "Base: Imported" story: replaced the icons/utility/download import with a local constant holding the same data, so the story and its snapshot don't change.
  • Dropped the 'icons/**' ESLint ignore and the unused @salesforce-ux/icons devDependency.
  • CHANGELOG entry under [Unreleased] → Removed.

Not changed: the public icon prop on Icon/UtilityIcon, which takes inline SVG data from the consumer. No public API change, so this isn't marked breaking.

Verification

  • npm run test:ci passes: 1648 tests, 0 lint errors. No .snap changes.
  • dist/es/icons and dist/cjs/icons no longer exist. dist went from 12.2 MB to 10.4 MB.
  • No source imports of icons/ remain.

CONTRIBUTOR checklist (do not remove)

Please complete for every pull request.

Green gate — all of these must pass locally (CI runs the same):

  • npm run lint passes with 0 errors (npm run lint:fix to auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.
  • npm run typecheck is clean (tsc --noEmit).
  • npm test -- --run passes — this runs both Vitest projects (jsdom unit + real-browser browser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots with npm test -- --run -u and review the diff.
  • npm run build succeeds (type-check + Vite library build + .d.ts + entry shims).

Behavior & docs:

  • First-time contributors: sign the CLA (a bot will comment with instructions).
  • Added/updated Vitest + React Testing Library tests for the change (template: components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a *.browser.test.jsx file (the browser project); everything else is jsdom.
  • Reviewed the component's Storybook stories: npm run storybook → http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).
  • Story/example code uses the component's real prop API (e.g. slots like content / visualPickerFigure, render props like renderItem, icon props, events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check against components/<name>/__examples__.
  • Storybook Accessibility (a11y) panel shows no new violations for the affected stories.
  • If you added or changed a type, remember runtime PropTypes were removed in the TS migration — types are the contract. Ship accurate .d.ts (they're generated by the build); JS consumers rely on them via editor type-acquisition.

No new tests: this removes dead code, and the unchanged story snapshots cover Icon rendering with the icon prop and with sprites. I haven't checked Storybook by hand yet. The unchanged snapshots show the markup is identical.

REVIEWER checklist (do not remove)

  • CI is green (GitHub Actions CI workflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.
  • Change has adequate test coverage; bug fixes include a regression test.
  • Reviewed the affected Storybook stories and their a11y panels.
  • Rendered markup still conforms to SLDS — check the story HTML snapshot diff (components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).
  • Public API / package surface: if exports changed, the deep-import contract still holds (@salesforce/design-system-react/components/<name> and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change → feat!:/BREAKING CHANGE: and a major version bump.

Replaces #3343, which GitHub closed as merged into fix/v11-slds2-css-fixes while the rc.1 stack was being reordered. Master never got the change.

@interactivellama interactivellama added this to the 11.0.0-rc.1 milestone Nov 19, 2026
@interactivellama
interactivellama removed this pull request from stack #3346 November 19, 2026 22:05
@interactivellama
interactivellama changed the base branch from master to fix/carousel-autoplay-dwell-timer November 19, 2026 22:05
@interactivellama
interactivellama force-pushed the chore/remove-legacy-icons branch from cb87e39 to 38fc848 Compare November 19, 2026 22:07
@interactivellama
interactivellama force-pushed the chore/remove-legacy-icons branch from 38fc848 to 74a583b Compare November 20, 2026 00:14
@interactivellama
interactivellama removed this pull request from stack #3348 November 20, 2026 00:23

@Niznikr Niznikr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🧹

Base automatically changed from fix/carousel-autoplay-dwell-timer to master November 20, 2026 23:37
The icons/ barrels were gated behind an always-false placeholder check, so
UtilityIcon never found inline data by name, but preserveModules still shipped
~880 KB of unreachable code in dist/es and dist/cjs. Delete the data, the dead
lookup in UtilityIcon, its ESLint ignore, and the unused @salesforce-ux/icons
devDependency. The public `icon` prop is unchanged.
@interactivellama
interactivellama force-pushed the chore/remove-legacy-icons branch from 74a583b to 62cfbe6 Compare November 20, 2026 23:37
@interactivellama
interactivellama merged commit 2af3b4e into master Nov 20, 2026
7 checks passed
@interactivellama
interactivellama deleted the chore/remove-legacy-icons branch November 20, 2026 23:43
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.

2 participants