-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Update tsx example #6750
Update tsx example #6750
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Another point I'm not a fan of is that only one loader ( |
Previously it listed Also this page isn’t about demonstrating how loaders work; the loaders docs do that. The purpose here is to explain to people how to use TypeScript. |
I agree with you that |
I’m not sure what this means or what you’re asking me to change to resolve this note. The current page already emphasizes |
Lighthouse Results
|
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.
LGTM. I think it's important that we remove this reference to an undocumented & experimental flag that has already caused some confusion. We can discuss broader changes to the page elsewhere.
Yeah sure |
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.
LGTM ! Thanks for updating learn section
Description
This updates the
tsx
example to remove the mention of--loader
, which is an undocumented experimental flag that was created by accident and will likely go away in the future, as the warning states when you use it. The stable, documented, recommended approach is to use--import
instead. See nodejs/node#51196 (comment).ts-node
doesn’t (directly) support--import
, so I’m leaving its example as justnpx ts-node
; there are multiple open issues on their repo asking them to update. I updated thetsx
example to be more user-focused and to usetsx
as the example of registering module hooks via--import
.Validation
https://nodejs-org-git-fork-geoffreybooth-remove-loader-openjs.vercel.app/en/learn/getting-started/nodejs-with-typescript#running-typescript-code-with-tsx
Related Issues
Resolves nodejs/node#51196
Check List
npm run format
to ensure the code follows the style guide.npm run test
to check if all tests are passing.npx turbo build
to check if the website builds without errors.