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

Allow an import of `jsx` from our internal `@atlaskit/css` package for babel plugin pragma resolutions. #1707

Closed kylorhall-atlassian closed 1 month ago

kylorhall-atlassian commented 1 month ago

What is this change?

With https://github.com/atlassian-labs/compiled/pull/1706, I missed the fact that @compiled/babel-plugin requires jsx to import from strictly @compiled/react and doesn't fully make use of options.importSources here either—that pull request passed in tests and one of my dev envs, but not in a real devloop.

Additionally, this configuration had to be added to @compiled/webpack-plugin which wraps the Babel Plugin and had a hardcoded early exit. For context, @compiled/parcel-plugin already appears to have this functionality: https://github.com/atlassian-labs/compiled/blob/master/packages/parcel-transformer/src/index.ts#L94 and I believe I've manually reviewed all instances of '@compiled/react' being used as a string 🤞

Why are we making this change?

To enable JSX pragmas from any imported options.importSources through Babel and Webpack plugins (and previously ESLint).


PR checklist

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: e4b64c5d282f940d8aff3ee528f6f1e09f79128a

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

This PR includes changesets to release 3 packages | Name | Type | | ---------------------------- | ----- | | @compiled/webpack-loader | Minor | | @compiled/babel-plugin | Minor | | @compiled/parcel-transformer | 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 1 month ago

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

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