Skip to content

Commit

Permalink
fix: add @babel/plugin-transform-class-properties to workaround bug i…
Browse files Browse the repository at this point in the history
…n Safari 15 (#91)

* fix: add @babel/plugin-proposal-class-properties to workaround bug in Safari 15

* fix: switch to plugin-transform-class-properties

* chore: add plugin to package.json
  • Loading branch information
melikhov-dev authored Oct 31, 2023
1 parent 4ad60ca commit c69b82e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@babel/core": "^7.22.0",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/plugin-proposal-decorators": "^7.22.0",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-dynamic-import": "^7.22.0",
"@babel/plugin-transform-modules-commonjs": "^7.22.0",
"@babel/plugin-transform-runtime": "^7.22.0",
Expand Down
7 changes: 7 additions & 0 deletions src/common/babel/ui-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ module.exports = function (_context: unknown, options: Record<string, any> = {})
const plugins = [
// Polyfills the runtime needed for async/await and generators
[require.resolve('@babel/plugin-transform-runtime'), runtimeOptions],
/**
* Safari 15 has a buggy implementation of class properties,
* but @babel/compat-data marks it as stable.
* Can be removed once the issue is fixed and released.
* @see https://github.com/babel/babel/issues/14289
*/
[require.resolve('@babel/plugin-transform-class-properties')],
isEnvProduction && [
require.resolve('babel-plugin-transform-react-remove-prop-types'),
{
Expand Down

0 comments on commit c69b82e

Please sign in to comment.