refine icon indicating copy to clipboard operation
refine copied to clipboard

[FEAT] Update `@ant-design/charts` package to v2 for examples

Open BatuhanW opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe.

Due to dependency issues with @ant-design/charts@1, we are having installation issues. We have .npmrc file to workaround this issue, but it's not ideal.

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

  1. Update @ant-design/charts package to v2 in the following examples and remove .npmrc:
  1. Test these applications by running locally and make sure they work as expected.

  2. Check if their blog posts needs to be updated:

https://github.com/refinedev/refine/blob/master/documentation/blog/2021-11-12-issue-tracker-refine.md

https://github.com/refinedev/refine/blob/master/documentation/blog/2023-04-06-finefood-admin-dashboard.md

BatuhanW avatar Jan 04 '24 07:01 BatuhanW

Hello, if i am allowed to take this task, i would like to assign it to myself to do it. Thanks for your understanding

devhik0 avatar Jan 09 '24 13:01 devhik0

Hello @devhik0 assigned this issue to you. Looking forward to your PR!

BatuhanW avatar Jan 10 '24 08:01 BatuhanW

Here is PR to check its details. #5523

devhik0 avatar Jan 10 '24 10:01 devhik0

Hey @BatuhanW, i solved that ENV problem via installing cross-env to package.json at root. But now same command still failing due to type error, i ll show it below, hope it helps to understand problem better. This logs coming from nx at terminal also.

[Package: @refinedev/antd, build: fail]
> cli run build --include-dependencies --scope @refinedev/core --scope @refinedev/antd --scope base-antd --includeDependencies
CLI Target: node14
ESM Build start
CJS Build start
IIFE Build start
ESM dist\esm\index.js     81.86 KB
ESM dist\esm\index.js.map 385.65 KB
ESM ⚡️ Build success in 4467ms
CJS dist\index.js     85.31 KB
CJS dist\index.js.map 373.55 KB
CJS ⚡️ Build success in 4518ms
IIFE dist\iife\index.js     215.42 KB
IIFE dist\iife\index.js.map 1.13 MB
IIFE ⚡️ Build success in 4644ms
src/components/table/components/filterDropdown/index.tsx(86,17): error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ onChange: (e: any) => void; value: any; }' is not assignable to parameter of type 'Partial<unknown> & Attributes'.
      Object literal may only specify known properties, and 'onChange' does not exist in type 'Partial<unknown> & Attributes'.
src/hooks/table/useTable/useTable.ts(251,13): error TS2322: Type '(paginationState: TablePaginationConfig, tableFilters: Record<string, (string | number | boolean) | (string | number | boolean)[] | null>, sorter: SorterResult<any> | SorterResult<any>[]) => void' is not assignable to type '(pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<TData> | SorterResult<...>[], extra: TableCurrentDataSource<...>) => void'.
  Types of parameters 'tableFilters' and 'filters' are incompatible.
    Type 'Record<string, FilterValue | null>' is not assignable to type 'Record<string, string | number | boolean | (string | number | boolean)[] | null>'.
      'string' index signatures are incompatible.
        Type 'FilterValue | null' is not assignable to type 'string | number | boolean | (string | number | boolean)[] | null'.
 ELIFECYCLE  Command failed with exit code 2

In same file there is a TS error shows that:

No overload matches this call.
  The last overload gave the following error.
    Object literal may only specify known properties, and 'onChange' does not exist in type 'Partial<unknown> & Attributes'.ts(2769)
86 | const childrenWithProps = React.Children.map(children, (child) => {
        if (React.isValidElement(child)) {
            return React.cloneElement(child, {
                onChange, <---
                value: mappedValue(value),
            });
        }
        return child;
    });

Hope it helps.

devhik0 avatar Jan 10 '24 13:01 devhik0

Hey @BatuhanW, i solved that ENV problem via installing cross-env to package.json at root. But now same command still failing due to type error, i ll show it below, hope it helps to understand problem better. This logs coming from nx at terminal also.

[Package: @refinedev/antd, build: fail]
> cli run build --include-dependencies --scope @refinedev/core --scope @refinedev/antd --scope base-antd --includeDependencies
CLI Target: node14
ESM Build start
CJS Build start
IIFE Build start
ESM dist\esm\index.js     81.86 KB
ESM dist\esm\index.js.map 385.65 KB
ESM ⚡️ Build success in 4467ms
CJS dist\index.js     85.31 KB
CJS dist\index.js.map 373.55 KB
CJS ⚡️ Build success in 4518ms
IIFE dist\iife\index.js     215.42 KB
IIFE dist\iife\index.js.map 1.13 MB
IIFE ⚡️ Build success in 4644ms
src/components/table/components/filterDropdown/index.tsx(86,17): error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ onChange: (e: any) => void; value: any; }' is not assignable to parameter of type 'Partial<unknown> & Attributes'.
      Object literal may only specify known properties, and 'onChange' does not exist in type 'Partial<unknown> & Attributes'.
src/hooks/table/useTable/useTable.ts(251,13): error TS2322: Type '(paginationState: TablePaginationConfig, tableFilters: Record<string, (string | number | boolean) | (string | number | boolean)[] | null>, sorter: SorterResult<any> | SorterResult<any>[]) => void' is not assignable to type '(pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<TData> | SorterResult<...>[], extra: TableCurrentDataSource<...>) => void'.
  Types of parameters 'tableFilters' and 'filters' are incompatible.
    Type 'Record<string, FilterValue | null>' is not assignable to type 'Record<string, string | number | boolean | (string | number | boolean)[] | null>'.
      'string' index signatures are incompatible.
        Type 'FilterValue | null' is not assignable to type 'string | number | boolean | (string | number | boolean)[] | null'.
 ELIFECYCLE  Command failed with exit code 2

In same file there is a TS error shows that:

No overload matches this call.
  The last overload gave the following error.
    Object literal may only specify known properties, and 'onChange' does not exist in type 'Partial<unknown> & Attributes'.ts(2769)
86 | const childrenWithProps = React.Children.map(children, (child) => {
        if (React.isValidElement(child)) {
            return React.cloneElement(child, {
                onChange, <---
                value: mappedValue(value),
            });
        }
        return child;
    });

Hope it helps.

For support, you can use our discord channel or discussions section. Let's not add off-topic comments to the issues. Make sure you run npm ci and npm run coffee after installation. If you are using pnpm, it could be an issue with that. Can't tell for sure.

BatuhanW avatar Jan 10 '24 13:01 BatuhanW

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 05 '24 14:05 stale[bot]