Skip to content
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

chore: remove React 16.4's obsolete React imports #28571

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

hainenber
Copy link
Contributor

@hainenber hainenber commented May 18, 2024

chore: remove unused React imports

SUMMARY

React imports are no longer necessary starting from React 16.4.0 (source), I ran npx react-codemod update-react-imports. Afterwards, I executed this snippet to confirm everything stays intact

npm ci
npm run build
npm run test
npm run dev-server

Notable changes:

  • Added ESLint configs as recommended per React doc
  • Added Babel and Webpack configs to allow working with new automatic JSX runtime.
  • Fix a build warning due to a type import misdirected as normal import.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

All CI should be green

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Signed-off-by: hainenber <dotronghai96@gmail.com>
@dosubot dosubot bot added the change:frontend Requires changing the frontend label May 18, 2024
@github-actions github-actions bot added plugins packages and removed change:frontend Requires changing the frontend labels May 18, 2024
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber changed the title chore: remove unused React imports chore: remove obsolete React imports May 18, 2024
@hainenber
Copy link
Contributor Author

Converting this to draft as there are weird behaviors after removal

@hainenber hainenber marked this pull request as draft May 18, 2024 13:44
Signed-off-by: hainenber <dotronghai96@gmail.com>
@github-actions github-actions bot added the doc Namespace | Anything related to documentation label May 19, 2024
Signed-off-by: hainenber <dotronghai96@gmail.com>
…tic JSX runtime bundling

Signed-off-by: hainenber <dotronghai96@gmail.com>
This is required to pass corresponding Jest test.

Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber changed the title chore: remove obsolete React imports chore: remove React 16.4's obsolete React imports May 19, 2024
@hainenber
Copy link
Contributor Author

Phew! I've worked out all the edge cases and CI is green now, re-open for review :D

@hainenber hainenber marked this pull request as ready for review May 19, 2024 14:58
@dosubot dosubot bot added the change:frontend Requires changing the frontend label May 19, 2024
@michael-s-molina
Copy link
Member

Thank you for the PR @hainenber. Can we add a lint rule to prevent unused React imports?

Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber
Copy link
Contributor Author

I've added the lint rule as requested :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend dependencies:npm doc Namespace | Anything related to documentation packages plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants