Skip to content

chore(deps): Use new JSX transform #11524

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

Merged
merged 5 commits into from
Feb 25, 2025
Merged

Conversation

mfrances17
Copy link
Contributor

@mfrances17 mfrances17 commented Feb 13, 2025

What: Closes #9289

Introduces the new JSX transform which removes the need to import React in every file that contains JSX. This is a change required to add support for React 19.

Update 2/20/25:
This implementation covers almost all of patternfly-react... however in react-docs, the index.js and icons.js files still require a react import. This is due to it being required by the current iteration of the doc framework, much like the js files in that repo. The new doc framework that is in development will allow this to be addressed much more easily.

For now, adds a lint configuration to support the new transformation, including a rule to ban the default React import (import React from 'react') in favor of named imports. The linter is set up to warn at this time, and I have filed a separate issue (#11553) to change all affected files (results of running the React codemods as well as any manual changes), as there will be hundreds of source files impacted.

@jonkoops made the majority of the infrastructure changes, adding him here to take a look. Most of the changes will come in the follow-up issue above, want to push this separately. Also need buy-in from the team that we allow the react import for the two doc js files for now and wait for the new doc framework to be implemented to address.

@mfrances17 mfrances17 self-assigned this Feb 13, 2025
@patternfly-build
Copy link
Contributor

patternfly-build commented Feb 13, 2025

@mfrances17 mfrances17 marked this pull request as ready for review February 20, 2025 15:26
@jonkoops
Copy link
Contributor

jonkoops commented Feb 20, 2025

Looking good to me, but it does seem the docs are still failing to build correctly. If there are any PRs related to this that need a review (e.g. in the docs repo), feel free to @ me for a review.

@mfrances17
Copy link
Contributor Author

Looking good to me, but it does seem the docs are still failing to build correctly. If there are any PRs related to this that need a review (e.g. in the docs repo), feel free to @ me for a review.

Thanks, yeah that docs failure is unrelated to these changes... i recently made a change in a separate PR to fix an issue in which a11y violations were occurring on CI but CI was not failing. These a11y violations are fixed in another PR right now, so all pipelines are going to fail until that PR is merged in.

@mfrances17 mfrances17 requested a review from a team February 20, 2025 22:08
@tlabaj tlabaj merged commit dd46604 into patternfly:main Feb 25, 2025
13 checks passed
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.

Use the new JSX tranform
5 participants