Skip to content

feat(misc)!: remove deprecated js option from component generators#35616

Open
FrozenPandaz wants to merge 1 commit into
masterfrom
deprecate-component-generators
Open

feat(misc)!: remove deprecated js option from component generators#35616
FrozenPandaz wants to merge 1 commit into
masterfrom
deprecate-component-generators

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

Current Behavior

The @nx/react, @nx/react-native, and @nx/expo component generators expose a --js option to generate JavaScript files instead of TypeScript. The option was deprecated in #29111 (targeted for removal in Nx v21) in favor of including the file extension directly in the path argument:

nx g @nx/react:component mylib/src/lib/foo.jsx

We are now on Nx v23 — past the deprecation window — but the option still exists.

Expected Behavior

The --js option is removed from the component generators in @nx/react, @nx/react-native, and @nx/expo. Users include the desired file extension directly in the path argument; the path's extension drives whether .tsx, .jsx, .ts, or .js files are generated. When no extension is provided, the generators default to .tsx, matching prior behavior.

The library generators in those three packages still keep their own --js option (out of scope for this change). Internally they now encode .js into the path they pass to the component generator instead of forwarding the now-removed js flag.

BREAKING CHANGE

The --js option has been removed from:

  • @nx/react:component
  • @nx/react-native:component
  • @nx/expo:component

Migration: include the file extension in the path argument, e.g. nx g @nx/react:component mylib/src/lib/foo.jsx.

Related Issue(s)

Linear: NXC-3665

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 54de53d
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a024e23e2871600084470cd
😎 Deploy Preview https://deploy-preview-35616--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 54de53d
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a024e233510090008c3152b
😎 Deploy Preview https://deploy-preview-35616--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 8, 2026

View your CI Pipeline Execution ↗ for commit 54de53d

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 13m 45s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 16s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 22s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗
nx affected -t e2e-macos-local --parallel=1 --b... ✅ Succeeded 1m 25s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-12 01:58:02 UTC

nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz FrozenPandaz force-pushed the deprecate-component-generators branch 2 times, most recently from 1505b17 to 4c363c3 Compare May 11, 2026 15:25
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz FrozenPandaz force-pushed the deprecate-component-generators branch from 38f4e4d to 9535867 Compare May 11, 2026 19:03
nx-cloud[bot]

This comment was marked as outdated.

Removes the `js` option from the `@nx/react`, `@nx/react-native`, and
`@nx/expo` component generators. The option was deprecated in #29111
(targeted for v21) in favor of including the file extension directly
in the `path` argument.

The library generators in those packages still keep their own `js`
option; they now encode the `.js` extension into the `path` they pass
to the component generator.

BREAKING CHANGE: The `--js` option has been removed from
`@nx/react:component`, `@nx/react-native:component`, and
`@nx/expo:component`. Include the file extension in the path instead,
e.g. `nx g @nx/react:component mylib/src/lib/foo.jsx`.
@FrozenPandaz FrozenPandaz force-pushed the deprecate-component-generators branch from 76e1647 to 54de53d Compare May 11, 2026 21:46
@FrozenPandaz FrozenPandaz marked this pull request as ready for review May 11, 2026 21:47
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner May 11, 2026 21:47
@FrozenPandaz FrozenPandaz requested a review from lourw May 11, 2026 21:47
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

This CI failure appears to be related to the environment or external dependencies rather than your code changes.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant