Skip to content
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

Removes the short-lived tether dependency in react-dates #163

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

majapw
Copy link
Collaborator

@majapw majapw commented Nov 4, 2016

Instead, we're just going to do the thing internally.

Fix for #139 as well.

to: @moonboots @airbnb/webinfra

Ugh

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - couple linter comments. also it'd be good to at least update the PR description to explain in detail why tether didn't work for us.

@@ -378,7 +424,11 @@ export default class DateRangePicker extends React.Component {
const onOutsideClick = !withFullScreenPortal ? this.onOutsideClick : undefined;

return (
<div className={this.getDayPickerContainerClasses()}>
<div
ref={ref => { this.dayPickerContainer = ref; }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the linter should be requiring arg parens here

@@ -224,7 +268,11 @@ export default class SingleDatePicker extends React.Component {
const onOutsideClick = !withFullScreenPortal ? this.onClearFocus : undefined;

return (
<div className={this.getDayPickerContainerClasses()}>
<div
ref={ref => { this.dayPickerContainer = ref; }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

@ljharb ljharb added the semver-patch: fixes/refactors/etc Anything that's not major or minor. label Nov 4, 2016
@majapw majapw added the semver-major: breaking change A non-backwards-compatible change; anything that breaks code - including adding a peerDep. label Nov 4, 2016
@majapw
Copy link
Collaborator Author

majapw commented Nov 4, 2016

I think this is actually going to be a major bump because of the changes in DOM structure and classnames.

const { dayPickerContainerStyles } = this.state;

const containerClientRect = this.dayPickerContainer.getBoundingClientRect();
const documentBodyStyles = window.getComputedStyle(document.body);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call is fairly expensive because it traverses the entire cascade and builds CSSDeclaration. Maybe we can call responsivizePickerPosition inside requestAnimationFrame, what do you think?

@majapw majapw removed the semver-patch: fixes/refactors/etc Anything that's not major or minor. label Nov 4, 2016
@majapw majapw force-pushed the maja-kill-the-tether branch 2 times, most recently from b5c472b to 30cb93a Compare November 4, 2016 23:18
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.3%) to 87.382% when pulling 30cb93a on maja-kill-the-tether into 89fbe36 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.4%) to 86.293% when pulling 5799674 on maja-kill-the-tether into 7736dc6 on master.

@majapw
Copy link
Collaborator Author

majapw commented Nov 7, 2016

Most of these additions cannot really be well tested without DOM manipulation so I'm going to merge this in as is. :/

@majapw majapw merged commit 74e5c9b into master Nov 7, 2016
@majapw majapw deleted the maja-kill-the-tether branch November 7, 2016 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major: breaking change A non-backwards-compatible change; anything that breaks code - including adding a peerDep.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants