Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: atlassian-labs/compiled
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @compiled/react@0.16.4
Choose a base ref
...
head repository: atlassian-labs/compiled
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @compiled/react@0.16.5
Choose a head ref
  • 12 commits
  • 40 files changed
  • 8 contributors

Commits on Dec 4, 2023

  1. Support resolver module path (#1569)

    * webpack-loader - add support for resolver module path
    
    ---------
    
    Co-authored-by: stas <sgolovenko@atlassian.com>
    bobrovnik and sgolovenko authored Dec 4, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    66695a2 View commit details

Commits on Dec 5, 2023

  1. Version Packages (#1573)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    atlas-dst-bot and github-actions[bot] authored Dec 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dc402df View commit details
  2. Feature/add no empty styled expressions rule declaration (#1574)

    * DIsabled dependency checking for strict-api
    
    * Added no-empty-styled-expression rule to eslint declarations
    
    * Added changeset
    zerosicx authored Dec 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4518650 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b34dcb5 View commit details
  4. strict-api to import from local instead of @compiled/react (#1577)

    * Updated strict-api import from @compiled/react to local
    
    * Removed changeset
    
    * Removed changeset for @compiled/react
    
    * Changed changeset from minor to patch
    zerosicx authored Dec 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fe384d5 View commit details
  5. Version Packages (#1575)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    atlas-dst-bot and github-actions[bot] authored Dec 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    aa5c2b0 View commit details

Commits on Dec 6, 2023

  1. Fixed eslint rule declaration typo (#1578)

    * fixed the typo from eslint entry point
    
    * Added patch changeset for typo bug
    zerosicx authored Dec 6, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9dd6265 View commit details
  2. Version Packages (#1580)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    atlas-dst-bot and github-actions[bot] authored Dec 6, 2023
    Copy the full SHA
    1dd56a9 View commit details

Commits on Dec 7, 2023

  1. Revert/revert jsx pragma change (#1583)

    * Revert "Fix jsx pragma breaking @compiled/babel-plugin-strip-runtime stylesheet extraction (#1557)"
    
    This reverts commit fbc17ed.
    
    * Add changeset
    JakeLane authored Dec 7, 2023
    Copy the full SHA
    3bb89ef View commit details
  2. Block invalid properties on the strict API cssMap when extended typ…

    …e was met. (#1582)
    
    * Block invalid properties on `cssMap` when extended type was met.
    
    Previously, `asdf` in this example would never error because part of the interface existed, so this was "extended", eg. `{ color: …, asdf: … }` extends `{ color: … }` was true.
    
    So instead of using the inferred generic `TStyles extends …` to enforce, we enforce the type explicitly, and use the inferred generic `TStyles` to build our output type.  This maintains the proper output type while blocking the input type.
    
    More easily visualized in the playground:
    
     - Before: [TS Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBDAnmApnAVHAhgZzgYQGVC4AzKCEOAcgGMcclVqBuAKDZQA9JYFk0RQgAUcKAK4ATCHgC8bOHAA+NAGQAudVlIwUUaguVrNAIyy0A1pIpgDildQ3qTKUtBR2jjzbXEfDDk6+KAC0UCgA5sAQAHaegZqkwFCMIQA2KDC6+gHG6kkpMOnAMf72eRFQWCAgWFAhehQ55d7qtVAWevF5YGnmKAAWEGmSXbmtYhm0MNFx4044qGlpJRENUE3drTB1EZkhulwwW04AbsAoAO4HVTE4wD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DgU0SFkMgQXBgxdS40Jof7WIjBGGFxYXACBQFg74P3A-WqaRoB6WoBqKAycsGpQOElVO1Amo9W8CKLo98C7DHETQKRMiQhyMOEUNRUBFF8PMinVO04A5cIoSgXhAjmEl2Tg-DqpR75EM0WIqAEjdGyOQYYxRyjH69VURAUU1ANGiO0ZIuoeiDFJRCMY0xZkgnBOMB1GAyd8jJFSOCbKkh1AZKyZSIoeSRip0UZErR3iaDhBhHw1JwTHBwH8iYH4vw4hVK8RIoEfhqBmPAeZVOQA)
    
    * Fix strictly scoped test and extend to the `css()` call as well.
    
     - The `expect(getByTestId('div')).toHaveCompiledCss('bkgrnd', 'red');` was wrong.
     - Adds this to `css()` calls to ensure we don't regress in the future.
    
    * Minimize repetition of `TSchema` styles and update generic on `cssMap` to be distinct.
    
    * Split our "invalid css property" test into multiple call sites to test different variants.
    
    ---------
    
    Co-authored-by: Jake Lane <jlane2@atlassian.com>
    kylorhall-atlassian and JakeLane authored Dec 7, 2023
    Copy the full SHA
    cd11b42 View commit details
  3. Fix size-limit (#1586)

    JakeLane authored Dec 7, 2023
    Copy the full SHA
    a03a946 View commit details
  4. Version Packages (#1584)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    atlas-dst-bot and github-actions[bot] authored Dec 7, 2023
    Copy the full SHA
    6526574 View commit details
Showing with 337 additions and 386 deletions.
  1. +1 −1 .github/CODEOWNERS
  2. +7 −0 fixtures/resolver-webpack/CHANGELOG.md
  3. +11 −0 fixtures/resolver-webpack/index.js
  4. +1 −0 fixtures/resolver-webpack/main.js
  5. +6 −0 fixtures/resolver-webpack/package.json
  6. +1 −1 package.json
  7. +8 −0 packages/babel-plugin-strip-runtime/CHANGELOG.md
  8. +2 −2 packages/babel-plugin-strip-runtime/package.json
  9. +2 −189 packages/babel-plugin-strip-runtime/src/__tests__/strip-runtime-source-code.test.ts
  10. +4 −4 packages/babel-plugin-strip-runtime/src/__tests__/strip-runtime-transpiled-code.test.ts
  11. +3 −63 packages/babel-plugin-strip-runtime/src/index.ts
  12. +16 −19 packages/babel-plugin-strip-runtime/src/types.ts
  13. +0 −40 packages/babel-plugin-strip-runtime/src/utils/get-jsx-pragma.ts
  14. +2 −3 packages/babel-plugin-strip-runtime/src/utils/is-create-element.ts
  15. +20 −0 packages/eslint-plugin/CHANGELOG.md
  16. +2 −2 packages/eslint-plugin/package.json
  17. +2 −0 packages/eslint-plugin/src/index.ts
  18. +1 −1 packages/eslint-plugin/src/rules/no-empty-styled-expression/index.ts
  19. +4 −12 packages/eslint-plugin/src/utils/jsx.ts
  20. +1 −1 packages/eslint-plugin/tsconfig.json
  21. +8 −0 packages/parcel-transformer/CHANGELOG.md
  22. +3 −3 packages/parcel-transformer/package.json
  23. +2 −2 packages/parcel-transformer/src/__tests__/transformer.parceltest.ts
  24. +6 −0 packages/react/CHANGELOG.md
  25. +1 −1 packages/react/package.json
  26. +1 −1 packages/react/src/create-strict-api/__tests__/__fixtures__/strict-api.ts
  27. +116 −0 packages/react/src/create-strict-api/__tests__/index.test.tsx
  28. +12 −12 packages/react/src/create-strict-api/index.ts
  29. +6 −0 packages/utils/CHANGELOG.md
  30. +1 −1 packages/utils/package.json
  31. +0 −1 packages/utils/src/index.ts
  32. +0 −2 packages/utils/src/jsx.ts
  33. +14 −0 packages/webpack-loader/CHANGELOG.md
  34. +4 −4 packages/webpack-loader/package.json
  35. +8 −0 packages/webpack-loader/src/__fixtures__/custom-resolver.tsx
  36. +8 −0 packages/webpack-loader/src/__tests__/compiled-loader.test.ts
  37. +3 −0 packages/webpack-loader/src/__tests__/test-utils.ts
  38. +13 −21 packages/webpack-loader/src/compiled-loader.ts
  39. +32 −0 packages/webpack-loader/src/create-default-resolver.ts
  40. +5 −0 packages/webpack-loader/src/types.ts
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* @JakeLane @pancaspe87 @liamqma @dddlr
* @JakeLane @pancaspe87 @liamqma @dddlr @zerosicx
**/package.json
yarn.lock
7 changes: 7 additions & 0 deletions fixtures/resolver-webpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @compiled-private/resolver-webpack

## 0.1.0

### Minor Changes

- 809cc389: Add resolver fixture
11 changes: 11 additions & 0 deletions fixtures/resolver-webpack/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { join } = require('path');

module.exports = {
resolveSync(_, request) {
if (request === 'test') {
return join(__dirname, 'main.js');
}

throw new Error('Unreachable code');
},
};
1 change: 1 addition & 0 deletions fixtures/resolver-webpack/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const primary = 'very-very red color';
6 changes: 6 additions & 0 deletions fixtures/resolver-webpack/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@compiled-private/resolver-webpack",
"version": "0.1.0",
"private": true,
"main": "index.js"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@
},
{
"path": "./packages/react/dist/browser/runtime/style.js",
"limit": "475B",
"limit": "480B",
"import": "CS",
"ignore": [
"react"
8 changes: 8 additions & 0 deletions packages/babel-plugin-strip-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @compiled/babel-plugin-strip-runtime

## 0.26.2

### Patch Changes

- 3bb89ef9: Reverting jsx pragma fix which is causing runtime errors
- Updated dependencies [3bb89ef9]
- @compiled/utils@0.9.1

## 0.25.0

### Minor Changes
4 changes: 2 additions & 2 deletions packages/babel-plugin-strip-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@compiled/babel-plugin-strip-runtime",
"version": "0.25.0",
"version": "0.26.2",
"description": "A familiar and performant compile time CSS-in-JS library for React.",
"homepage": "https://compiledcssinjs.com/docs/pkg-babel-plugin-strip-runtime",
"bugs": "https://github.com/atlassian-labs/compiled/issues/new?assignees=&labels=bug&template=bug_report.md",
@@ -25,7 +25,7 @@
"@babel/traverse": "^7.23.2",
"@babel/types": "^7.21.5",
"@compiled/css": "^0.12.1",
"@compiled/utils": "^0.9.0"
"@compiled/utils": "^0.9.1"
},
"devDependencies": {
"@compiled/babel-plugin": "*",
Original file line number Diff line number Diff line change
@@ -247,194 +247,6 @@ describe('babel-plugin-strip-runtime using source code', () => {
);
});
});

describe('with jsx pragma', () => {
it('work with classic jsx pragma', () => {
const codeWithPragma = `
/** @jsx myJsx */
import { css, jsx as myJsx } from '@compiled/react';
const Component = () => (
<div css={{ fontSize: 12, color: 'blue' }}>
hello world 2
</div>
);
const Component2 = () => (
<div css={css({ fontSize: 12, color: 'pink' })}>
hello world 2
</div>
);
`;

const actual = transform(codeWithPragma, {
run: 'both',
runtime: 'classic',
});

expect(actual).toMatchInlineSnapshot(`
"/* app.tsx generated by @compiled/babel-plugin v0.0.0 */
import * as React from 'react';
import { ax, ix } from '@compiled/react/runtime';
const Component = () =>
/*#__PURE__*/ React.createElement(
'div',
{
className: ax(['_1wyb1fwx _syaz13q2']),
},
'hello world 2'
);
const Component2 = () =>
/*#__PURE__*/ React.createElement(
'div',
{
className: ax(['_1wyb1fwx _syaz32ev']),
},
'hello world 2'
);
"
`);
});

it('work with automatic jsx pragma', () => {
const codeWithPragma = `
/** @jsxImportSource @compiled/react */
import { css } from '@compiled/react';
const Component = () => (
<div css={{ fontSize: 12, color: 'blue' }}>
hello world 2
</div>
);
const Component2 = () => (
<div css={css({ fontSize: 12, color: 'pink' })}>
hello world 2
</div>
);
`;

const actual = transform(codeWithPragma, {
run: 'both',
runtime: 'automatic',
});

expect(actual).toMatchInlineSnapshot(`
"/* app.tsx generated by @compiled/babel-plugin v0.0.0 */
import { ax, ix } from '@compiled/react/runtime';
import { jsxs as _jsxs } from '@compiled/react/jsx-runtime';
import { jsx as _jsx } from '@compiled/react/jsx-runtime';
/** @jsxImportSource @compiled/react */
const Component = () =>
_jsx('div', {
className: ax(['_1wyb1fwx _syaz13q2']),
children: 'hello world 2',
});
const Component2 = () =>
_jsx('div', {
className: ax(['_1wyb1fwx _syaz32ev']),
children: 'hello world 2',
});
"
`);
});

it('work with classic jsx pragma with extractStylesToDirectory', () => {
const codeWithPragma = `
/** @jsx myJsx */
import { css, jsx as myJsx } from '@compiled/react';
const Component = () => (
<div css={{ fontSize: 12, color: 'blue' }}>
hello world 2
</div>
);
const Component2 = () => (
<div css={css({ fontSize: 12, color: 'pink' })}>
hello world 2
</div>
);
`;

const actual = transform(codeWithPragma, {
run: 'both',
runtime: 'classic',
extractStylesToDirectory: { source: 'src/', dest: 'dist/' },
});

expect(actual).toMatchInlineSnapshot(`
"/* app.tsx generated by @compiled/babel-plugin v0.0.0 */
import './app.compiled.css';
import * as React from 'react';
import { ax, ix } from '@compiled/react/runtime';
const Component = () =>
/*#__PURE__*/ React.createElement(
'div',
{
className: ax(['_1wyb1fwx _syaz13q2']),
},
'hello world 2'
);
const Component2 = () =>
/*#__PURE__*/ React.createElement(
'div',
{
className: ax(['_1wyb1fwx _syaz32ev']),
},
'hello world 2'
);
"
`);
});

it('work with automatic jsx pragma with extractStylesToDirectory', () => {
const codeWithPragma = `
/** @jsxImportSource @compiled/react */
import { css } from '@compiled/react';
const Component = () => (
<div css={{ fontSize: 12, color: 'blue' }}>
hello world 2
</div>
);
const Component2 = () => (
<div css={css({ fontSize: 12, color: 'pink' })}>
hello world 2
</div>
);
`;

const actual = transform(codeWithPragma, {
run: 'both',
runtime: 'automatic',
extractStylesToDirectory: { source: 'src/', dest: 'dist/' },
});

expect(actual).toMatchInlineSnapshot(`
"/* app.tsx generated by @compiled/babel-plugin v0.0.0 */
import './app.compiled.css';
import { ax, ix } from '@compiled/react/runtime';
import { jsxs as _jsxs } from '@compiled/react/jsx-runtime';
import { jsx as _jsx } from '@compiled/react/jsx-runtime';
/** @jsxImportSource @compiled/react */
const Component = () =>
_jsx('div', {
className: ax(['_1wyb1fwx _syaz13q2']),
children: 'hello world 2',
});
const Component2 = () =>
_jsx('div', {
className: ax(['_1wyb1fwx _syaz32ev']),
children: 'hello world 2',
});
"
`);
});
});
});

describe('when run in subsequent steps', () => {
@@ -445,13 +257,14 @@ describe('babel-plugin-strip-runtime using source code', () => {
const baked = transform(code, { run: 'bake', runtime });
const actual = transform(baked, { run: 'extract', runtime });

// TODO: This is missing the PURE pragma in the Component return. Fix this.
expect(actual).toMatchInlineSnapshot(`
"/* app.tsx generated by @compiled/babel-plugin v0.0.0 */
import { ax, ix } from '@compiled/react/runtime';
import { jsxs as _jsxs } from 'react/jsx-runtime';
import { jsx as _jsx } from 'react/jsx-runtime';
const Component = () =>
/*#__PURE__*/ _jsx('div', {
_jsx('div', {
className: ax(['_1wyb1fwx _syaz13q2']),
children: 'hello world',
});
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ describe('babel-plugin-strip-runtime using transpiled code', () => {

expect(actual.split('var Component = ')[1]).toMatchInlineSnapshot(`
"() =>
/*#__PURE__*/ (0, _jsxRuntime.jsx)('div', {
(0, _jsxRuntime.jsx)('div', {
className: (0, _runtime.ax)(['_1wyb1fwx _syaz13q2']),
children: 'hello world',
});
@@ -114,7 +114,7 @@ describe('babel-plugin-strip-runtime using transpiled code', () => {
import { jsxs as _jsxs } from 'react/jsx-runtime';
import { jsx as _jsx } from 'react/jsx-runtime';
var Component = () =>
/*#__PURE__*/ _jsx('div', {
_jsx('div', {
className: ax(['_1wyb1fwx _syaz13q2']),
children: 'hello world',
});
@@ -150,7 +150,7 @@ describe('babel-plugin-strip-runtime using transpiled code', () => {

expect(actual.split('var Component = ')[1]).toMatchInlineSnapshot(`
"() =>
/*#__PURE__*/ React.createElement(
React.createElement(
'div',
{
className: (0, _runtime.ax)(['_1wyb1fwx _syaz13q2']),
@@ -169,7 +169,7 @@ describe('babel-plugin-strip-runtime using transpiled code', () => {
import * as React from 'react';
import { ax, ix } from '@compiled/react/runtime';
var Component = () =>
/*#__PURE__*/ React.createElement(
React.createElement(
'div',
{
className: ax(['_1wyb1fwx _syaz13q2']),
Loading