diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..1d5a6cad --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,16 @@ +# sync with https://github.com/mui/material-ui/blob/v5.12.1/.browserslistrc#L12-L27 +and_chr 91 +and_ff 89 +and_qq 10.4 +and_uc 12.12 +android 91 +baidu 7.12 +chrome 90 +edge 91 +firefox 78 +# 12.4 but 12.2-12.5 are treated equally in caniuse-lite. +# Though caniuse-lite does not supporting finding an exact version in a range which is why `12.4` would result in "Unknown version 12.4 of ios_saf" +ios_saf 12.2 +kaios 2.5 +op_mini all +op_mob 76 diff --git a/docs/pages/migration/migration-v3.mdx b/docs/pages/migration/migration-v3.mdx index 48fb6f5b..6c188de4 100644 --- a/docs/pages/migration/migration-v3.mdx +++ b/docs/pages/migration/migration-v3.mdx @@ -21,6 +21,11 @@ npm install @mui/material @emotion/react @emotion/styled ### Handling breaking changes +#### Check browser compatibility + +This package was set to support `ES5` by default, but it's no longer the case.\ +Since V3, as this package is using `Material-UI`, we have adjusted the browser compatibility to match the [Material-UI's one](https://mui.com/getting-started/supported-platforms/). + #### Use `defineDataType` instead of `createDataType` `serialize` and `deserialize` have been added to datatype to support editing feature on any data type. diff --git a/rollup.config.ts b/rollup.config.ts index 05343312..c90c57f9 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -79,6 +79,11 @@ const buildMatrix = (input: string, output: string, config: { runtime: 'automatic' } } + }, + env: { + // we have to copy this configuration because swc is not handling `.browserslistrc` properly + // see https://github.com/swc-project/swc/issues/3365 + targets: 'and_chr 91,and_ff 89,and_qq 10.4,and_uc 12.12,android 91,baidu 7.12,chrome 90,edge 91,firefox 78,ios_saf 12.2,kaios 2.5,op_mini all,op_mob 76' } })) ]