stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.73k stars 249 forks source link

fix(#1078): TS 4.8 compat #1082

Closed jgoz closed 1 year ago

jgoz commented 1 year ago

Fixes #1078.

Something changed between TS 4.7 and 4.8 that prevents unique symbols from being considered serializable in the type system. I don't know if this change was deliberate or if the previous behavior was incorrect, but I couldn't find any TypeScript issues/PRs that were directly related.

I applied a workaround from https://github.com/microsoft/TypeScript/issues/37888#issuecomment-846638356, which avoids direct serialization of $$PropertyValue and $$ScaleValue by writing them as imports instead. Based on the type tests, it seems like this didn't break anything, but it's possible there are second order effects beyond what is being tested inside the this project.

It might be worth logging a TypeScript issue if we feel the previous behavior was correct and desirable, if only to get an answer from the team. In the meantime, this PR might unblock upgrades.

ivanbanov commented 1 year ago

@hadihallak any chance that we get it out of the door? 🙏 🥺

vorillaz commented 1 year ago

Hi all.

I honestly don't want to be this kind of person but this PR seems like a deal breaker for people using stitches or willing to start using the project.

Hope it will get merged soon, thanks a ton for your wonderful work.

jgoz commented 1 year ago

Btw, I logged a TypeScript bug for this issue, but no guarantees that it will be fixed, so this workaround might continue to be relevant: https://github.com/microsoft/TypeScript/issues/50720

linuz90 commented 1 year ago

Any update on this? Using Stitches for Typefully and can't find a way to remove the errors and build the project now.

I'd even install the Stitches canary if possible.

hadihallak commented 1 year ago

@linuz90 I think we're going to release a beta around early next week. If you're in a rush then I'd suggest you build it and then publish to your personal npm account as a temporarily solution

linuz90 commented 1 year ago

I think I'll try with the Typescript downgrade until then, glad to hear a beta is coming soon 🙌

gajus commented 1 year ago

I am assuming this was not released?

jgoz commented 1 year ago

It's in the latest beta releases.