atlassian-labs / compiled

A familiar and performant compile time CSS-in-JS library for React.
https://compiledcssinjs.com
Apache License 2.0
1.98k stars 68 forks source link

EXAMPLE: Allow explicit value-blocking in `xcss` prop. #1637

Closed kylorhall-atlassian closed 6 months ago

kylorhall-atlassian commented 6 months ago

[example for @itsdouges to review into https://github.com/atlassian-labs/compiled/pull/1636]

We don't actually need the generic value for this to be valuable, this should block it so an @compiled/react.cssMap with conflicting values is disallowed, but also can allow prop-level restrictions (if we want).

This is by moving CompiledPropertyDeclarationReference to not be optional as that object seemingly messed something up as | CompiledPropertyDeclarationReference was always "truthy" (if that makes sense).

However, this removes the functionality for inline xcss and requires a cssMap or future css(?) to exist..which is probably fine.


This has one remaining scenario not erroring (if I fixed the other inline xcss={{ … }} object tests), but it does error somewhere in the stack, and this is because a cssMap-level type error is typed differently than a non-erroring cssMap?

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: f1fe7766f3a1c534373fd5d6ec6336ebe5ff459b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages | Name | Type | | --------------------------------------------------------- | ----- | | @compiled/react | Minor | | @compiled/parcel-optimizer-test-app | Patch | | @compiled/parcel-transformer-test-app | Patch | | @compiled/parcel-transformer-test-compress-class-name-app | Patch | | @compiled/parcel-transformer-test-custom-resolve-app | Patch | | @compiled/parcel-transformer-test-custom-resolver-app | Patch | | @compiled/parcel-transformer-test-extract-app | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR