* Run tests in CI, refresh stale snapshots, add type and RSC guards
CI only ran `pnpm run build`, so no test suite has executed on a pull
request. Six snapshot assertions across five packages had been failing
since 67ede20ca reshaped the `accessible` icon (circle -> path) and
nobody saw it.
- build.yml now runs `turbo run test`. @tabler/icons-angular is excluded
because its Karma suite needs a real Chrome this job does not set up.
- Refresh the stale inline snapshots in icons-react, icons-vue,
icons-preact, icons-svelte and icons-svelte-runes.
Two new guards under test/:
- test-react-types type-checks the published declarations against
@types/react 16, 17, 18 and 19. Each major is installed under an alias
so the version under test is selected by rewriting `paths`, with no
reinstall between runs. This currently FAILS on 19: `IconNode` is
defined as `keyof ReactSVG` and `ReactSVG` was removed in those types.
That defect is already published and is tracked separately.
- test-react-rsc renders icons through react-server-dom-webpack under
`--conditions=react-server`, covering both the CJS entry Node resolves
and the ESM bundle bundlers load. It guards against the failure that
broke lucide-react v1, where a module-level createContext() made every
icon unimportable in a Server Component. Verified to go red when that
pattern is injected into either bundle.
It runs against a sandboxed copy of the built package: in the workspace
the package is a symlink, so `react` resolves to the catalog's React 18,
which has no usable react-server build.
* Replace `keyof ReactSVG` in IconNode with a self-contained union
`ReactSVG` was removed in @types/react 19, so the published declarations
of @tabler/icons-react and @tabler/icons-react-native failed to compile
for anyone not running with `skipLibCheck`. The new type-compatibility
matrix in test/test-react-types caught it immediately.
`SvgElementName` reproduces ReactSVG's 55 keys exactly, so the type is
unchanged for consumers — nothing that type-checked before stops doing
so. It no longer depends on a React type that comes and goes between
majors.
Narrowing the union to the tags the generator actually emits (only
`path` today) would be a nicer type, but that is a breaking change and
belongs in 4.0.
Verified: @types/react 16.14, 17.0, 18.3 and 19.2 all type-check cleanly.
* Limit the CI test step to packages and guard suites
The demo apps in test/test-* have no test script, but turbo still runs their
build as a dependency of the test task. Under ICONS_LIMIT=100 they fail because
they import icons (IconHeartFilled) outside the built subset.
When no class is passed, icons emitted "tabler-icon tabler-icon-x " with
a trailing space. Browsers drop that space when they parse the attribute,
so prerendered and server-rendered markup does not match what the client
produces and React reports a hydration mismatch on className.
The five affected packages built the string by joining or interpolating
an always-present separator with a value that can be empty. icons-astro
and icons-vue already avoid this, and their tests assert the clean form.
Closes#1400
The align-right-2 icon was assigned U+FEFF (Byte Order Mark), a
reserved control character that browsers always render as
invisible, so the icon glyph never displayed despite being present
in the webfont. Reassign it to the next free codepoint (U+1028E).
Fixes#1516, #1522
- React Native: fix copied React title/image/description, document strokeWidth instead of stroke, mention react-native-svg peer dependency
- Vue: document the stroke prop instead of strokeWidth and drop the misleading stroke="red" example
- Webfont: fix wrong package description, garbled yarn command, CDN path and CSS unicode escape; add stylesheet variants table
- PNG: replace the 2.0.0-beta CDN example with the current icons/outline layout and document the 240x240 size
- Sprite: add a format-specific title and a table of the three sprite files
- All packages: close the <p> tag, point badges at the package itself, remove the 404 sponsor banner and CONTRIBUTING.md link, use pnpm add, fix fence languages and wording, add title/class to props tables where supported
- Replace the obsolete FontForge/compile-options font section with the current webfont package docs
- Remove the stale React UMD CDN entry and add working CDN paths for SVG, sprite and webfont
- Document the official @tabler/icons-angular package and move community packages to their own section
- Add a table of all official packages and usage for Preact, SolidJS, React Native and Astro
- Fix broken links (tree/master, sponsor banner), the CSS unicode escape and the unclosed <p> tag
- Regenerate .github/icons-stroke* images and fix the missing import and duplicated value in preview-stroke.mjs
The x/y/rx/width/height rect reorder used the height capture for width,
turning any such rect into a square (corrupted `headphones`, `headset`,
`headset-off` in v2.0, fixed by hand in #482 while the typo survived).
Extract the transform into an exported optimizeSvgContent() and add a
regression test (pnpm run test:build).