Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jun 25, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues Fix #...
License MIT

In a second PR, I want to be able to run TypeScript natively with Node.js, for bin/*.js scripts. This is doable with Node.js 22.6+ with --experimental-strip-types example.ts flag, see https://nodejs.org/en/learn/typescript/run-natively.

I'm configuring the version through .nvmrc (related to https://github.com/nvm-sh/nvm) instead of specifying it in package.json engines.node, otherwise it became an hard requirement making us impossible to run Node.js <22 (making impossible to run our JS tests for different major Node.js releases like 18 and 20).

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Jun 25, 2025
@Kocal Kocal merged commit 7241dc4 into symfony:2.x Jun 25, 2025
23 of 24 checks passed
@Kocal Kocal deleted the js-versions branch June 25, 2025 18:19
Kocal added a commit that referenced this pull request Jun 28, 2025
This PR was merged into the 2.x branch.

Discussion
----------

Migrate `bin/*.js` to TypeScript, use `tsx`

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Update/add documentation as required (we can help!)
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Types ✨

Following #2865, in fact I didn't go with Node & `--experimental-strip-types` flag, but with https://tsx.is/ instead.

Commits
-------

a0103b4 Migrate `bin/*.js` to TypeScript, use `tsx`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants