Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: file-matcher #3137

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

cgatian
Copy link

@cgatian cgatian commented Feb 11, 2025

📝 Description

Only parse styles using the css function when they are valid sources provided by importMap.

⛳️ Current behavior (updates)

file-matcher is too greedy and parses any encounter of css in the file. This leads to additional CSS styles being generated that shouldn't be included.

🚀 New behavior

  1. Parse css only when the CSS function is used from a valid importMap source.
  2. Prefer matching using alias instead of matching both on key and alias. key could be anything arbitrary (something from another import source perhaps) See: https://play.panda-css.com/AFgHUiMXKl

💣 Is this a breaking change (Yes/No):

Yes. With more strictness other tests fail which IMO should have failed.
For example, the test ast parser[without import] should not parse doesn't have an import to styled-system yet, it's producing CSS.

📝 Additional Information

There's a lot to Panda, and this change only scratches the surface. My hope is this can aid the team in providing a proper fix.
I intentionally left other tests in a broken state so they could be reviewed by the team, a majority of the failures are due to the tests not having a proper import statement to styled-system. These test snapshots need to be updated because css isn't parsed unless it's present in a valid import.

Copy link

changeset-bot bot commented Feb 11, 2025

⚠️ No Changeset found

Latest commit: 4a608aa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
panda-docs ✅ Ready (Inspect) Visit Preview Feb 11, 2025 3:55pm
panda-playground ✅ Ready (Inspect) Visit Preview Feb 11, 2025 3:55pm
panda-studio ✅ Ready (Inspect) Visit Preview Feb 11, 2025 3:55pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant