Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
},
],
'react/no-unescaped-entities': 'off',
'react-compiler/react-compiler': 'error',
'react-hooks/exhaustive-deps': 'off',
'sort-vars': 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"css-loader": "^2.1.1",
"esbuild": "^0.25.6",
"eslint": "^7.1.0",
"eslint-plugin-react-compiler": "^19.0.0-beta-6fc168f-20241025",
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
"fork-ts-checker-webpack-plugin": "^4.0.3",
"jest": "27.5.1",
"jest-fetch-mock": "^3.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/clay-charts/src/BillboardWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const BillboardWrapper = ({
}
}

// eslint-disable-next-line react-compiler/react-compiler
forwardRef.current = null;
};
}, []);
Expand Down
1 change: 1 addition & 0 deletions packages/clay-charts/src/GeoMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ const Geomap = ({

React.useEffect(() => {
if (forwardRef) {
// eslint-disable-next-line react-compiler/react-compiler
forwardRef.current = new GeomapBase({
...otherProps,
data,
Expand Down
8 changes: 5 additions & 3 deletions packages/clay-charts/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ const ClayChart = React.forwardRef<HTMLDivElement, IProps>(
({color, data, elementProps, grid, line, point, ...otherProps}, ref) => {
const defaultRef = React.useRef<any>();

const renderData = {...data};

let ChartComponent;

switch (data.type as Types) {
case 'geo-map':
delete data.type;
delete renderData.type;

ChartComponent = GeoMap;
break;
case 'predictive':
delete data.type;
delete renderData.type;

ChartComponent = Predictive;
break;
Expand All @@ -68,7 +70,7 @@ const ClayChart = React.forwardRef<HTMLDivElement, IProps>(
<ChartComponent
{...otherProps}
color={{pattern: DEFAULT_COLORS, ...color}}
data={data as Data}
data={renderData as Data}
elementProps={elementProps}
grid={Object.assign(DEFAULT_GRID_OBJECT, grid)}
line={{classes: DEFAULT_LINE_CLASSES, ...line}}
Expand Down
4 changes: 3 additions & 1 deletion packages/clay-core/src/collection/useCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ export function useCollection<
[performFilter, publicApi, itemIdKey]
);

const virtualizerItems = virtualizer?.getVirtualItems();

const performCollectionRender = useCallback(
({children, items}: ICollectionProps<T, P>) => {
if (children instanceof Function && items) {
Expand Down Expand Up @@ -370,7 +372,7 @@ export function useCollection<
[
performItemRender,
publicApi,
virtualizer?.getVirtualItems().length,
virtualizerItems?.length,
visibleKeys,
itemIdKey,
]
Expand Down
1 change: 1 addition & 0 deletions packages/clay-core/src/overlay-mask/OverlayMask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export function OverlayMask<T>({
if (typeof ref === 'function') {
ref(node);
} else if (ref !== null) {
// eslint-disable-next-line react-compiler/react-compiler
(ref as React.MutableRefObject<any>).current = node;
}
},
Expand Down
18 changes: 0 additions & 18 deletions packages/clay-core/stories/TreeView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,6 @@ export const PreSelectedItems = (args: any) => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={ITEMS_DRIVE}
Expand Down Expand Up @@ -695,8 +693,6 @@ export const Disabled = () => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={ITEMS_DRIVE}
Expand Down Expand Up @@ -734,8 +730,6 @@ export const MultipleSelection = (args: any) => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={ITEMS_DRIVE}
Expand Down Expand Up @@ -787,8 +781,6 @@ export const MultipleSelectionWithAsyncLoad = (args: any) => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={ITEMS_DRIVE}
Expand Down Expand Up @@ -915,8 +907,6 @@ export const ExpandOnCheck = (args: any) => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={ITEMS_DRIVE}
Expand Down Expand Up @@ -1238,8 +1228,6 @@ export const SelectionWithFilter = () => {

const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

const itemsFiltered = useMemo<any>(() => {
if (!value) {
return items;
Expand Down Expand Up @@ -1305,8 +1293,6 @@ export const PerformanceTest = () => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

const itemsFiltered = useMemo<Data>(() => {
if (!value) {
return items;
Expand Down Expand Up @@ -1522,8 +1508,6 @@ export const DemoCategoriesMultiple = () => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

return (
<TreeView
defaultItems={[
Expand Down Expand Up @@ -1673,8 +1657,6 @@ export const DemoDocumentsMultiple = () => {
// Just to avoid TypeScript error with required props
const OptionalCheckbox = (props: any) => <Checkbox {...props} />;

OptionalCheckbox.displayName = 'ClayCheckbox';

const MAPPING_ICON = {
article: 'web-content',
documents: 'documents-and-media',
Expand Down
1 change: 1 addition & 0 deletions packages/clay-drop-down/src/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const Contextual = ({
});

const setThrottleVisible = useCallback(
// eslint-disable-next-line react-compiler/react-compiler
throttle((value: boolean) => setVisible(value), 100),
[]
);
Expand Down
1 change: 1 addition & 0 deletions packages/clay-shared/src/FocusScope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const FocusScope = ({

if (ref) {
if (typeof ref === 'object') {
// eslint-disable-next-line react-compiler/react-compiler
ref.current = r;
} else if (typeof ref === 'function') {
ref(r);
Expand Down
1 change: 1 addition & 0 deletions packages/clay-shared/src/useFocusManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export function useFocusManagement(scope: React.RefObject<null | HTMLElement>) {

return {
focusFirst: () => {
// eslint-disable-next-line react-compiler/react-compiler
minimalTabIndex = -1;
const next = moveFocusInScope(getFiber(scope), false, true);
minimalTabIndex = 0;
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9005,15 +9005,15 @@ [email protected]:
lodash "^4.17.15"
metric-lcs "^0.1.2"

eslint-plugin-react-compiler@^19.0.0-beta-6fc168f-20241025:
version "19.0.0-beta-6fc168f-20241025"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-compiler/-/eslint-plugin-react-compiler-19.0.0-beta-6fc168f-20241025.tgz#dbd1f54b1019a437f09fc9547bea53f82e6026af"
integrity sha512-mHn5tYt9dT4GiXHF5muiz6p+4Lirgi0Oc87N2KrbB/ciSkT+VZ8iJA+6bbS4//ljYzYbxBbPMHWS/dZWhQrbpQ==
eslint-plugin-react-compiler@^19.1.0-rc.2:
version "19.1.0-rc.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-compiler/-/eslint-plugin-react-compiler-19.1.0-rc.2.tgz#83343e7422e00fa61e729af8e8468f0ddec37925"
integrity sha512-oKalwDGcD+RX9mf3NEO4zOoUMeLvjSvcbbEOpquzmzqEEM2MQdp7/FY/Hx9NzmUwFzH1W9SKTz5fihfMldpEYw==
dependencies:
"@babel/core" "^7.24.4"
"@babel/parser" "^7.24.4"
"@babel/plugin-proposal-private-methods" "^7.18.6"
hermes-parser "^0.20.1"
hermes-parser "^0.25.1"
zod "^3.22.4"
zod-validation-error "^3.0.3"

Expand Down Expand Up @@ -10880,17 +10880,17 @@ [email protected], he@^1.2.0:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

hermes-estree@0.20.1:
version "0.20.1"
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.20.1.tgz#0b9a544cf883a779a8e1444b915fa365bef7f72d"
integrity sha512-SQpZK4BzR48kuOg0v4pb3EAGNclzIlqMj3Opu/mu7bbAoFw6oig6cEt/RAi0zTFW/iW6Iz9X9ggGuZTAZ/yZHg==
hermes-estree@0.25.1:
version "0.25.1"
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480"
integrity sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==

hermes-parser@^0.20.1:
version "0.20.1"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.20.1.tgz#ad10597b99f718b91e283f81cbe636c50c3cff92"
integrity sha512-BL5P83cwCogI8D7rrDCgsFY0tdYUtmFP9XaXtl2IQjC+2Xo+4okjfXintlTxcIwl4qeGddEl28Z11kbVIw0aNA==
hermes-parser@^0.25.1:
version "0.25.1"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
integrity sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==
dependencies:
hermes-estree "0.20.1"
hermes-estree "0.25.1"

highcharts@^9.2.2:
version "9.3.0"
Expand Down
Loading