Skip to content

Commit

Permalink
build: update build target from ES5 to ES6
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh committed Apr 25, 2023
1 parent fef7c1d commit 7575b24
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions docs/pages/migration/migration-v3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}))
]
Expand Down

0 comments on commit 7575b24

Please sign in to comment.