Closed rektdeckard closed 1 year ago
This build is live on NPM under version 2.1.3, or the @next
tag
Considering making this the default behavior rather than the exception, I.E.
import { Fish } from "@phosphor-icons/react"; // SSR version
import { Fish as ClientFish } from "@phosphor-icons/react/dist/csr"; // CSR version with `useContext`
This may make sense given that Context usage is probably pretty rare, and Next.js and other frameworks supporting RSC are on the rise.
This patch refactors a fair amount of the lib to solve several problems:
"use client"
(principally for NextJS users)modularizeImports
in NextJS builds, and should also fixEMFILE
exceptions during compilationThe way this works:
/src/defs/
/src/csr/
now import their correspondingdefs
and render them into anIconBase
, context and all. They can still be imported from the barrel file./src/ssr/
import theirdefs
and render them into anSSRBase
, sans context. These can be imported from the SSR barrel file.What this should now look like for real-world users: