-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add import mapping to babel plugin #1220
Conversation
Preview Docs Built with commit 2f410be |
Yeah this API would be awesome IMHO! |
Codecov Report
|
I just spent a couple hours trying to solve babel+typescript+ |
@mitchellhamilton If you'd be able to spend the time, I'd love to assist with this, maybe do some pair programming. I'd like to learn more about this topic, and assist in the long term maintenance of this feature. I'm in the Slack channel if you'll let me know when you're working on this, I can possibly assist and learn? |
Is there anything the community can do to help get this through? I think this would greatly improve the usability of Emotion with TypeScript. |
This also would be really useful with custom styled components that strongly type your app theme like described here. Current situation is that |
@knpwrs I have the same problem, have you found any workaround for this issue? or do we have to wait for this pull request to be merged? |
As far as I can tell we have to wait for this to be merged. My "workaround" for the time being is to just live without the features of the Babel plugin because I happen to value type safety more than the features, though I would love to have both. |
For everyone curious about this, this definitely something we want to add but it's caused me to think about various APIs and optimizations which I'd like to change in emotion which will affect this API so I'd like to make those changes before adding this. |
@mitchellhamilton is there anything I could do to help move this forward? including doing other work - you have mentioned you want to prepare the groundwork for some optimizations first, could help with that |
@Andarist I’ve been thinking even more and the changes I mentioned there aren’t things I want to do right now so the next thing to move this forward, the next thing to do is ensure that anything that re-exports jsx also exports Also, other things that need to happen:
|
Hey folks :) |
@fforres if you want to help with that we would certainly appreciate the help. I was supposed to get to it, but I constantly can't find enough time to dive into it - being preoccupied with other OSS work. If you'd like to help you could join our Slack and ping me so we could discuss the details. |
Sounds good @Andarist 😄 |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b8c7a5d:
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit dcc98dd:
|
default: coreCssTransformer | ||
}, | ||
'@emotion/core': { | ||
// jsx isn't included here because it's handled differently |
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.
what does it mean that it's handled differently? would be good to point some point of reference or an explanation here
'@emotion/core': { | ||
// jsx isn't included here because it's handled differently | ||
css: coreCssTransformer | ||
// TODO: maybe write transformers for keyframes and Global |
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.
what could be handled but is not?
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.
Minifying styles for keyframes and Global
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.
K, seems interesting to me so I'm going to work on those when this PR lands.
👏👏👏👏👏👏👏👏👏👏👏👏👏 |
Has this made its way into the |
Yes, this should have been released quite some time ago under the |
* Add stuff to babel plugin readme * Refactor styled macro * Refactor other macros * WIP more refactoring * Fix stuff * WIP * stuff * WIP stuff * More WIP stuff * WIP * Add a changeset * Remove instances option and other things * Fix some stuff * A bunch of FlowFixMes * Finish implementation and add a changeset * Update more things * Words * Remove obselete snapshots * Fix stuff * Fix docs * Fix things * Fix a bug
Closes #1203
This is just a sketch of what I'm thinking the api should look like right now, implementation coming soon.
cc @ndelangen wdyt of this API? (ignore the naming, it'll change, just the structure)