@compiled/react 0.18.6 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/jsx/jsx-dev-runtime.d.ts +6 -1
- package/dist/browser/jsx/jsx-dev-runtime.js +3 -3
- package/dist/browser/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/browser/jsx/jsx-runtime.d.ts +7 -1
- package/dist/browser/jsx/jsx-runtime.js +4 -3
- package/dist/browser/jsx/jsx-runtime.js.map +1 -1
- package/dist/cjs/jsx/jsx-dev-runtime.d.ts +6 -1
- package/dist/cjs/jsx/jsx-dev-runtime.js +15 -5
- package/dist/cjs/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/cjs/jsx/jsx-runtime.d.ts +7 -1
- package/dist/cjs/jsx/jsx-runtime.js +16 -5
- package/dist/cjs/jsx/jsx-runtime.js.map +1 -1
- package/dist/esm/jsx/jsx-dev-runtime.d.ts +6 -1
- package/dist/esm/jsx/jsx-dev-runtime.js +3 -3
- package/dist/esm/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/esm/jsx/jsx-runtime.d.ts +7 -1
- package/dist/esm/jsx/jsx-runtime.js +4 -3
- package/dist/esm/jsx/jsx-runtime.js.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/server-side-hydrate.test.tsx +4 -4
- package/src/jsx/jsx-dev-runtime.ts +3 -3
- package/src/jsx/jsx-runtime.ts +4 -3
- package/src/runtime/__perf__/cs.test.tsx +3 -4
- package/src/runtime/__tests__/style.test.tsx +1 -1
- package/src/styled/__tests__/index.test.tsx +1 -1
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsxDEV: typeof ReactJSXRuntimeDev.jsxDEV;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
2
|
+
export const Fragment = ReactJSXRuntimeDev.Fragment;
|
|
3
|
+
export const jsxDEV = ReactJSXRuntimeDev.jsxDEV;
|
|
4
4
|
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC;AACpD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsx: typeof ReactJSXRuntime.jsx;
|
|
8
|
+
export declare const jsxs: typeof ReactJSXRuntime.jsxs;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
2
|
+
export const Fragment = ReactJSXRuntime.Fragment;
|
|
3
|
+
export const jsx = ReactJSXRuntime.jsx;
|
|
4
|
+
export const jsxs = ReactJSXRuntime.jsxs;
|
|
4
5
|
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;AACjD,MAAM,CAAC,MAAM,GAAG,GAA+B,eAAe,CAAC,GAAG,CAAC;AACnE,MAAM,CAAC,MAAM,IAAI,GAAgC,eAAe,CAAC,IAAI,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsxDEV: typeof ReactJSXRuntimeDev.jsxDEV;
|
|
@@ -10,11 +10,21 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
15
24
|
};
|
|
16
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
exports.jsxDEV = exports.Fragment = void 0;
|
|
27
|
+
const ReactJSXRuntimeDev = __importStar(require("react/jsx-dev-runtime"));
|
|
28
|
+
exports.Fragment = ReactJSXRuntimeDev.Fragment;
|
|
29
|
+
exports.jsxDEV = ReactJSXRuntimeDev.jsxDEV;
|
|
20
30
|
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0EAA4D;AAC/C,QAAA,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC;AACvC,QAAA,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsx: typeof ReactJSXRuntime.jsx;
|
|
8
|
+
export declare const jsxs: typeof ReactJSXRuntime.jsxs;
|
|
@@ -10,11 +10,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
15
24
|
};
|
|
16
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
exports.jsxs = exports.jsx = exports.Fragment = void 0;
|
|
27
|
+
const ReactJSXRuntime = __importStar(require("react/jsx-runtime"));
|
|
28
|
+
exports.Fragment = ReactJSXRuntime.Fragment;
|
|
29
|
+
exports.jsx = ReactJSXRuntime.jsx;
|
|
30
|
+
exports.jsxs = ReactJSXRuntime.jsxs;
|
|
20
31
|
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mEAAqD;AACxC,QAAA,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;AACpC,QAAA,GAAG,GAA+B,eAAe,CAAC,GAAG,CAAC;AACtD,QAAA,IAAI,GAAgC,eAAe,CAAC,IAAI,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsxDEV: typeof ReactJSXRuntimeDev.jsxDEV;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
2
|
+
export const Fragment = ReactJSXRuntimeDev.Fragment;
|
|
3
|
+
export const jsxDEV = ReactJSXRuntimeDev.jsxDEV;
|
|
4
4
|
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAC5D,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC;AACpD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
|
-
|
|
3
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
4
|
+
export declare const Fragment: import("react").ExoticComponent<{
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const jsx: typeof ReactJSXRuntime.jsx;
|
|
8
|
+
export declare const jsxs: typeof ReactJSXRuntime.jsxs;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
2
|
+
export const Fragment = ReactJSXRuntime.Fragment;
|
|
3
|
+
export const jsx = ReactJSXRuntime.jsx;
|
|
4
|
+
export const jsxs = ReactJSXRuntime.jsxs;
|
|
4
5
|
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;AACjD,MAAM,CAAC,MAAM,GAAG,GAA+B,eAAe,CAAC,GAAG,CAAC;AACnE,MAAM,CAAC,MAAM,IAAI,GAAgC,eAAe,CAAC,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compiled/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "A familiar and performant compile time CSS-in-JS library for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiled",
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
"@compiled/benchmark": "^1.1.0",
|
|
79
79
|
"@compiled/utils": "^0.13.0",
|
|
80
80
|
"@fixture/strict-api-test": "*",
|
|
81
|
-
"@testing-library/react": "^
|
|
81
|
+
"@testing-library/react": "^16.1.0",
|
|
82
82
|
"@types/jsdom": "^16.2.15",
|
|
83
|
-
"@types/react-dom": "^
|
|
83
|
+
"@types/react-dom": "^18.3.1",
|
|
84
84
|
"expect-type": "^0.20.0",
|
|
85
85
|
"jsdom": "^19.0.0",
|
|
86
|
-
"react": "^
|
|
87
|
-
"react-dom": "^
|
|
86
|
+
"react": "^18.3.1",
|
|
87
|
+
"react-dom": "^18.3.1"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"react": ">=
|
|
90
|
+
"react": ">=18.0.0"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
3
3
|
|
|
4
4
|
import { CC, CS } from '../runtime';
|
|
5
5
|
|
|
@@ -34,12 +34,12 @@ describe('server side hydrate', () => {
|
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
flushRuntimeModule();
|
|
37
|
-
|
|
37
|
+
hydrateRoot(
|
|
38
|
+
elem,
|
|
38
39
|
<CC>
|
|
39
40
|
<CS>{['.foo { color: blue; }', '.foo { color: blue; }']}</CS>
|
|
40
41
|
<div className="foo">hello world</div>
|
|
41
|
-
</CC
|
|
42
|
-
elem
|
|
42
|
+
</CC>
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
expect(console.error).not.toHaveBeenCalled();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
|
|
4
|
+
export const Fragment = ReactJSXRuntimeDev.Fragment;
|
|
5
|
+
export const jsxDEV = ReactJSXRuntimeDev.jsxDEV;
|
package/src/jsx/jsx-runtime.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { CompiledJSX as JSX } from './jsx-local-namespace';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
import * as ReactJSXRuntime from 'react/jsx-runtime';
|
|
4
|
+
export const Fragment = ReactJSXRuntime.Fragment;
|
|
5
|
+
export const jsx: typeof ReactJSXRuntime.jsx = ReactJSXRuntime.jsx;
|
|
6
|
+
export const jsxs: typeof ReactJSXRuntime.jsxs = ReactJSXRuntime.jsxs;
|
|
@@ -2,7 +2,7 @@ import { runBenchmark } from '@compiled/benchmark';
|
|
|
2
2
|
import { JSDOM } from 'jsdom';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { memo } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { createRoot } from 'react-dom/client';
|
|
6
6
|
import { renderToString } from 'react-dom/server';
|
|
7
7
|
|
|
8
8
|
import { CC, CS } from '../index';
|
|
@@ -66,9 +66,8 @@ describe('CS benchmark', () => {
|
|
|
66
66
|
renderToString(<>{Array.from({ length: 10 }).map((_, i) => jsx(i))}</>);
|
|
67
67
|
}
|
|
68
68
|
: (jsx: (key: number) => JSX.Element) => {
|
|
69
|
-
render(
|
|
70
|
-
<>{Array.from({ length: 10 }).map((_, i) => jsx(i))}
|
|
71
|
-
globalThis.document.getElementById('root')
|
|
69
|
+
createRoot(globalThis.document.getElementById('root')!).render(
|
|
70
|
+
<>{Array.from({ length: 10 }).map((_, i) => jsx(i))}</>
|
|
72
71
|
);
|
|
73
72
|
};
|
|
74
73
|
|
|
@@ -19,7 +19,7 @@ describe('<Style />', () => {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// We want to isolate the test to correctly mimic the environment being loaded in once
|
|
22
|
-
const createIsolatedTest = (callback: (Style: ComponentType) => void) => {
|
|
22
|
+
const createIsolatedTest = (callback: (Style: ComponentType<{ children: string[] }>) => void) => {
|
|
23
23
|
jest.isolateModules(() => {
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
25
25
|
const Style = require('../style');
|
|
@@ -236,7 +236,7 @@ describe('styled component', () => {
|
|
|
236
236
|
});
|
|
237
237
|
|
|
238
238
|
it('should inherit types from composed component', () => {
|
|
239
|
-
const Link = (props: { href: string }) => <a {...props} />;
|
|
239
|
+
const Link = (props: React.PropsWithChildren<{ href: string }>) => <a {...props} />;
|
|
240
240
|
const StyledLink = styled(Link)({
|
|
241
241
|
fontSize: 12,
|
|
242
242
|
});
|