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

wpcom-proxy-request: Return Promise if no callback specified (Take Two) #39722

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Feb 27, 2020

Take Two of #39683. Reverts #39721.


Original PR desc:

Changes proposed in this Pull Request

The promise wrapper introduced by @andrewserong et al. in #38823 seems generic enough for it to make sense to have it in wpcom-proxy-request. This PR moves it there. This follows precedent set by wpcom.js.

Note that this is a technically a breaking change, as noted in the package's History.md:

  • [...] Return Promise (rather than XMLHttpRequest instance) if no callback argument is provided.
    • In practice, most people have probably been using the callback rather than the returned XMLHttpRequest instance, so this shouldn't be a breaking change for most.

Testing instructions

Verify that Gutenboarding still works (esp account and site creation).

@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Feb 28, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~315 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-main                  +235 B  (+0.0%)      +87 B  (+0.0%)
entry-login                 +235 B  (+0.0%)      +79 B  (+0.0%)
entry-jetpack-cloud         +235 B  (+0.0%)      +81 B  (+0.0%)
entry-domains-landing       +235 B  (+0.0%)      +78 B  (+0.0%)
entry-gutenboarding         +165 B  (+0.0%)      -10 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@ockham ockham force-pushed the revert-39721-revert-39683-add/wpcom-proxy-request-promise-return branch from 74918ee to 0906388 Compare March 2, 2020 16:28
Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

Let's try again!

@ockham ockham marked this pull request as ready for review March 2, 2020 17:41
@ockham ockham requested review from a team as code owners March 2, 2020 17:41
@ockham ockham merged commit 8ff15c6 into master Mar 3, 2020
@ockham ockham deleted the revert-39721-revert-39683-add/wpcom-proxy-request-promise-return branch March 3, 2020 08:42
ockham added a commit that referenced this pull request Mar 3, 2020
ockham added a commit that referenced this pull request Mar 3, 2020
sirreal added a commit that referenced this pull request Mar 3, 2020
ockham pushed a commit that referenced this pull request Mar 3, 2020
…#39825)

* Revert "Revert "wpcom-proxy-request: Return Promise if no callback specified (Take Two) (#39722)" (#39823)"

This reverts commit 1753cb9.

* Update type location

* Update imports

* Fix tests to use wpcom-proxy-request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants