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

Compose: Drop explicit window reference from withSafeTimeout #9266

Merged
merged 1 commit into from Aug 25, 2018

Conversation

Projects
None yet
2 participants
@ockham
Contributor

ockham commented Aug 23, 2018

Description

Fixes #9265, i.e. makes withSafeTimeout compatible with server side rendering.

How has this been tested?

TBD

Types of changes

Both setTimeout and clearTimeout are methods of the window object, so they are be globally available -- as they are in Node. Removing the explicit window reference unbreaks this for use with Node.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
@gziolo

gziolo approved these changes Aug 25, 2018

The same applies to React Native. It also doesn’t have window object. We should be doing it only for browser specific APIs

@gziolo gziolo merged commit a6ac21d into WordPress:master Aug 25, 2018

2 checks passed

codecov/project 50.69% (-0.01%) compared to e959064
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ockham ockham deleted the ockham:remove/with-safe-timeout-explicit-window-reference branch Aug 25, 2018

ZebulanStanphill added a commit to ZebulanStanphill/gutenberg that referenced this pull request Aug 25, 2018

ZebulanStanphill added a commit to ZebulanStanphill/gutenberg that referenced this pull request Aug 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment