Panda v2 feedback #3599
Replies: 23 comments 36 replies
|
Awesome work! I'll give it a test soon and provide any feedback |
v2 regression: nested
|
|
v2 regression: Oxc extractor fails on top-level A Env
Minimal repro — ---
import { SOME_FLAG } from 'astro:env/client'
if (SOME_FLAG === '') {
return null
}
---
<div />Default Behavior
Root cause Per Asks
Current workaround: This regression isn't mentioned in |
|
Are there any alternatives to |
|
Another bug that's currently blocking us: |
|
Not entirely sure whether this happens all over, or only in globalCss, but I noticed that some code looking like this failed to be extracted: ".article": {
h2: {
color: "blue"
}
}Seems like v1 was more lenient here. If I do |
|
In a similar vein to my previous comment, this snippet produces unexpected css: ".article": {
"h2, h3, h4": {
color: "blue"
}
}It produces: .article h2, h3, h4 {
color: blue
}It should produce: .article h2, .article h3, .article h4 {
color: blue
} |
|
Another issue I'm encoutering is overriding font-families of a specific text style. Let's use the following code as an example: ".codeblock": {
textStyle: "label.medium",
fontFamily: "code",
}In v1, this generated into a single block of css. In v2, it generates into two: One block that includes the non-composition css, and another that includes the text style. This causes me to never be able to override for instance the font-family. The v2 output is something like: .codeblock {
font-family: var(--fonts-code);
}
.codeblock {
font-family: var(--fonts-sans);
font-size: var(--font-sizes-small);
font-weight: var(--font-weights-normal);
letter-spacing: normal;
line-height: var(--line-heights-small);
} |
|
Seems like there's a diff with using grid-template-areas as well. Probably not noteworthy, but I found the css naming to be strange so I thought I'd report it. Original code: gridTemplateAreas: `
"preview name delete"
"preview size delete"`,v1 output: .grid-template-areas_\"preview_name_delete\"_\"preview_size_delete\" {
grid-template-areas: "preview name delete" "preview size delete";
}v2 output: |
|
Worth mentioning in the migration docs (maybe?): |
v2 regression: a
|
|
v2 regression: a string value that matches a token name now resolves to the token instead of the CSS keyword
defineTextStyles({
heading: { value: { lineHeight: 'normal' } },
})/* v1.11.3 */ line-height: normal;
/* v2 beta */ line-height: var(--line-heights-normal); /* = 1.5 */This silently changes the computed value (keyword Expected: a bare CSS keyword should stay a keyword; the token should require explicit opt-in (e.g. |
|
I just noticed that our .css file contains a couple of invalid css attributes, namely
|
v2-beta: atomic CSS is generated from props of non-Panda capitalized components (regression vs 1.11.1)Feedback on the new engine's extraction. In (Possibly related to the "patterns generating invalid shorthand despite being disabled" Env: Minimal repro
---
interface Props { width?: string; height?: string; direction?: string; foo?: string }
const { foo } = Astro.props
---
<div data-foo={foo}>hi</div>
---
import Box from '@/components/Box.astro'
---
<img src="/x.png" alt="" width="1111" height="2222" /> <!-- lowercase HTML el -->
<Box width="5555" height="6666" direction="reprodir" foo="bar" /> <!-- component -->panda cssgen -o out.css # also reproduces through `astro build`Expected (= 1.11.1)No utilities from Actual (2.0.0-beta.5).w_5555 { width: 5555px }
.h_6666 { height: 6666px }
.direction_reprodir { direction: reprodir } /* invalid value */What pins the trigger:
Why it bites in practiceThis fires on every Is extracting style props from arbitrary capitalized components (no |
|
Hi, The migration docs around hooks are a bit confusing:
does this mean that the concept of hooks are going away in panda v2, or just that these specific hooks are going away? we use the |
|
In v2, pattern property types appear to include a For example: // styled-system/patterns/box.d.ts
export interface BoxProperties {
className?: string
}This prop doesn't exist in v1, and I couldn't find it mentioned in the v2 migration guide. Additionally, passing It also causes type conflicts when composing React Aria components with a pattern, since React Aria uses a different type for |
v2 typing regression (since beta.3):
|
|
We're evaluating Build-info migration is unclearThe migration guide suggests replacing include: ['./node_modules/@acme/design-system/dist/panda.buildinfo.json'];Panda parses the JSON as JavaScript and reports The working path is designSystem: '@acme/design-system';This contract appears in draft design notes but is not explained in the main migration guide. Workspace peer rangesWith a workspace catalog dependency: "@pandacss/dev": "catalog:"
"panda": "catalog:"Our current workaround is: panda lib --panda 2.0.0-beta.8It would help if Panda resolved workspace/catalog protocols or rejected invalid manifest ranges. Nested design systems duplicate parent build infoFor a chain like: The design notes say each package should ship only its own extraction state, with consumers composing the artifacts. In beta.8,
There is no apparent Generated consumer types lose design-system tokensCSS generation through css({ backgroundColor: 'bg.neutral' });
// CSS is generated, but TypeScript reports TS2322This affects semantic colors, spacing, typography, borders, and other design-system tokens. It may relate to the unfinished overlay/type-generation work mentioned in the design notes.
|
|
Sharing a distinct bug we hit while evaluating v2 ( Custom utility Minimal repro: // panda.config.ts
import { defineConfig } from '@pandacss/dev'
export default defineConfig({
presets: ['@pandacss/preset-base'],
include: ['./src/**/*.{ts,tsx}'],
outdir: 'styled-system',
theme: { extend: { tokens: { colors: { red: { value: '#f00' }, blue: { value: '#00f' }, green: { value: '#0f0' } } } } },
utilities: {
extend: {
colorVariable: {
shorthand: 'colorVar',
className: '--color-var',
values: 'colors',
transform: (value) => ({ '--color-var': value }),
},
},
},
})// src/viaCss.ts
import { css } from '../styled-system/css'
export const a = css({ colorVar: 'red' })
// src/viaCva.ts
import { cva } from '../styled-system/css'
export const b = cva({ base: { colorVar: 'blue' } })
// src/viaSva.ts
import { sva } from '../styled-system/css'
export const c = sva({ slots: ['root'], base: { root: { colorVar: 'green' } } })
--color-var: var(--colors-red); /* css() ✅ transform applied */
color-variable: var(--colors-blue); /* cva() ❌ transform ignored, kebab key */
color-variable: var(--colors-green); /* sva() ❌ */This also breaks preset-base's own Impact for us: design-system components define CSS-variable utilities via |
🐛 v2 ESLint/oxlint plugin (
|
|
|
Will there be a |
beta.12:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Panda v2 is in beta. Same Panda you know,
css(), recipes, patterns, tokens, conditions. The engine underneath is rewritten in Rust. It's fast, and it's still rough in spots. This is where you tell us about both.Install:
Start here: v2 beta guide & migration — setup, what changed, and what is in progress.
What helps most:
panda debugand attach the dump from<outdir>/debug— it's how we reproduce.And the wins 🎉
We'd love to hear those too. Faster builds, a smooth migration, something that just worked, drop it here. Numbers (before/after build times, bundle size) are great, but "it felt snappier" counts too.
Found a bug with a repro, shipped v2 to production, or just thinking out loud, or stuck on setup? Drop it here.
All reactions