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

Remove legacy addToBody and callback API #465

Merged
merged 7 commits into from
Sep 1, 2023

Conversation

gurgunday
Copy link
Member

@gurgunday gurgunday commented Jul 26, 2023

I saw #464 and got excited about this plugin again 🤠

We can start by removing the addToBody option that has been deprecated (or at least undocumented) for nearly 2 years now

AFAICT, this closes #289, closes #202 (line coverage gets to 100%), and maybe even #435 (by removing the related part of the code)

Checklist

Copy link
Member

@Eomm Eomm left a comment

Choose a reason for hiding this comment

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

Isn't it the beginner feature?

#464 (comment)

@gurgunday
Copy link
Member Author

gurgunday commented Jul 27, 2023

Isn't it the beginner feature?

#464 (comment)

That would be attachFieldsToBody: true or even better attachFieldsToBody: “keyValues”

https://github.com/fastify/fastify-multipart#parse-all-fields-and-assign-them-to-the-body

addToBody is an undocumented option that uses a deprecated method (ref: #289)

Copy link
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

I think we could start a next branch here

@climba03003 climba03003 changed the base branch from master to next July 28, 2023 17:49
@climba03003 climba03003 mentioned this pull request Jul 28, 2023
2 tasks
@gurgunday
Copy link
Member Author

gurgunday commented Aug 29, 2023

Can we merge this?

addToBody definitely needs to go and I want to start working on the next version without having to fight with conflicts in future PRs 🙏

@gurgunday gurgunday changed the title Remove addToBody Remove legacy addToBody and callback-api Aug 29, 2023
@gurgunday gurgunday changed the title Remove legacy addToBody and callback-api Remove legacy addToBody and callback API Aug 29, 2023
@gurgunday
Copy link
Member Author

CC @climba03003

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

LGTM

@Uzlopak Uzlopak merged commit 1d824e3 into fastify:next Sep 1, 2023
15 checks passed
@gurgunday gurgunday deleted the remove-deprecated branch September 3, 2023 15:17
mcollina pushed a commit that referenced this pull request Sep 28, 2023
…en attachFieldsToBody is set to keyValues (#481)

* Return buffers directly when `attachFieldsToBody` is set to `'keyValues'` (#468)

* return buffer directly

* add test

* move tap path to taprc

* update README.md

* typo

* refactor keyValues handler

* use already set variable

* use for...of

* ditch for...of for Arrays

* use keys rather than entries

* Remove legacy addToBody and callback API (#465)

* remove deprecated method

* remove unused package

* revert modification

* remove addToBody documentation

* remove request.multipart type

* remove legacy comment

* Use for loop for arrays and fix schema option for `keyValues` (#474)

* only add schema when attachfieldstobody is true

* fs/promises

* use `for` for arrays

* conditionally call Object.values

* fix lint

* Update test/multipart-attach-body.test.js

Co-authored-by: Frazer Smith <[email protected]>

* Update README.md

Co-authored-by: Frazer Smith <[email protected]>

---------

Co-authored-by: Uzlopak <[email protected]>
Co-authored-by: Frazer Smith <[email protected]>
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.

migrate out of deprecated API.
4 participants