Skip to content

Commit

Permalink
fix(postcss): regression with user-defined rules not reloaded and kil…
Browse files Browse the repository at this point in the history
…l astro plugin (#1956)

* fix(postcss): don't mess with initial css

let’s kill the @pandacss/astro plugin, it is the indirectly the root cause of many headaches

it forces us to track the initial CSS because of the base.css added on the fly

we reverted back to only caching it once because in astro (therefore in park-ui) we ended up with duplicated styles
but now for other postcss users (non-astro) we’re back to that issue of not tracking changes in the CSS that contains the @layer rules #1955

these changes work with vite, next and astro just fine, the only thing needed for astro users is to create a postcss file like this and import a css with the @layer rules (just like any other postcss users)

* chore(logs): better display for CssSyntaxError in sheet

* fix: ensure the outdir is always set

after a config change, the code path will go through DiffEngine.refresh + loadConfig instead of loadConfigAndCreateContext so the config.outdir might be empty if not provided in the panda.config

* BREAKING: remove @pandacss/astro in favor of just using @pandacss/postcss

* chore: add changesets

* chore: revert logs since a better one will land here #1957
  • Loading branch information
astahmer authored Jan 8, 2024
1 parent bf53f34 commit 1bd7fbb
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 523 deletions.
10 changes: 10 additions & 0 deletions .changeset/rich-phones-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@pandacss/config': patch
'@pandacss/node': patch
---

Fix an edge-case for when the `config.outdir` would not be set in the `panda.config`

Internal details: The `outdir` would not have any value after a config change due to the fallback being set in the
initial config resolving code path but not in context reloading code path, moving it inside the config loading function
fixes this issue.
6 changes: 6 additions & 0 deletions .changeset/thin-eyes-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@pandacss/node': minor
---

Fix `@pandacss/postcss` plugin regression when the entry CSS file (with `@layer` rules order) contains user-defined
rules, those user-defined rules would not be reloaded correctly after being changed.
304 changes: 0 additions & 304 deletions packages/astro/CHANGELOG.md

This file was deleted.

53 changes: 0 additions & 53 deletions packages/astro/package.json

This file was deleted.

Loading

3 comments on commit 1bd7fbb

@vercel
Copy link

@vercel vercel bot commented on 1bd7fbb Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

panda-studio – ./

panda-app.vercel.app
panda-studio-chakra-ui.vercel.app
panda-studio-git-main-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 1bd7fbb Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1bd7fbb Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

panda-docs – ./website

panda-docs-git-main-chakra-ui.vercel.app
panda-docs-chakra-ui.vercel.app
panda-css.com
panda-docs.vercel.app

Please sign in to comment.