Closed jantimon closed 3 months ago
We could split the code so that all APIs which get transpiled by the Babel plugin (like styled
, keyframes
, css
, etc.) to a new next-yak/internal
module.
Here's how it would work:
import { styled } from "next-yak"
with import { styled } from "next-yak/internal"
next-yak
exportFor our users:
For us maintainers:
import { styled } from "next-yak"
statement has different meanings before and after compilation. By separating into two different exports, we can properly type both scenarios:
input.tsx
(before compilation) and output.tsx
(after compilation) filesinput.tsx
would import from "next-yak" (simulating user code)output.tsx
would import from "next-yak/internal" (representing compiled code)output.tsx
next-yak/internal
must not publish its types to dist (so users won't get autocomplete to next-yak/internal`
find a way how next-yak does not prevent users from writing ui components tests