-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix): change plugin order to make styled-components/macro work #644
Merged
agilgur5
merged 1 commit into
jaredpalmer:master
from
agilgur5:fix-styled-components-macro
Sep 17, 2020
Merged
(fix): change plugin order to make styled-components/macro work #644
agilgur5
merged 1 commit into
jaredpalmer:master
from
agilgur5:fix-styled-components-macro
Sep 17, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
agilgur5
added
the
scope: integration
Related to an integration, not necessarily to core (but could influence core)
label
Sep 17, 2020
agilgur5
force-pushed
the
fix-styled-components-macro
branch
from
September 17, 2020 22:54
0176678
to
093bec3
Compare
This comment has been minimized.
This comment has been minimized.
agilgur5
commented
Sep 17, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise seems good to go if all tests pass
- 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 now
agilgur5
force-pushed
the
fix-styled-components-macro
branch
from
September 17, 2020 23:00
093bec3
to
5bf22ad
Compare
paul-vd
pushed a commit
to EezyQuote/tsdx
that referenced
this pull request
Dec 1, 2020
…dpalmer#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 now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
scope: integration
Related to an integration, not necessarily to core (but could influence core)
version: minor
Increment the minor version when merged
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.
if babel-plugin-macros is first, macros get applied first
unfortunately all user plugins are added after TSDX plugins
there, but could be very breaking.
control
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
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
it the same everywhere but this was the one place that was testing
to get an error code
until it ran now
Workaround for #543
Should go out in a minor since it's possible changing the order of this one plugin could break some things, but highly unlikely