From 485e315f2d8ea7c236fa21c809db22ace8c9ab1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Miernik?= Date: Wed, 18 Mar 2020 10:55:25 +0100 Subject: [PATCH] Mitigated Babel transpilation issue (fixes #692). --- CHANGELOG.md | 4 ++++ packages/uniforms-antd/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-antd/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-antd/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-antd/src/ValidatedForm.tsx | 9 ++++++--- packages/uniforms-bootstrap3/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-bootstrap3/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-bootstrap3/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-bootstrap3/src/ValidatedForm.tsx | 9 ++++++--- packages/uniforms-bootstrap4/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-bootstrap4/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-bootstrap4/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-bootstrap4/src/ValidatedForm.tsx | 9 ++++++--- packages/uniforms-material/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-material/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-material/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-material/src/ValidatedForm.tsx | 9 ++++++--- packages/uniforms-semantic/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-semantic/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-semantic/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-semantic/src/ValidatedForm.tsx | 9 ++++++--- packages/uniforms-unstyled/src/AutoForm.tsx | 9 ++++++--- packages/uniforms-unstyled/src/BaseForm.tsx | 9 ++++++--- packages/uniforms-unstyled/src/QuickForm.tsx | 9 ++++++--- packages/uniforms-unstyled/src/ValidatedForm.tsx | 9 ++++++--- 25 files changed, 148 insertions(+), 72 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de4cf07c5..04a1edd58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Next: + +- **Fixed:** Mitigated [babel/babel\#10693](https://github.com/babel/babel/issues/10693) in all remaining cases. [\#692](https://github.com/vazco/uniforms/issues/692) + ## [v2.6.6](https://github.com/vazco/uniforms/tree/v2.6.6) (2020-01-22) - **Fixed:** Mitigated [babel/babel\#10693](https://github.com/babel/babel/issues/10693). [\#638](https://github.com/vazco/uniforms/issues/638) diff --git a/packages/uniforms-antd/src/AutoForm.tsx b/packages/uniforms-antd/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-antd/src/AutoForm.tsx +++ b/packages/uniforms-antd/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-antd/src/BaseForm.tsx b/packages/uniforms-antd/src/BaseForm.tsx index 86c9d7c3f..08f42a6e2 100644 --- a/packages/uniforms-antd/src/BaseForm.tsx +++ b/packages/uniforms-antd/src/BaseForm.tsx @@ -1,10 +1,13 @@ import { BaseForm } from 'uniforms'; -const AntD = (parent: any): any => - class extends parent { +const AntD = (parent: any): any => { + class _ extends parent { static AntD = AntD; static displayName = `AntD${parent.displayName}`; - }; + } + + return _; +}; export default AntD(BaseForm); diff --git a/packages/uniforms-antd/src/QuickForm.tsx b/packages/uniforms-antd/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-antd/src/QuickForm.tsx +++ b/packages/uniforms-antd/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-antd/src/ValidatedForm.tsx b/packages/uniforms-antd/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-antd/src/ValidatedForm.tsx +++ b/packages/uniforms-antd/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm); diff --git a/packages/uniforms-bootstrap3/src/AutoForm.tsx b/packages/uniforms-bootstrap3/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-bootstrap3/src/AutoForm.tsx +++ b/packages/uniforms-bootstrap3/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-bootstrap3/src/BaseForm.tsx b/packages/uniforms-bootstrap3/src/BaseForm.tsx index 767e3b2b3..8d405d6d2 100644 --- a/packages/uniforms-bootstrap3/src/BaseForm.tsx +++ b/packages/uniforms-bootstrap3/src/BaseForm.tsx @@ -2,8 +2,8 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import { BaseForm } from 'uniforms'; -const Bootstrap3 = (parent: any): any => - class extends parent { +const Bootstrap3 = (parent: any): any => { + class _ extends parent { static Bootstrap3 = Bootstrap3; static displayName = `Bootstrap3${parent.displayName}`; @@ -43,6 +43,9 @@ const Bootstrap3 = (parent: any): any => ), }; } - }; + } + + return _; +}; export default Bootstrap3(BaseForm); diff --git a/packages/uniforms-bootstrap3/src/QuickForm.tsx b/packages/uniforms-bootstrap3/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-bootstrap3/src/QuickForm.tsx +++ b/packages/uniforms-bootstrap3/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-bootstrap3/src/ValidatedForm.tsx b/packages/uniforms-bootstrap3/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-bootstrap3/src/ValidatedForm.tsx +++ b/packages/uniforms-bootstrap3/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm); diff --git a/packages/uniforms-bootstrap4/src/AutoForm.tsx b/packages/uniforms-bootstrap4/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-bootstrap4/src/AutoForm.tsx +++ b/packages/uniforms-bootstrap4/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-bootstrap4/src/BaseForm.tsx b/packages/uniforms-bootstrap4/src/BaseForm.tsx index 466be4690..befdfb8da 100644 --- a/packages/uniforms-bootstrap4/src/BaseForm.tsx +++ b/packages/uniforms-bootstrap4/src/BaseForm.tsx @@ -2,8 +2,8 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import { BaseForm } from 'uniforms'; -const Bootstrap4 = (parent: any): any => - class extends parent { +const Bootstrap4 = (parent: any): any => { + class _ extends parent { static Bootstrap4 = Bootstrap4; static displayName = `Bootstrap4${parent.displayName}`; @@ -39,6 +39,9 @@ const Bootstrap4 = (parent: any): any => className: classnames('form', { error }, className), }; } - }; + } + + return _; +}; export default Bootstrap4(BaseForm); diff --git a/packages/uniforms-bootstrap4/src/QuickForm.tsx b/packages/uniforms-bootstrap4/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-bootstrap4/src/QuickForm.tsx +++ b/packages/uniforms-bootstrap4/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-bootstrap4/src/ValidatedForm.tsx b/packages/uniforms-bootstrap4/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-bootstrap4/src/ValidatedForm.tsx +++ b/packages/uniforms-bootstrap4/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm); diff --git a/packages/uniforms-material/src/AutoForm.tsx b/packages/uniforms-material/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-material/src/AutoForm.tsx +++ b/packages/uniforms-material/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-material/src/BaseForm.tsx b/packages/uniforms-material/src/BaseForm.tsx index 8b12f686a..46462b8d2 100644 --- a/packages/uniforms-material/src/BaseForm.tsx +++ b/packages/uniforms-material/src/BaseForm.tsx @@ -1,10 +1,13 @@ import { BaseForm } from 'uniforms'; -const Material = (parent: any): any => - class extends parent { +const Material = (parent: any): any => { + class _ extends parent { static Material = Material; static displayName = `Material${parent.displayName}`; - }; + } + + return _; +}; export default Material(BaseForm); diff --git a/packages/uniforms-material/src/QuickForm.tsx b/packages/uniforms-material/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-material/src/QuickForm.tsx +++ b/packages/uniforms-material/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-material/src/ValidatedForm.tsx b/packages/uniforms-material/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-material/src/ValidatedForm.tsx +++ b/packages/uniforms-material/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm); diff --git a/packages/uniforms-semantic/src/AutoForm.tsx b/packages/uniforms-semantic/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-semantic/src/AutoForm.tsx +++ b/packages/uniforms-semantic/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-semantic/src/BaseForm.tsx b/packages/uniforms-semantic/src/BaseForm.tsx index 73b317db6..6e9d62ef8 100644 --- a/packages/uniforms-semantic/src/BaseForm.tsx +++ b/packages/uniforms-semantic/src/BaseForm.tsx @@ -1,8 +1,8 @@ import classnames from 'classnames'; import { BaseForm } from 'uniforms'; -const Semantic = (parent: any): any => - class extends parent { +const Semantic = (parent: any): any => { + class _ extends parent { static Semantic = Semantic; static displayName = `Semantic${parent.displayName}`; @@ -16,6 +16,9 @@ const Semantic = (parent: any): any => className: classnames('ui', props.className, { error }, 'form'), }; } - }; + } + + return _; +}; export default Semantic(BaseForm); diff --git a/packages/uniforms-semantic/src/QuickForm.tsx b/packages/uniforms-semantic/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-semantic/src/QuickForm.tsx +++ b/packages/uniforms-semantic/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-semantic/src/ValidatedForm.tsx b/packages/uniforms-semantic/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-semantic/src/ValidatedForm.tsx +++ b/packages/uniforms-semantic/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm); diff --git a/packages/uniforms-unstyled/src/AutoForm.tsx b/packages/uniforms-unstyled/src/AutoForm.tsx index 78bdaa14c..74c2f1003 100644 --- a/packages/uniforms-unstyled/src/AutoForm.tsx +++ b/packages/uniforms-unstyled/src/AutoForm.tsx @@ -2,9 +2,12 @@ import { AutoForm } from 'uniforms'; import ValidatedQuickForm from './ValidatedQuickForm'; -const Auto = (parent: any): any => - class extends AutoForm.Auto(parent) { +const Auto = (parent: any): any => { + class _ extends AutoForm.Auto(parent) { static Auto = Auto; - }; + } + + return _; +}; export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-unstyled/src/BaseForm.tsx b/packages/uniforms-unstyled/src/BaseForm.tsx index 2d448350e..66e476c63 100644 --- a/packages/uniforms-unstyled/src/BaseForm.tsx +++ b/packages/uniforms-unstyled/src/BaseForm.tsx @@ -1,10 +1,13 @@ import { BaseForm } from 'uniforms'; -const Unstyled = (parent: any): any => - class extends parent { +const Unstyled = (parent: any): any => { + class _ extends parent { static Unstyled = Unstyled; static displayName = `Unstyled${parent.displayName}`; - }; + } + + return _; +}; export default Unstyled(BaseForm); diff --git a/packages/uniforms-unstyled/src/QuickForm.tsx b/packages/uniforms-unstyled/src/QuickForm.tsx index 50b4b4699..96af449f3 100644 --- a/packages/uniforms-unstyled/src/QuickForm.tsx +++ b/packages/uniforms-unstyled/src/QuickForm.tsx @@ -5,8 +5,8 @@ import BaseForm from './BaseForm'; import ErrorsField from './ErrorsField'; import SubmitField from './SubmitField'; -const Quick = (parent: any): any => - class extends QuickForm.Quick(parent) { +const Quick = (parent: any): any => { + class _ extends QuickForm.Quick(parent) { static Quick = Quick; getAutoField() { @@ -20,6 +20,9 @@ const Quick = (parent: any): any => getSubmitField() { return SubmitField; } - }; + } + + return _; +}; export default Quick(BaseForm); diff --git a/packages/uniforms-unstyled/src/ValidatedForm.tsx b/packages/uniforms-unstyled/src/ValidatedForm.tsx index ad3a3039d..3a91d28fa 100644 --- a/packages/uniforms-unstyled/src/ValidatedForm.tsx +++ b/packages/uniforms-unstyled/src/ValidatedForm.tsx @@ -2,9 +2,12 @@ import { ValidatedForm } from 'uniforms'; import BaseForm from './BaseForm'; -const Validated = (parent: any): any => - class extends ValidatedForm.Validated(parent) { +const Validated = (parent: any): any => { + class _ extends ValidatedForm.Validated(parent) { static Validated = Validated; - }; + } + + return _; +}; export default Validated(BaseForm);