You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, debugId only gets injected on specific functions that must be imported specifically from @Vanilla-Extract. This means that if you want to extend functionality and implement custom style generation functions, you don't get access to the name of the constant that is being declared with said functions. This isn't a huge issue since production builds prune the name anyways, but it is a nice feature that gets lost if you stray too much from the dotted line.
I can see this being implemented in two ways:
Create a function that takes a callback with debugId as its only argument
I think this would be the "cleanest" way. Something like:
The only issue would be that, if I'm correct, this would require some refactoring on the babel plugin for debugIds. Perhaps it would be an interesting idea to make this the standard for even the official functions? This way there's one less thing to maintain with the function list and import checkers.
Add a separate configuration key on the plugin options:
This isn't as nice as the first alternative but it could also work:
This way you guarantee that functions would work and get their debugIds. I understand this is a niche use-case, but it would also help a lot for future possible vanilla extract plugins/extension packages.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, debugId only gets injected on specific functions that must be imported specifically from @Vanilla-Extract. This means that if you want to extend functionality and implement custom style generation functions, you don't get access to the name of the constant that is being declared with said functions. This isn't a huge issue since production builds prune the name anyways, but it is a nice feature that gets lost if you stray too much from the dotted line.
I can see this being implemented in two ways:
I think this would be the "cleanest" way. Something like:
The only issue would be that, if I'm correct, this would require some refactoring on the babel plugin for debugIds. Perhaps it would be an interesting idea to make this the standard for even the official functions? This way there's one less thing to maintain with the function list and import checkers.
This isn't as nice as the first alternative but it could also work:
This way you guarantee that functions would work and get their debugIds. I understand this is a niche use-case, but it would also help a lot for future possible vanilla extract plugins/extension packages.
Beta Was this translation helpful? Give feedback.
All reactions