feat(babel): API for custom template tags#976
Conversation
8643c41 to
54b473b
Compare
54b473b to
60413d3
Compare
|
@juanferreras @jpnelson I did some bad things here:
And the main news is that it is become possible to make custom tags without touching Linaria's insides. The API is unstable yet and TBD, but a start has been made. |
60413d3 to
c5ee8e0
Compare
c5ee8e0 to
69a21b9
Compare
Hi @Anber ! These last refactors you've been working on seem like fantastic iterations! I don't have anything against either of these points, I can quote @jpnelson on why I think he went for
See #867 (comment) for your original comment too. If you've managed to solve this, then this is indeed actually great news to simplify the usage! I haven't used |
Yep, that was the aim of this refactoring.
Maybe it's possible to re-import from the local project by adding something like this to |
Motivation
atomichighlighted the complexity of tags' processing logic. That part hasn't been changed since the beginning of Linaria. So, the time for changes has finally come.Summary
This PR introduces a new way of creating tags. Each tag (both
cssandstyled, as well as their atomic versions) now has aprocessorthat implements the abstract classBaseProcessor. Those processors incapsulate all tag logic and provide the API for the generic template processor insidebabel-preset.Test plan
A lot of new tests were added.