Fastify 4.25.2 发布,Fastify 是一个高度专注于以最少开销和强大的插件架构为开发者提供最佳体验的 Web 框架。 它受到了 Hapi 和 Express 的启发。
新版本主要改进内容包括:
4.25.2
- fix:
npm run test:watch
by @domdomegg in #5221 - fix: always consume stream payloads when responding to 204 with no body by @mcollina in #5231
- docs: update setErrorHandler to explain not found behaviour by @domdomegg in #5218
4.25.1
- fix: route constraints by @climba03003 in #5207
- fix: Better plugin name detection for FSTWRN002 by @mcollina in #5209
- chore: at-large project by @Eomm in #5211
4.25.0
- feat: Improve RouteShorthandOptions['constraints'] type by @Fcmam5 in #5097
- fix: add @Eomm and @jsumners as lead maintainers by @mcollina in #5115
- fix: reply.send supports Uint8Array payload by @SgtPooki in #5124
- refactor: migrate deprecation warnings to actual deprecation warnings by @jsumners in #5126
- docs: added documentation about warnings by @giuliowaitforitdavide in #5108
- test(logger): restrict temp file permissions by @Fdawgs in #5128
- refactor(lib/hooks): replace
typeof
undefined check by @Fdawgs in #5127 - chore: replace mention of fastify
.io
domain with.dev
by @Fdawgs in #5129 - docs(security): add prose explaining OpenSSF CII Best Practices badge results by @ljharb in #5111
- chore: Bump actions/setup-node from 3 to 4 by @dependabot in #5134
- fix(types): add handler property to routeOptions by @MikeJeffers in #5136
- docs(readme): fix ci badge path by @Fdawgs in #5138
- docs: Fix small typo in Typescript docs by @john-ko in #5145
- feat(plugins): mixing async and callback style now returns a warning by @giuliowaitforitdavide in #5139
- docs: mention about multipart support by @fawazahmed0 in #5144
- docs: add @fastify/vite to core plugins list by @galvez in #5153
- docs: add @scalar/fastify-api-reference to community plugins list by @hanspagel in #5154
- docs: Remove routeOptions reference in Reply.md by @shadahmad7 in #5156
- docs(ecosystem): add fastify-uws by @tinchoz49 in #5160
- docs: removed unmaintained fastify-nodemailer from ecosystem by @giovanni-bertoncelli in #5161
- docs: clarify handling of streams and buffers by @brettwillis in #5166
- docs(#5142): aligned errors and warnings documentation by @giuliowaitforitdavide in #5162
- docs(reference/hooks): add information about prehandler by @RjManhas in #5163
- fix: type FastifyInstance['route'] and RouteShorthandMethod by @MunifTanjim in #5155
- docs (reference): Fix small typo in Request by @bngarren in #5186
- chore: gitpodify by @ghostdevv in #5168
- docs(ecosystem): Add Apitally by @itssimon in #5175
- fix: Update reply.context deprecation warning by @avaly in #5179
- docs(ecosystem): adds @blastorg/fastify/aws-dynamodb-cache to community plugins list by @fredrikj31 in #5158
- docs: update preHandler hook example by @tarunrajput in #5189
- types: added http header types to reply by @skwee357 in #5046
- test: add tests for TOC of errors.md by @Uzlopak in #5194
- ci: pin node 18 to 18.18.2 by @Uzlopak in #5197
- docs(ecosystem): add http-wizard by @flodlc in #5132
- chore: Bump actions/github-script from 6 to 7 by @dependabot in #5183
- ci: fix broken ci by skipping tests if node v > 18.19.0 by @Uzlopak in #5195
- fix: allow async hooks in
RouteShorthandOptions
without breakingrequest
andreply
types by @bienzaaron in #5147 - fix(#5180): close secondary bindings after primary is closed by @metcoder95 in #5201
- chore: update process-warning by @Eomm in #5206
- types: nullish error types in callback function's parameter for
after
andready
method by @nokazn in #5191 - fix(#5049): Remove duplicated calls to onReady by @metcoder95 in #5051
- chore: remove unused type assertion by @UndefinedBehaviour in #5184