Skip to content

after first browser render, check sizes again (fixes #8) #9

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

Merged
merged 4 commits into from
May 1, 2016
Merged

after first browser render, check sizes again (fixes #8) #9

merged 4 commits into from
May 1, 2016

Conversation

jokeyrhyme
Copy link
Collaborator

@jokeyrhyme jokeyrhyme commented Apr 28, 2016

I've added a second call to sizeComponent() a few frames after componentDidMount().

I tried setTimeout(fn, 0) and that was too early, and I also tried setTimeout(fn, 1e3) and it worked but the delay was far too visibly obvious.

Let me know if you'd like a squash, or if you'd like me to undo some of the other changes I snuck in (as separate commits), or if you have other comments.

Fixes #8

@joeybaker
Copy link
Owner

Thanks @jokeyrhyme! Can you take a look at why the tests are failing?

@jokeyrhyme
Copy link
Collaborator Author

Weird. It's passing the browser tests now in Travis CI, but is still coming up with a failure. I'll look into this later today perhaps.

@joeybaker
Copy link
Owner

Thanks @jokeyrhyme!

@@ -110,18 +115,18 @@ static _componentMap = new Map()
let matchedSize = ''
let matchedWidth = smallestSize.width

// use Array#some() here because #forEach() has no early exit
Copy link
Owner

@joeybaker joeybaker Apr 29, 2016

Choose a reason for hiding this comment

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

Thanks for the adding clarification!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it took me a second to realise why that choice was made, and I figured it was worth spelling out. :)

@jokeyrhyme
Copy link
Collaborator Author

@joeybaker there we go. It was a Travis CI environment issue: not having an X service available for Firefox to use. Green!

@@ -13,3 +14,9 @@ sudo: false

before_install:
- "npm install -g npm@latest"

# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
Copy link
Owner

Choose a reason for hiding this comment

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

Weird that this didn't break before. Thanks!

@joeybaker joeybaker merged commit 095af5c into joeybaker:master May 1, 2016
@joeybaker
Copy link
Owner

@jokeyrhyme Thanks! Released as v2.0.2, and added you as a collaborator. Just use npm run release [patch|minor|major] to publish to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants