-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Avoid referencing internal Emotion packages in built types #16905
Avoid referencing internal Emotion packages in built types #16905
Conversation
Nx Cloud ReportCI ran the following commands for commit 4665e59. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
Hey @Methuselah96 thank you so much for your contribution! @Andarist could you please take a look at this? Thank you! |
@yannbf this is a somewhat interesting case. I understand why the issue is there with PnP and I think this should be fixed one way or another. I find it problematic though that TS even allows this output to be emitted - this IMHO should be a compilation error because the imported symbol is somewhat implicit. From your perspective, as the author, AFAIK somewhat similar issues will start to pop up as errors once TS ship the support for And while the proposed fix here could potentially fix every potential problem at once, I think that the better solution is the one that I'm going to propose. YMMV though so choose whatever feels best for your product. Instead of adding this to your dependencies, I would do this: type Keyframes = ReturnType<typeof keyframes>
// annotate your stuff explicitly
const rotate360: Keyframes = keyframes`...` A part of the problem might be that |
@Andarist Using |
I did some more investigation and it looks like starting in TypeScript 4.2 it picks up on |
It turns out that Without interface (TS playground):
Produces:
With interface (TS playground):
Produces:
@yannbf @Andarist How would you like to proceed? The options are (from least to most preferable in my opinion):
|
60f7440
to
fe1f88d
Compare
I've just released |
fe1f88d
to
1e26ca8
Compare
@Andarist That's very helpful, thanks! We still have to declare the type for each of the variables because TypeScript 3.9 doesn't figure out that it can import the types from |
1e26ca8
to
5ec0df7
Compare
@ndelangen Merge conflicts resolved. |
Issue: N/A
What I did
Errors I'm trying to fix when using Yarn PnP:
This happens because
lib/theming/src/animation.d.ts
ends up referencing these packages like this:How to test
If your answer is yes to any of these, please make sure to include it in your PR.