Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rebase: Generic Body Parser implemented#524

Closed
ctcpip wants to merge 26 commits intoexpressjs:2.xfrom
ctcpip:generic
Closed

rebase: Generic Body Parser implemented#524
ctcpip wants to merge 26 commits intoexpressjs:2.xfrom
ctcpip:generic

Conversation

Copy link
Member

ctcpip commented May 24, 2024 *
edited
Loading

  • rebases Generic Body Parser implemented #282
    • targeting the 2.x branch
  • fixes object merge logic
  • drops CI support for node <4
  • configures node 8 and 9 runs to use older versions of dependencies (matches v7 config) due to nyc error

rafaell-lycan reacted with thumbs up emoji
ctcpip changed the base branch from master to 2.x May 24, 2024 22:00
ctcpip force-pushed the generic branch from 97f8878 to 806a0c6 Compare May 24, 2024 22:15
inigomarquinez and others added 25 commits May 24, 2024 17:21
ctcpip force-pushed the generic branch from 806a0c6 to 86804fe Compare May 24, 2024 23:22
ctcpip force-pushed the generic branch from e727ee4 to 88f84bd Compare May 24, 2024 23:40
Copy link
Member Author

ctcpip commented May 24, 2024 *
edited
Loading

UlisesGascon added semver-major and removed semver-major labels May 27, 2024
Copy link
Member

wesleytodd commented May 28, 2024

Thanks! I think this one is a bit hard to follow just because it is doing a lot at once. The work needs to be done I am nearly certain one way or another, but reading it in this form to make sure we have something that makes sense together is a bit difficult. Is there any easier smaller chunks we could piece out and land to make this refactor easier to follow?

Copy link

sdellysse commented May 29, 2024

@ctcpip do you consider this the "successor PR" to #282 ? If so, I'll close mine with a comment pointing people here

Copy link
Member Author

ctcpip commented May 29, 2024

@ctcpip do you consider this the "successor PR" to #282 ? If so, I'll close mine with a comment pointing people here

@sdellysse yes

Copy link
Member Author

ctcpip commented May 29, 2024 *
edited
Loading

Is there any easier smaller chunks we could piece out and land to make this refactor easier to follow?

@wesleytodd I suggest:

  • use the split diff view rather than unified
  • the substantive changes are:
    • lib
      • generic-parser.js
    • types
      • json.js
      • raw.js
      • text.js
      • urlencoded.js

Before scrutinizing anything in-depth, it helps to do a quick once-over of the changes to get a feel for it:

  1. first take a look at raw.js
    • note how there is very little code remaining and much is removed
  2. now take a look at generic-parser.js
    • notice that much of the code that was removed from raw.js has moved here
  3. now take a look at text.js
    • notice that it looks an awful lot like raw.js

You'll notice the same for the remaining parser types json.js and urlencoded.js. Most of the code from these parsers was deduplicated into generic-parser.js which forms the base for the other parsers. The specific parsers now only contain the logic necessary for their specific cases beyond what is already provided by the generic parser.

My hope is that at this point, things are clear enough to proceed. If not, an alternate way of chunking this out would be by considering each parser refactor in isolation. So:

  • json.js -> json.js + generic-parser.js
  • raw.js -> raw.js + generic-parser.js
  • ...etc.

You could also look at the individual commits such as added generic parser and converted json parser to use generic parser, etc.

The remaining files we didn't talk about are the test files (the changes of which are small enough), and the GH workflow files, where scorecard was just pulled from mainline, and CI was just updated to remove unsupported node versions and fix dependency issues with 8 and 9.

Copy link
Member

inigomarquinez commented May 31, 2024

Hi @ctcpip !

Thanks for the contribution!

Here my 2 cents:

  • Related to configures node 8 and 9 runs to use older versions of dependencies (matches v7 config) due to nyc error, there is already a PR for that. I suggest to merge that PR first so you don't need to deal with it in yours and as @wesleytodd suggests not doing a lot at once.

  • Related to drops CI support for node <4, I'm not sure if we want to drop that support. @carpasse and I have been migrating a lot of repositories to use GitHub actions instead of travis and in the migration we have kept those versions too for express v4 (express v5 will support only from node >=18). So I would keep those versions in the CI.

Copy link
Member

wesleytodd commented May 31, 2024

Related to drops CI support for node <4, I'm not sure if we want to drop that support.

I agree with this in general, but we were looking at it and it appears this package already dropped those versions at one point, so it might be that this change is just to reflect that it was already released as dropping those node versions.

inigomarquinez reacted with thumbs up emoji

Copy link
Member Author

ctcpip commented May 31, 2024

this PR is meant to land in body-parser v2 and is thus targeting the 2.x branch. the PR for 2.x to merge to master lists dropping support for node below 4.

separately, we should still merge the existing CI PR -- (not sure what's the status with the test failure there). we can rebase 2.x and this branch as needed.

as for whether this branch should include any CI changes at all, if the substantive changes of this PR are good to go, I think it's probably fine to keep them together as they are separate commits and both need to go to 2.x anyway. but if folks want, I can split that off into a separate PR and merge that to 2.x and then rebase this branch off that

inigomarquinez and rafaell-lycan reacted with thumbs up emoji

sdellysse mentioned this pull request Jun 3, 2024
jonchurch self-requested a review June 5, 2024 21:33
jonchurch mentioned this pull request Jun 5, 2024
ctcpip mentioned this pull request Jul 8, 2024
46 tasks
Copy link
Member

wesleytodd commented Jul 22, 2024

I just landed the CI change for 2.x (it just needed to be done so I didn't see a reason to wait on approvals). Do we want to rebase this again and remove the CI changes so that we can run it through the updated CI?

Copy link
Member

wesleytodd commented Jul 25, 2024

@jonchurch I talked with @ctcpip and he was alright if we decided to punt on this until 3.x (and thus 6.x for express). I wanted to check if you are alright with that. I have one remaining item on #66 that I hope to have resolved asap so this is the only remaining one in question. If we are alright delaying more on this I can cut 3.0.0 and update the v5 branch with it which crosses one of the last major remaining todo items off the list.

UlisesGascon mentioned this pull request Sep 10, 2024
8 tasks
UlisesGascon deleted the branch expressjs:2.x October 16, 2024 11:40
UlisesGascon closed this Oct 16, 2024
ctcpip mentioned this pull request Oct 16, 2024
Copy link
Member Author

ctcpip commented Oct 16, 2024

deleting the 2.x branch had the effect of closing this PR. #544 was opened to replace it

Copy link
Member

UlisesGascon commented Oct 17, 2024

deleting the 2.x branch had the effect of closing this PR

I forgot about this pr

ctcpip mentioned this pull request Jan 15, 2025
wesleytodd mentioned this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

jonchurch Awaiting requested review from jonchurch

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants