Skip to content

Move the version check from fastify-plugin to fastify itself #2507

@mcollina

Description

@mcollina

🚀 Feature Proposal

Move this check https://github.com/fastify/fastify-plugin/blob/78539fe08010a039f1d16e34f42807b51e240242/plugin.js#L109-L111 from fastify-plugin to fastify itself.
This would have the consequence of adding semver as a dep, but I think it does not matter much (fastify-plugin is ubiquitous anyway).

The check must happen at the beginning of

module.exports = function override (old, fn, opts) {
.

Motivation

We keep receiving bug reports on fastify-plugin because it cannot load fastify. Yarn, ESM, AWS Lambdas, Webpack, they all require special handling. As a result, it's not a viable approach.
Please outline the motivation for the proposal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions