Skip to content

Deprecated API usage (#2575)#2594

Merged
mcollina merged 1 commit intofastify:masterfrom
humphd:issue-2575
Oct 4, 2020
Merged

Deprecated API usage (#2575)#2594
mcollina merged 1 commit intofastify:masterfrom
humphd:issue-2575

Conversation

@humphd
Copy link
Copy Markdown
Contributor

@humphd humphd commented Oct 1, 2020

Checklist

This fixes #2575, switching to use request.socket over the deprecated request.connection. It relies on fastify/light-my-request#99, and updates light-my-request to 4.1.0. I've also updated request.test.js to provide the required socket and/or connection properties as necessary.

Copy link
Copy Markdown
Contributor

@L2jLiga L2jLiga left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Copy Markdown
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

I think we should log a deprecation warning with fastify-warning when using req.coonnection instead of req.socket (which we should add).

@zekth
Copy link
Copy Markdown
Member

zekth commented Oct 2, 2020

I think we should log a deprecation warning with fastify-warning when using req.coonnection instead of req.socket (which we should add).

+1 on deprecation warning

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@jsumners
Copy link
Copy Markdown
Member

jsumners commented Oct 2, 2020

I think we should log a deprecation warning with fastify-warning when using req.coonnection instead of req.socket (which we should add).

Agreed. It'll be easier this time @humphd because we already have deprecations supported here :)

@Ethan-Arrowood
Copy link
Copy Markdown
Member

I think we should log a deprecation warning with fastify-warning when using req.coonnection instead of req.socket (which we should add).

We should also be sure to update the types making use of the @deprecated tag. This will notify/warn devs if they use the property before they even run their app 😄

* Add request.socket, deprecate request.connection

* Add deprecation warning FSTDEP005 for request.connection on node 13.0.0+

* Switch to use request.socket internally

* Update tests to use .socket

* Update docs

* Update types to deprecate connection, add socket

* Bump light-my-request to 4.1.0
@humphd
Copy link
Copy Markdown
Contributor Author

humphd commented Oct 4, 2020

Sorry, I didn't realize that this needed to include both properties. I've made the adjustments, and now do a proper warning. I think I've found all the doc/test/type references, but please let me know if I'm missing something.

This also fixes #2599

Copy link
Copy Markdown
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 6, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecated API usage

9 participants