Skip to content

🏗 Remove request package and friends - #33613

Merged
alanorozco merged 17 commits into
ampproject:masterfrom
alanorozco:no-request
Apr 7, 2021
Merged

alanorozco merged 17 commits into
ampproject:masterfrom
alanorozco:no-request

Conversation

@alanorozco

Copy link
Copy Markdown
Member

The npm package request has been deprecated.

request/request#3142

The main suggested alternative is node-fetch, which we already use.

request/request#3143

Looks like a good opportunity to clear request and request-promise from our dependencies.

@alanorozco
alanorozco requested a review from rsimha April 2, 2021 17:49
Comment thread build-system/server/app.js Resolved
@samouri

samouri commented Apr 5, 2021

Copy link
Copy Markdown
Member

Love this ⚡

Comment thread build-system/server/app.js Resolved

@rsimha rsimha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Super happy to see PRs of this sort. LGTM with one optional comment re: fs vs. fs-extra.

Comment thread build-system/server/app.js Resolved
Comment thread build-system/server/app.js Resolved
Comment thread package.json Resolved
Comment thread build-system/tasks/bundle-size/index.js Outdated
}

/**
* Helper that lazily imports node-fetch, and does a JSON POST request.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we keep it lazy? It was to reduce Node startup time

@rsimha rsimha Apr 7, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not really necessary unless flame graphs (npx 0x amp.js --help) show that this is as slow to load as the previous library.

@alanorozco
alanorozco merged commit f864be3 into ampproject:master Apr 7, 2021
@alanorozco
alanorozco deleted the no-request branch April 7, 2021 16:16
rochapablo pushed a commit to rochapablo/amphtml that referenced this pull request Aug 30, 2021
The npm package `request` has been deprecated.

request/request#3142

The main suggested alternative is `node-fetch`, which we already use.

request/request#3143

This change replaces `request` and `request-promise` users with `node-fetch`.
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.

4 participants