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

Generic Body Parser #561

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Conversation

Phillip9587
Copy link
Contributor

Rebase of #544 as alternative to #550 and #551

cc @wesleytodd @ctcpip

@Phillip9587 Phillip9587 marked this pull request as ready for review November 19, 2024 14:51
index.js Outdated Show resolved Hide resolved
lib/generic-parser.js Outdated Show resolved Hide resolved
lib/generic-parser.js Outdated Show resolved Hide resolved
lib/generic-parser.js Outdated Show resolved Hide resolved
@wesleytodd wesleytodd requested a review from LinusU November 20, 2024 18:45
Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

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

Awesome work getting this back into shape. I am for sure a 👍 on this, but had nits and wanted to agree with your comments about proposed changes. Before a final review time IMO we should land those changes as well but lets maybe give it a bit for other folks like Linus and Chris to have time to review before wasting time if they disagree on those changes.

README.md Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ctcpip ctcpip requested a review from jonchurch November 20, 2024 19:15
@Phillip9587
Copy link
Contributor Author

@wesleytodd @ctcpip @jonchurch I’ve addressed the feedback from earlier comments. Please let me know if there’s anything else that needs improvement, but I believe it’s ready for review now. Thanks!

@Phillip9587
Copy link
Contributor Author

Hi @wesleytodd, @LinusU, @jonchurch,

I hope you're doing well! I wanted to kindly follow up and ask if there's any chance we could move forward with this PR. Let me know if there's anything needed on my end to help move things along.

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

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

Awesome work @Phillip9587! ❤️

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

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

LGTM!

@bjohansebas bjohansebas requested a review from ctcpip January 13, 2025 19:15
package.json Outdated
@@ -46,7 +46,6 @@
"lint": "eslint .",
"test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"test-debug": "npm test -- --timeout 0"
Copy link
Member

Choose a reason for hiding this comment

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

why did you remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was only added for debugging purposes. I can add it back if you want

Copy link
Member

@ctcpip ctcpip left a comment

Choose a reason for hiding this comment

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

sorry, I know you spent some good time on this, but I would like to see the rebase commits cleanly applied so that git history makes sense. there are two or three commits after the rebase that should not be necessary

@Phillip9587
Copy link
Contributor Author

@ctcpip I rebased it again and removed the two unnecessary commits. Let me know if you want me to readd the test-debug script.

@Phillip9587 Phillip9587 requested a review from ctcpip January 13, 2025 20:50
Copy link
Member

@ctcpip ctcpip left a comment

Choose a reason for hiding this comment

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

the commits are still there

Copy link
Contributor Author

@Phillip9587 Phillip9587 left a comment

Choose a reason for hiding this comment

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

Just two minor things I found during the rebase. Should I handle them now or in a follow up PR?


function createBodyParser (parse, options, defaultOptions) {
// Squash the options and the overrides down into one object
var opts = { ...defaultOptions || {}, ...options }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
var opts = { ...defaultOptions || {}, ...options }
var opts = { ...defaultOptions, ...options }

var bytes = require('bytes')
var contentType = require('content-type')
var createError = require('http-errors')
var debug = require('debug')('body-parser:generic')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest passing the debug function as a parameter to createBodyParser(). This will allows the created middlewares to use their namespaces, such as body-parser:json, for debug messages.

@Phillip9587
Copy link
Contributor Author

Phillip9587 commented Jan 13, 2025

the commits are still there

@ctcpip Could you please specify which commits you'd like me to remove?

@ctcpip
Copy link
Member

ctcpip commented Jan 14, 2025

@Phillip9587 Please see my comment in the other PR

@ctcpip
Copy link
Member

ctcpip commented Jan 15, 2025

clean squash and rebase here: #574

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.

5 participants