-
Notifications
You must be signed in to change notification settings - Fork 2.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
Replace pure-render-decorator with React.PureComponent #386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm onboard for this change but it's a 🔥 serious API break 🔥 as it will require recent versions of React that provides PureComponent.
our current React support story is "^15.0.1 || ^0.14"
and it's unlikely we'll be able to commit to ^15.3
in the near future because of the wide variety of internal apps using older versions.
* A pure abstract component that Blueprint components can extend | ||
* in order to add some common functionality like runtime props validation. | ||
*/ | ||
export abstract class AbstractPureComponent<P, S> extends React.PureComponent<P, S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there must be a way to reuse the code from AbstractComponent
instead of duplicating it here. maybe this is the impetus to refactor AC into separate validation and timeout controllers.
import * as React from "react"; | ||
|
||
import { AbstractComponent } from "../../common/abstractComponent"; | ||
import { AbstractPureComponent } from "../../common/abstractPureComponent"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave the blank line above. it separates import groups so they can be alphabetized separately.
@jxodwyer thank you for implementing this feature! unfortunately we're not ready to accept it as it's a significant API break (requiring React >= 15.3) that we can't commit to yet. I've added it to the |
Sounds good @giladgray Thanks! |
Fixes #144
Changes proposed in this pull request:
@PureRender
decorator withReact.PureComponent
AbstractPureComponent
in order to cover components that were leveraging both@PureRender
andAbstractComponent
. One example of thisReviewers should focus on:
AbstractPureComponent
. Especially in regards to imports like this