feat(misc)!: remove deprecated js option from component generators#35616
Open
FrozenPandaz wants to merge 1 commit into
Open
feat(misc)!: remove deprecated js option from component generators#35616FrozenPandaz wants to merge 1 commit into
FrozenPandaz wants to merge 1 commit into
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 54de53d
☁️ Nx Cloud last updated this comment at |
1505b17 to
4c363c3
Compare
38f4e4d to
9535867
Compare
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`.
76e1647 to
54de53d
Compare
Contributor
There was a problem hiding this comment.
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:
🎓 Learn more about Self-Healing CI on nx.dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Current Behavior
The
@nx/react,@nx/react-native, and@nx/expocomponent generators expose a--jsoption 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 thepathargument:We are now on Nx v23 — past the deprecation window — but the option still exists.
Expected Behavior
The
--jsoption is removed from the component generators in@nx/react,@nx/react-native, and@nx/expo. Users include the desired file extension directly in thepathargument; the path's extension drives whether.tsx,.jsx,.ts, or.jsfiles 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
--jsoption (out of scope for this change). Internally they now encode.jsinto thepaththey pass to the component generator instead of forwarding the now-removedjsflag.BREAKING CHANGE
The
--jsoption has been removed from:@nx/react:component@nx/react-native:component@nx/expo:componentMigration: include the file extension in the
pathargument, e.g.nx g @nx/react:component mylib/src/lib/foo.jsx.Related Issue(s)
Linear: NXC-3665