Commit 6d7257c
authored
(fix): change plugin order to make styled-components/macro work (#644)
- if babel-plugin-macros is first, macros get applied first
- babel-plugin-styled-components says it should be placed first, but
unfortunately all user plugins are added after TSDX plugins
- unknown how changing this ordering could impact lots of code out
there, but could be very breaking.
- moving to a preset instead would mean this is more in user
control
- but we can change it so macros are added first and so one can use
styled-components/macro instead as a workaround
- based on babel-plugin-styled-component's code, docs, and output in
detail, I think its ordering conflict may be with
babel-plugin-annotate-pure-calls, which so happens to be the first
plugin in babelPluginTsdx
- maybe this should be last given that other plugins can change
functions etc
(test): update styled-component template tag test to reflect the
slightly different tag due to the usage of the macro
(fix/test): comment removal should use toBeFalsy, not toBeTruthy,
since it's removed
- this was a bug I introduced when adding the grep helper; just added
it the same everywhere but this was the one place that was testing
to get an error code
- fix the comment so it doesn't say error code anymore either
- since this test was skipped, I didn't pick up that it was wrong
until it ran now1 parent da4b189 commit 6d7257c
4 files changed
Lines changed: 11 additions & 11 deletions
File tree
- src
- test/integration
- fixtures/build-withBabel
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | | - | |
| 35 | + | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
0 commit comments