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

Improve preloading request code #11007

Merged
merged 1 commit into from
Oct 25, 2018

Conversation

schlessera
Copy link
Member

This removes the conditional branching based on the existence of the get_compact_response_links() method on the $server object, as that method was introduced with WordPress 4.5, and Gutenberg requires WordPress 4.9.8 or later.

Also, it turns the indirect and slow call through call_user_func() into a direct method call.

Note: The call would actually be more correct as a static call ($server::get_compact_response_links( $response)), but this notation is PHP 5.3+ only.

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

This removes the conditional branching based on the existence of the `get_compact_response_links()` method on the `$server` object, as that method was introduced with WordPress 4.5, and Gutenberg requires WordPress 4.9.8 or later.

Also, it turns the indirect and slow call through `call_user_func()` into a direct method call.

Note: The call would actually be more correct as a static call (`$server::get_compact_response_links( $response)`), but this notation is PHP 5.3+ only.
@danielbachhuber danielbachhuber added the REST API Interaction Related to REST API label Oct 25, 2018
@danielbachhuber danielbachhuber added this to the 4.2 milestone Oct 25, 2018
Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

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

👍 Want to submit a core patch for this too?

@schlessera
Copy link
Member Author

@danielbachhuber danielbachhuber merged commit 6c7ec27 into master Oct 25, 2018
@danielbachhuber danielbachhuber deleted the fix/avoid-unneeded-call-user-func branch October 25, 2018 17:42
antpb pushed a commit to antpb/gutenberg that referenced this pull request Oct 26, 2018
This removes the conditional branching based on the existence of the `get_compact_response_links()` method on the `$server` object, as that method was introduced with WordPress 4.5, and Gutenberg requires WordPress 4.9.8 or later.

Also, it turns the indirect and slow call through `call_user_func()` into a direct method call.

Note: The call would actually be more correct as a static call (`$server::get_compact_response_links( $response)`), but this notation is PHP 5.3+ only.
daniloercoli added a commit that referenced this pull request Oct 26, 2018
…rnmobile/merge-blocks-on-backspace

* 'master' of https://github.com/WordPress/gutenberg:
  Do not add isDirty prop to DOM (#11093)
  Format API (#10209)
  Remove 4.2 deprecated features (#10952)
  Update `@wordpress/hooks` README to include namespace mention (#11061)
  Feature: save lock control via actions (#10649)
  Fix usage of `preg_quote()` (#10998)
  Update plugin version to 4.1.1 (#11078)
  Improve preloading request code (#11007)
  Fix dynamic blocks not rendering in the frontend (#11050)
  Media & Text: Fixing vertical alignment of the image (#11025)
  Date: Mark getSettings as experimental (#10636)
  Improve handling of centered 1-col galleries with small images (#11040)
  Use better help text for ALT text input; fixes #8391. (#11052)

# Conflicts:
#	packages/editor/src/components/rich-text/index.native.js
@mtias mtias added [Type] Enhancement A suggestion for improvement. [Type] Code Quality Issues or PRs that relate to code quality labels Oct 30, 2018
@mtias
Copy link
Member

mtias commented Oct 30, 2018

Thanks for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REST API Interaction Related to REST API [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants