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

Compose: Drop explicit window reference from withSafeTimeout #9266

Merged
merged 1 commit into from
Aug 25, 2018
Merged

Compose: Drop explicit window reference from withSafeTimeout #9266

merged 1 commit into from
Aug 25, 2018

Conversation

ockham
Copy link
Contributor

@ockham 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 added the [Type] Code Quality Issues or PRs that relate to code quality label Aug 25, 2018
@gziolo gziolo added this to the 3.7 milestone Aug 25, 2018
@gziolo gziolo added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Aug 25, 2018
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

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
@ockham ockham deleted the remove/with-safe-timeout-explicit-window-reference branch August 25, 2018 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants