feat: Add Bun and Deno to typescript support check
This change allows the Bun and Deno runtimes to use this loader with Fastify base without erroring as seen in #317.
Tests
Node
No regressions, everything passing.
Bun
bun run typescript✅bun run typescript:jest✅bun run typescript:vitest✅bun run unit✅unit.jsupdated to consume an arg for the runtime
- The bun equivalent of the loader tests that execute
test/typescript/basic.tscannot be run as a particular function Tap uses has not yet been implemented in BunNotImplementedError: node:v8 Serializer is not yet implemented in Bun.
Deno
deno task typescript✅- Deno implements
ServerResponseas a class, while node a function, which causes this error in Fastify.Class constructor ServerResponse cannot be invoked without 'new'- This causes the following to fail
deno task typescript:jest❌deno task typescript:vitest❌deno task unit❌
While it has already been communicated that Fastify is not actively supporting either Bun or Deno runtimes, despite the results, it would be great to see this check updated to allow their usage at a "ymmv" degree.
Fixes #317
Checklist
- [x] run
npm run test - [x] tests are included
- [x] ~documentation is changed or added~
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct
Currently we do not support Bun or Deno on Fastify.
While I understand that is the official stance, as noted in your link, with all of the other supported tooling already included would it really do any harm to simply allow this check to pass for these runtimes?
and I would not accept a PR without tests either.
You beat me to it, I amended my commit with the bun tests I intended to push originally :)
Fastify is simply incompatible with Deno currently, I'm happy to include another test run file to run against deno but it will fail and not add value
Please merge, this is the only problem I have faced regarding bun support in fastify.
For anyone else stumbling on this: Adding FASTIFY_AUTOLOAD_TYPESCRIPT=true to your .env is a temporary fix
Resolved the conflict but it's failing now, I'll check why when I get home
@gurgunday any news about this?
@ilteoood honestly I totally forgot about this one, you (or the original author) can take it over
The repo is archived. So no way to keep this PR.
Superseeded by #480