-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 15.6 migration #13321
Comments
Due to our use of the auto-injected i18n mixin, it might be worth looking into that before running the |
Hopefully, we can write a codemod that uses that one util from react codemods to locate |
#10268 is closed but I'm aiming to reopen and polish it a little bit soon. The original mixin is only used in a couple of places but, still, we'll need to squish it :) |
|
Codemod to remove |
Introduce in the Comment Management lists both a quick fade out transition for disappearing comments and an undoable global notice in response to actions. ## Changes - Add `ReactCSSTransitionGroup` to handle a fade out transition on component unmount. Please note that `ReactCSSTransitionGroup` is deprecated as of React 15.0, and its replacement is tracked in #13321. - Add global notices in response to actions performed on comments. - All notices (except "Delete Permanently") feature an Undo button, that simply fires the `setCommentStatus` method with the previous comment status. - Undos don't trigger any notice, and are therefore not undoable directly in the notice (they can of course be undone by via comment action). - The notices are not stacked together, but performing multiple actions on the same comment (e.g. `approve -> unapprove -> approve -> etc.`) only displays one single notice containing the last performed action. In other words, we display one notice top for each actioned comment. - The notices are set to last 5 seconds before automatically disappearing. - The notices are persistent on route changes. This is to prevent them to disappear when changing Comment Management list. The side effect, though, is that undoing a notice while outside the Comment Management would trigger the `setCommentStatus` method of the `CommentList` component, which is not mounted anymore.
Context
React 15.6 has several deprecations that would impact us, so I thought others might find these findings useful.
Status
See this project for our current progress.
Summary of Deprecations (that affect Calypso)
React.PropTypes
prop-types
packagenpm run codemod react-proptypes ./client/your-directory
React.createClass
React.Component
(orReact.PureComponent
ifreact-addons-pure-render-mixin
was used).npm run codemod react-create-class ./client/your-directory
react-addons-*
react-addons-create-fragment
react-addons-linked-state-mixin
react-addons-css-transition-group
withreact-transition-group/CSSTransitionGroup
react-addons-update
withimmutability-helper
Custom Calypso mixins will need to be migrated manually.
i8n
mixin auto-injection (many files)lib/mixins/emitter
(72 files)lib/mixins/data-observe
(43 files)lib/mixins/analytics
(28 files)me/event-recorder
(20 files)The text was updated successfully, but these errors were encountered: