Skip to content
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 forwardProps type #364

Merged
merged 1 commit into from
Aug 16, 2021
Merged

Conversation

oliviertassinari
Copy link
Contributor

@oliviertassinari oliviertassinari commented Aug 15, 2021

The type doesn't seem correct, the docs: https://goober.js.org/api/setup. Noticed, while I was working on mui/material-ui#27776.

The type doesn't seem correct
@vercel
Copy link

vercel bot commented Aug 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cristianbote/goober-rocks/ELT9yrXTpgRQSSk8GaMt5giLaGEP
✅ Preview: https://goober-rocks-git-fork-oliviertassinari-patch-1-cristianbote.vercel.app

@codesandbox-ci
Copy link

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 afe29b9:

Sandbox Source
Vanilla Configuration

@cristianbote
Copy link
Owner

Oh @oliviertassinari that's a good catch! Thank you!

Also nice exploration! 😄 Love the chance you have given to goober. If there's any more feedback you would need to complete it or issues to resolve let me know and I'll make sure to get some time on it.

Have a great one!

@cristianbote cristianbote merged commit 9b48e9b into cristianbote:master Aug 16, 2021
@oliviertassinari oliviertassinari deleted the patch-1 branch August 16, 2021 18:58
@oliviertassinari
Copy link
Contributor Author

oliviertassinari commented Aug 16, 2021

If there's any more feedback you would need to complete it or issues to resolve let me know and I'll make sure to get some time on it.

@cristianbote I have noticed a couple of inconsistencies. The high-level bit of what I could see:

  • This TypeScript error. I had to @ts-ignore, fixed now.
  • styled(a, b) is not supported as in emotion or sc. I had to do styled([a, b]).
  • There are sometimes CSS injection order priority issue when doing styled(styled(div)). I couldn't fix it.
  • We need to (I assume I didn't dive too deep on this one) customize the shouldForwardProp at the instance level, not the global level. I couldn't fix it.
  • In createGlobalStyles, when returning [a, b], if both a and b have a body property, only the property in b win. It's not how emotion and styled-components behave. I had to use a small deepmerge util.
  • emotion and sc have a auto unitless px addition logic. I had to add @emotion/unitless.
  • I couldn't use withComponent. I had to remove support in MUI.
  • There is an issue around how props are forwarded, I didn't have the time to get to the bottom of it, I could see 3-4 different symptoms around it.
  • Likely more I didn't have the time to discover.

It feels like it could work, we aren't too far. I will try to link the potential in the v5 release blog post. Try to recruit members of the community to work on this. Preact support was easier :p. Each issue is a pain to debug 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants