⚗️ TypeScript-only package with Node 22.6 #64
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An attempt at using TypeScript without a compilation process
📝 Description
Node.js added
--experimental-strip-types
inv22.6.0
, which allows it to run TypeScript files without a compilation process.Avoiding the build step to run Node.js TypeScript applications could be very useful for all projects running directly with Node, like Express applications. It can drastically simplify the deployment process, particularly with Cloud Functions.
However, published CLI apps might not work if
--experimental-strip-types
cannot be passed to files listed inbin
. Additionally, published libraries will not work on the browser unless a bundler is used, which is already expected from modern front-end development.I am expecting
--experimental-strip-types
to be the default behaviour in the release of Node 23.Overall, it seems like a TypeScript-only package would cause a very minimal amount of friction in the ecosystem due to browsers always being late to the party.
allowImportingTsExtensions
andnoEmit
intsconfig.json
.ts
src
engines
tonode
>=22.6
node-version: >= 22.6
tsx
from thedevDependencies
📓 References
Unable to find Node version 'lts'
actions/setup-node#761