-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
add experimental-strip-types in app-ts-esm #798
base: main
Are you sure you want to change the base?
Conversation
@@ -162,6 +162,7 @@ function cli (args) { | |||
|
|||
template.devDependencies.c8 = cliPkg.devDependencies.c8 | |||
template.scripts.test = 'npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts' | |||
template.scripts.dev = 'NODE_OPTIONS="--experimental-strip-types" FASTIFY_AUTOLOAD_TYPESCRIPT=1 fastify start -l info src/app.ts' |
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 don't think that we should introduce the --experimental-strip-types
.
That flag is available from node 22.6, but fastify still support also node 20.
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.
it is coming to node 20 soon
Once strip types ships in Node v20, I'd recommend shipping a new version of this as a semver-major. |
Why is |
I tried to run it without this flag, but I got an error. I don't know why
|
fastify/fastify-autoload#442 < I think fastify-autoload would need some fixing. I think we can access process.features to detect if there is the support instead of relying on the version number. |
I modified the app-ts-esm template by inserting the indicated tsconfig
https://nodejs.org/en/learn/typescript/run-natively#running-typescript-code-with-nodejs and erasableSyntaxOnly.
This way the dev script can directly launch the ts file with --experimental-strip-types
Checklist
npm run test
andnpm run benchmark
and the Code of conduct