Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
Only parse styles using the
css
function when they are valid sources provided byimportMap
.⛳️ Current behavior (updates)
file-matcher
is too greedy and parses any encounter ofcss
in the file. This leads to additional CSS styles being generated that shouldn't be included.🚀 New behavior
css
only when the CSS function is used from a validimportMap
source.alias
instead of matching both onkey
andalias
.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 becausecss
isn't parsed unless it's present in a valid import.