Feature #21563

Include babel-plugin-transform-class-properties so we can use static class variables

Added by Walden Raines 9 months ago. Updated 8 days ago.

Status:Closed
Priority:Normal
Assignee:Walden Raines
Category:Web Interface
Target version:1.17.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/4975

Description

In order to do things like this:

class RedHatRepositoriesPage extends Component {
  static defaultProps = {
    redHatRepositoriesResponse: {},
    redHatRepositorySetsResponse: {}
  };

  static propTypes = {
    loadRedHatRepositories: PropTypes.func.isRequired,
    loadRedHatRepositorySets: PropTypes.func.isRequired,
    redHatRepositoriesResponse: PropTypes.object,
    redHatRepositorySetsResponse: PropTypes.object
  };

  ...

}

We need the babel plugin babel-plugin-transform-class-properties. To me, the above is clearer than:

class ChartBox extends React.Component {
  ...
}

ChartBox.PropTypes = {
  status: PropTypes.string.isRequired,
  config: PropTypes.object,
  modalConfig: PropTypes.object,
  id: PropTypes.string.isRequired,
  noDataMsg: PropTypes.string,
  errorText: PropTypes.string
};

Associated revisions

Revision 60c09ae4
Added by Walden Raines 8 months ago

Fixes #21563: add babel-plugin-transform-class-properties.

Add babel-plugin-transform-class-properties to the webpack config
so that we can transform es2015 static class variables into normal
JS.

http://projects.theforeman.org/issues/21563

History

#1 Updated by The Foreman Bot 9 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4975 added

#2 Updated by Walden Raines 8 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#3 Updated by Ohad Levy 8 months ago

  • Legacy Backlogs Release (now unused) set to 296

Also available in: Atom PDF