Skip to content

feat: add octicons-react-symbols package - #8029

Draft
joshblack wants to merge 30 commits into
mainfrom
feat/add-octicons-react-symbols-exploration
Draft

feat: add octicons-react-symbols package#8029
joshblack wants to merge 30 commits into
mainfrom
feat/add-octicons-react-symbols-exploration

Conversation

@joshblack

@joshblack joshblack commented Jun 22, 2026

Copy link
Copy Markdown
Member

Introduce a new package, @primer/octicons-react-symbols, that provides a way for teams to use references to SVGs instead of inlining SVG definitions for each icon.

To do that, this package exposes an OcticonSymbols component that acts as a container for all <symbol> definitions for icons that are provided through the symbols prop. Then, teams may use a {Name}IconReference compoennt to reference that symbol using the <use> element.

The goal of this work is to:

  • Reduce HTML payload size on large pages
  • Reduce DOM size by reducing the number of svg elements on large pages

If teams are introduced, we could also add lint rules to enforce that certain icons are used as references in specific sub-trees/routes. We could also invest in loading up references automatically for defined boundaries (like routes) when bundling for better DX.

Changelog

New

  • Add a new package for rendering icon references instead of inlining SVG definitions

Changed

Removed

Rollout strategy

  • Minor release

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dd3a50d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the staff Author is a staff member label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 22, 2026
@primer

primer Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8029 June 22, 2026 20:40 Abandoned
@primer

primer Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8029 June 22, 2026 20:45 Abandoned
@primer

primer Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8029 June 22, 2026 22:03 Abandoned
@joshblack

Copy link
Copy Markdown
Member Author

@copilot fix CI

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@copilot fix CI

Fixed in a39dae7. I addressed the CI failures by fixing lint/type-check issues, making Storybook build @primer/octicons-react-symbols before @primer/react Storybook, and adding a changeset.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8029 June 24, 2026 14:20 Abandoned
@joshblack

Copy link
Copy Markdown
Member Author

@copilot fix CI

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
joshblack and others added 2 commits July 17, 2026 11:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: aedb29b6-08c7-4d96-8ff6-d6d59b81c9a6
@github-actions
github-actions Bot requested a deployment to storybook-preview-8029 July 17, 2026 16:06 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8029 July 17, 2026 16:16 Inactive
Comment thread .github/workflows/npm.yml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot revert the change in this file

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.

Done in 511dc47. I reverted the change in .github/workflows/npm.yml.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>

@joshblack joshblack left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot I want to make it so that this library also supports this pattern:

import { ExampleIconSymbol, ExampleIconReference } from '@primer/octicons-react-symbols/Example'

Make an update to our bundling strategy to allow for this and update the package.json exports to allow for wildcard imports to these icons. My assumption is that we can use the generated directory as the target in dist for the wildcard import patterns

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

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants