feat: add octicons-react-symbols package - #8029
Conversation
…-react-symbols-exploration
|
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
@copilot fix CI |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
|
@copilot fix CI |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aedb29b6-08c7-4d96-8ff6-d6d59b81c9a6
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
joshblack
left a comment
There was a problem hiding this comment.
@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
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
OcticonSymbolscomponent that acts as a container for all<symbol>definitions for icons that are provided through thesymbolsprop. Then, teams may use a{Name}IconReferencecompoennt to reference that symbol using the<use>element.The goal of this work is to:
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
Changed
Removed
Rollout strategy