-
-
Notifications
You must be signed in to change notification settings - Fork 194
chore: bring in the changes from fastify/send #293
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Update debug
Signed-off-by: Matteo Collina <hello@matteocollina.com>
* chore: disable package-lock generation * ci: use org reusable workflow * chore(.gitignore): use skeleton template * docs: remove security policy, allowing org one to show * chore(package): replace eslint with standard * chore(package): remove engines * docs(readme): update title, add badges * chore: lint files
Bumps [supertest](https://github.com/visionmedia/supertest) from 6.2.2 to 6.3.3. - [Release notes](https://github.com/visionmedia/supertest/releases) - [Commits](forwardemail/supertest@v6.2.2...v6.3.3) --- updated-dependencies: - dependency-name: supertest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.2 to 10.2.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](mochajs/mocha@v9.2.2...v10.2.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* replace mocha with tap * fix coverage issue
* add types, nodenext, upgrade mime * improve test coverage
* use listenerCount immediatly * like before
* remove deprecated option and methods * decrease branch coverage to 95
* 100% test coverage * add ENAMETOOLONG test * add test case for ENOTDIR * fix linting * increase longFilename to 512 characters * patch onStatError for further investigation on windows * try to ignore block for coverage * windows switch * fix linting
* integrate rangeg-parser * named export parseRange
Bumps [tsd](https://github.com/tsdjs/tsd) from 0.31.2 to 0.32.0. - [Release notes](https://github.com/tsdjs/tsd/releases) - [Commits](tsdjs/tsd@v0.31.2...v0.32.0) --- updated-dependencies: - dependency-name: tsd dependency-version: 0.32.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.15.34 to 24.0.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 24.0.8 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsd](https://github.com/tsdjs/tsd) from 0.32.0 to 0.33.0. - [Release notes](https://github.com/tsdjs/tsd/releases) - [Commits](tsdjs/tsd@v0.32.0...v0.33.0) --- updated-dependencies: - dependency-name: tsd dependency-version: 0.33.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 24.10.4 to 25.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 25.0.3 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
| stream.pipe(res) | ||
| } catch (err) { | ||
| res.statusCode = 500 | ||
| res.end(String(err)) |
Check warning
Code scanning / CodeQL
Exception text reinterpreted as HTML Medium test
Exception text
Exception text
Exception text
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
blakeembrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few changes in the test suite from t. to using node:assert that I think we can omit from the PR and follow up on, but LGTM as a starting point to iterate from if the Fastify team is good with this.
| "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
| "James Wyatt Cready <jcready@gmail.com>", | ||
| "Jesús Leganés Combarro <piranna@gmail.com>" | ||
| "Jesús Leganés Combarro <piranna@gmail.com>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent contributors list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you want me to do, remove them or what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can all be written in the same format, no need to remove any. I can also do it in a follow up PR if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s do it in follow-up PRs
LICENSE
Outdated
|
|
||
| Copyright (c) 2012 TJ Holowaychuk | ||
| Copyright (c) 2014-2022 Douglas Christopher Wilson | ||
| Copyright (c) 2023-present The Fastify team |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't change the license so much but we can add:
| Copyright (c) 2023-present The Fastify team | |
| Copyright (c) 2023-2025 Fastify Team (https://github.com/fastify/fastify#team) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per the guidance:
By using this format, the project avoids having to deal with names of copyright holders, years or ranges of years, and variations on the (c) symbol.
I think the changes needs to be:
Copyright The Fastify Contributors.
Copyright The Express Contributors.
and avoid any other changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that was done to maintain compatibility with Node.js 18, since |
5eb769d to
a9e8e6f
Compare
| stream.pipe(res) | ||
| } catch (err) { | ||
| res.statusCode = 500 | ||
| res.end(String(err)) |
Check warning
Code scanning / CodeQL
Exception text reinterpreted as HTML
| stream.pipe(res) | ||
| } catch (err) { | ||
| res.statusCode = 500 | ||
| res.end(String(err)) |
Check warning
Code scanning / CodeQL
Information exposure through a stack trace
|
Next changes would be to go back to using |
Is node 18 a requirement? I didn’t see that mentioned, I thought I this PR was a direct port and we’d do follow up PRs for changes. |
Well, that’s what the latest change does. If you want, I can do restoring that support in a follow-up PR and have this one only bring in the Fastify changes. Edit: I’ve already removed those changes, and now it only supports Node>= 20 because of the test runner features. In follow-up PRs, we can bring back support for Node.js 18, 19 and 21. |
a9e8e6f to
17df4e4
Compare
…/send - I also run the npm run lint:fix command
17df4e4 to
e1469ad
Compare
I wanted to understand if it’s a requirement that I’ve missed somewhere, otherwise I’d push for a new major being v22 onwards. Everything else will be unmaintained by the time this releases as a major. |
What our LTS policy says is a bit vague, and I don’t think the topic has been discussed further or has it? (i don’t remember), but the understanding (and how it has been handled so far), is that the support we have in Express is the minimum we must maintain in dependencies/middlewares. This would indicate that we should support the same minimum Node version that Express supports. https://github.com/expressjs/discussions/blob/master/docs/adr/352-lts-strategy.md#decision
So far, this will be included in Express 5, since Express 6 has not been defined yet |
That is an LTS document for Express, not node.js support, and IIRC in calls I advocated for and it was agreed that the dependency would be maintained as long as depended on in Express, and there was no requirement for new majors to support current express versions. Using a new major in the current Express version is a whole different can of worms, and independent to this PR which is meant to be porting work from a fork. My priority is:
FWIW, if every release had to work in the current major of Express it would be impossible to bump node version support. As such, this PR should only be to port the work and patch minor things (e.g. README, package name) and follow up PRs to figure out the level of support required for old node versions or API changes can be done later. In the original PR description:
This is what the PR should be. I'd leave everything else to future PRs. The most important thing is obtaining ecosystem buy-in from Fastify, then iterating to a place where it's in the best place for as many users as possible (including Fastify, Express, etc). If needed the existing major can be used indefinitely, which isn't unprecedented. I maintained |
blakeembrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy if y'all are, I'll iterate and release this similar to cookie. I'd like to look into further perf optimizations and any potential breaking changes from this PR I can cc @Fdawgs. I don't anticipate breaking things for fun or backward compatibility, only if there's a major performance or maintenance win hidden somewhere that requires it.

Hi! I’m bringing in the changes from fastify/send so we can work on a version that doesn’t break the current send API too much, while still getting the performance improvements from the send fork. The goal is only to bring in the existing changes for now, not to make it compatible yet. I’ve noticed that they removed some dependencies and added their own implementations of those dependencies in their fork; I think we could send those changes upstream so everyone can benefit from them. While it’s probably possible to work on an API in Node core, we also need to focus on our current issues.
base commit: fastify/send@030392f of fastify/send
closes #159
cc: @mcollina @Uzlopak @Fdawgs @climba03003 because they are the ones who maintained the fork.
cc: @pillarjs/express-tc