Skip to content

Conversation

@LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Oct 2, 2024

Description

This PR will trigger a new major release for @clerk/fastify. The reason is that Fastify v5 isn't backwards compatible with our current plugin as we allow Node.js 18 and they now require Node 20. So we need to bump our engines.

Therefore the new major version of @clerk/fastify will only support Fastify v5, users of older versions need to stick with the current major version.

Fixes #4229

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2024

🦋 Changeset detected

Latest commit: bf3208c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/fastify Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts
Copy link
Contributor Author

LekoArts commented Oct 2, 2024

!allow-major

@LekoArts LekoArts changed the title feat!(fastify): Support Fastify v5 feat(fastify)!: Support Fastify v5 Oct 2, 2024
@LekoArts LekoArts mentioned this pull request Oct 4, 2024
9 tasks
@LekoArts LekoArts marked this pull request as ready for review October 4, 2024 13:35
@brkalow
Copy link
Member

brkalow commented Oct 4, 2024

@LekoArts do we also want to update the root fastify dependency? https://github.com/clerk/javascript/blob/main/package.json#L83

(or maybe we can remove it altogether)

@LekoArts
Copy link
Contributor Author

LekoArts commented Oct 7, 2024

@brkalow Good catch! That's not needed at the root since I've put it into the plugin. Weird that it was there in the first place

Copy link
Member

@brkalow brkalow left a comment

Choose a reason for hiding this comment

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

lgtm! One question about changes to the playground dependencies

Comment on lines -9 to -12
"@clerk/backend": "file:.yalc/@clerk/backend",
"@clerk/fastify": "file:.yalc/@clerk/fastify",
"@clerk/shared": "file:.yalc/@clerk/shared",
"@clerk/types": "file:.yalc/@clerk/types",
Copy link
Member

Choose a reason for hiding this comment

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

should we retain yalc usage here for the playground?

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 removed it because when you use clerk-dev-cli or secco it gets in the way. If we want to dogfood the dev CLI we need to remove yalc ;)

@LekoArts LekoArts enabled auto-merge (squash) October 8, 2024 13:16
@LekoArts LekoArts merged commit bd92d38 into main Oct 8, 2024
21 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-204-support-fastify-v5 branch October 8, 2024 13:43
@jvelezpo
Copy link

jvelezpo commented Oct 9, 2024

Hello! 👋
@LekoArts i installed latest version using fastify v5
and i get the following error

FastifyError [Error]: fastify-plugin: @clerk/fastify - expected '4.x' fastify version, '5.0.0' is installed
    at Object.checkVersion (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginUtils.js:125:11)
    at Object.registerPlugin (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginUtils.js:148:16)
    at Boot.override (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginOverride.js:28:57)
    at Boot._loadPlugin (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/avvio/boot.js:425:25)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
  statusCode: 500
}

Steps to reproduce the issue
run
npm install @clerk/fastify
version installed
"version": "1.0.51"

Maybe the CI did not picked up the latest changes and build the new package with the old code 🤔

Please let me know if i can help or submit a PR i would appreciate a little bit of guidance for it

Thanks.

@wobsoriano
Copy link
Member

wobsoriano commented Oct 9, 2024

@jvelezpo we did not publish this update to NPM yet. Maybe tomorrow.

For now, you can try the canary version

npm install @clerk/fastify@2.0.0-canary.v34b47d1

@LekoArts
Copy link
Contributor Author

LekoArts commented Oct 9, 2024

@jvelezpo Once #4307 is merged it'll be released 👍

@jvelezpo
Copy link

jvelezpo commented Oct 9, 2024

Amazing
Thanks

@LekoArts
Copy link
Contributor Author

LekoArts commented Oct 11, 2024

@jvelezpo That PR has been released, you can upgrade now with npm install @clerk/fastify@latest

wobsoriano pushed a commit that referenced this pull request Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Fastify v5

6 participants