Skip to content

Replacing deprecated "request" package with native https module#216

Merged
varrocs merged 7 commits into
prerender:masterfrom
123NeNaD:master
Nov 9, 2021
Merged

Replacing deprecated "request" package with native https module#216
varrocs merged 7 commits into
prerender:masterfrom
123NeNaD:master

Conversation

@123NeNaD
Copy link
Copy Markdown
Contributor

@123NeNaD 123NeNaD commented Nov 4, 2021

Since request package is deprecated, CLI always throws warnings for it. I replaced it with native https module, so your package will not have any dependency anymore. I also changed deprecated url.parse with recommended WHATWG URL API. I tested my changes and it works on my side, but you are welcome to test it also before considering to merge the PR.

All the best,
Nenad

Installing packages again without "request" package.

New version of NPM are generating new updated version of package-lock.json file.
PrerenderServiceUrl is set 'https://service.prerender.io/' by default.
But user can override it with process.env.PRERENDER_SERVICE_URL.
In case that user override it with "http" url, "http" module will be used.
Comment thread package-lock.json
@@ -1,37 +1,1836 @@
{
"name": "prerender-node",
"version": "3.3.0",
"lockfileVersion": 1,
"lockfileVersion": 2,
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.

Please stay at lock file version 1 for now.
Use nvm use --lts before running npm install.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is not necessary since v2 is backward compatible with v1.

https://github.blog/2021-02-02-npm-7-is-now-generally-available/#changes-to-the-lockfile

Comment thread index.js Outdated
Comment thread package.json
@varrocs varrocs merged commit 5aedadf into prerender:master Nov 9, 2021
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.

2 participants