atlassian-labs / compiled

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

Protect `@compiled/react/runtime/style-cache` better in browser distributions. #1715

Closed kylorhall-atlassian closed 4 weeks ago

kylorhall-atlassian commented 4 weeks ago

Steps to replicate (inside of our internal repo).

  1. Add Compiled to an ssr.test.tsx with the Atlassian SSR Jest library.
  2. Run tests
  3. :boom:

This is because our bundler for browser dist transform isServerEnvironment() with false inline, so if something in/correctly pulls dist/browser/… all server tests are skipped. See: https://github.com/atlassian-labs/compiled/blob/9a15e7420c436ff959e67004b7c6f46bec08f606/packages/react/tsconfig.browser.json#L9

PR checklist

I don't feel these are applicable:

changeset-bot[bot] commented 4 weeks ago

🦋 Changeset detected

Latest commit: 7562ff225edb8aa2ef9f5da3bece0410d74473aa

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

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | @compiled/react | 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

netlify[bot] commented 4 weeks ago

Deploy Preview for compiled-css-in-js canceled.

Name Link
Latest commit 7562ff225edb8aa2ef9f5da3bece0410d74473aa
Latest deploy log https://app.netlify.com/sites/compiled-css-in-js/deploys/66fb6a6bdf757c00089c61cf