Conversation
🦋 Changeset detectedLatest commit: fcc5496 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds a new EvoIcon system to @evo-web/react, generating individual icon components and wiring up subpath exports for tree-shaking and SSR-friendly symbol injection.
Changes:
- Added a large set of auto-generated
EvoIcon*React components backed by inline SVG<symbol>definitions. - Introduced an
EvoIconProvider/IconContextto support symbol management (intended SSR optimization). - Updated
EvoButtonsplit-button UI to useEvoIconChevronDown16instead of a text glyph, and updated package export + icon generation scripts.
Reviewed changes
Copilot reviewed 298 out of 1052 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evo-react/src/evo-icon/icons/*.tsx | Adds many auto-generated icon entrypoints that render <EvoIcon ... __symbol={SYMBOL} />. |
| packages/evo-react/src/evo-icon/context.tsx | Introduces a provider/context and a hidden <svg> root for symbol injection. |
| packages/evo-react/src/evo-button/button.tsx | Replaces the temporary ▼ glyph with EvoIconChevronDown16 for split buttons. |
| packages/evo-react/package.json | Adds wildcard subpath exports for icons and enables the icon generation script. |
| package.json | Adds vitest-browser-react to the workspace devDependencies. |
| .changeset/new-feet-open.md | Publishes a patch changeset for the new icon components. |
| import { EvoIcon } from "../icon"; | ||
| import type { EvoIconComponent } from "./types"; | ||
|
|
||
| const SYMBOL = `<symbol viewBox="0 0 24 24" id="icon-arrows-expand-16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 22a1 1 0 0 0 1 1h7a1 1 0 1 0 0-2H4.414l6.293-6.293a1 1 0 0 0-1.414-1.414L3 19.586V15a1 1 0 1 0-2 0v7Zm12.293-11.293a1 1 0 0 0 1.414 0L21 4.414V9a1 1 0 1 0 2 0V2a1 1 0 0 0-1-1h-7a1 1 0 1 0 0 2h4.586l-6.293 6.293a1 1 0 0 0 0 1.414Z"/></symbol>`; |
There was a problem hiding this comment.
The evo-icon-arrows-expand-16 symbol uses a viewBox of 0 0 24 24, which does not match the -16 icon size naming. This appears to be the inverse of evo-icon-arrows-expand-24.tsx, reinforcing that the assets were swapped. Regenerate/fix so each file contains the correctly sized symbol data.
| import { createContext, type ReactNode } from "react"; | ||
|
|
||
| export const IconContext = createContext<Set<string> | null>(null); | ||
|
|
||
| export const ROOT_ID = "evo-web-svg-symbols"; | ||
|
|
||
| export const EvoIconProvider = ({ children }: { children: ReactNode }) => ( | ||
| <IconContext.Provider value={new Set()}> | ||
| <svg | ||
| id={ROOT_ID} | ||
| style={{ position: "absolute", height: "0px", width: "0px" }} | ||
| focusable={false} | ||
| aria-hidden="true" | ||
| /> | ||
| {children} | ||
| </IconContext.Provider> | ||
| ); |
There was a problem hiding this comment.
Creating new Set() inline makes the context value change on every provider render, forcing all consumers to re-render and (depending on how symbols are tracked) potentially re-inject symbols repeatedly. Use a stable instance per provider (e.g., store the Set in a useRef or useMemo) so rerenders don’t invalidate the context value.
| import { createContext, type ReactNode } from "react"; | |
| export const IconContext = createContext<Set<string> | null>(null); | |
| export const ROOT_ID = "evo-web-svg-symbols"; | |
| export const EvoIconProvider = ({ children }: { children: ReactNode }) => ( | |
| <IconContext.Provider value={new Set()}> | |
| <svg | |
| id={ROOT_ID} | |
| style={{ position: "absolute", height: "0px", width: "0px" }} | |
| focusable={false} | |
| aria-hidden="true" | |
| /> | |
| {children} | |
| </IconContext.Provider> | |
| ); | |
| import { createContext, type ReactNode, useRef } from "react"; | |
| export const IconContext = createContext<Set<string> | null>(null); | |
| export const ROOT_ID = "evo-web-svg-symbols"; | |
| export const EvoIconProvider = ({ children }: { children: ReactNode }) => { | |
| const iconsRef = useRef<Set<string>>(new Set()); | |
| return ( | |
| <IconContext.Provider value={iconsRef.current}> | |
| <svg | |
| id={ROOT_ID} | |
| style={{ position: "absolute", height: "0px", width: "0px" }} | |
| focusable={false} | |
| aria-hidden="true" | |
| /> | |
| {children} | |
| </IconContext.Provider> | |
| ); | |
| }; |
There was a problem hiding this comment.
I will make the change!
738c03b to
7475b51
Compare
Adds icon system to @evo-web/react with individual subpath exports for optimal tree-shaking and build performance. Key changes: - Generate 1,036 individual EvoIcon components from @eBay/skin - Use package.json wildcard pattern for subpath exports - Create EvoIconProvider context for SSR optimization - Add build script to auto-generate icons from Skin - Configure Vite to build icons as separate entry points - Update EvoButton to use EvoIconChevronDown16 - Export icon utilities from main package entry - Create Storybook documentation with usage examples - Add ADR 0004 documenting hybrid import path strategy Architecture: - Components use unified entry: import { EvoButton } from "@evo-web/react" - Icons use subpaths: import { EvoIconCart16 } from "@evo-web/react/evo-icon-cart-16" - Prevents bundlers from parsing 1,000+ unused icons - SSR-friendly with fallback lookup and symbol registration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7475b51 to
fcc5496
Compare
Description
Adds icon system to @evo-web/react with individual subpath exports for optimal tree-shaking and build performance.
Screenshots
Checklist