Description
matchTag function set up via configure in parser:before plugin is being called only if parser doesn't mark a component as a Panda component. https://github.com/chakra-ui/panda/blob/bc2b8d7e098b0bd4a9b8f215c5205b8bd83b3e55/packages/parser/src/parser.ts#L68C52-L68C60
Problem Statement/Justification
I'm working on the migration from @chakra-ui/react to Panda CSS. There are a lot of components with the same names, leading to Panda CSS parser taking @chakra-ui components as Panda components, which leads to a lot of unnecessary CSS being produced.
Proposed Solution or API
I managed to write a plugin that parses imports in a file and checks whether it's imported from Panda outDir or another library. It covers most of the edge-cases in our codebase. What I would need tho is to give 100% of control to matchTag function, no matter if Panda parser thinks it's a Panda component or not.
Due to breaking changes, we can have 2 approaches:
options.matchPandaComponents boolean flag - true by default but would let user to opt-out from that behavior
options.matchAllTags - separate function that would be called instead of matchTag
Alternatives
No response
Additional Information
No response
Description
matchTagfunction set up viaconfigureinparser:beforeplugin is being called only if parser doesn't mark a component as a Panda component. https://github.com/chakra-ui/panda/blob/bc2b8d7e098b0bd4a9b8f215c5205b8bd83b3e55/packages/parser/src/parser.ts#L68C52-L68C60Problem Statement/Justification
I'm working on the migration from
@chakra-ui/reactto Panda CSS. There are a lot of components with the same names, leading to Panda CSS parser taking@chakra-uicomponents as Panda components, which leads to a lot of unnecessary CSS being produced.Proposed Solution or API
I managed to write a plugin that parses imports in a file and checks whether it's imported from Panda
outDiror another library. It covers most of the edge-cases in our codebase. What I would need tho is to give 100% of control tomatchTagfunction, no matter if Panda parser thinks it's a Panda component or not.Due to breaking changes, we can have 2 approaches:
options.matchPandaComponentsboolean flag -trueby default but would let user to opt-out from that behavioroptions.matchAllTags- separate function that would be called instead ofmatchTagAlternatives
No response
Additional Information
No response