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

Test against older versions of React #14350

Closed
2 tasks
Tracked by #16282
tay1orjones opened this issue Jul 31, 2023 · 1 comment
Closed
2 tasks
Tracked by #16282

Test against older versions of React #14350

tay1orjones opened this issue Jul 31, 2023 · 1 comment
Labels
proposal: not pursuing This has gone through triaging and because of priorities or mission, we will not be pursuing this.

Comments

@tay1orjones
Copy link
Member

tay1orjones commented Jul 31, 2023

This issue will track the status of improving our test suite to include testing against multiple versions of React to ensure compatibility.

The problem

Right now the matrix of React versions officially supported in @carbon/react is React 16, 17, and 18.

"peerDependencies": {
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0",

Currently, the CI checks only test against the version of React we use in development, v18.

"react": "^18.2.0",
"react-dom": "^18.2.0",

Proposed solution

Improve our matrix of testing to include some type of testing using previous/future versions of react.

Open questions

  • Do we have enough bugs with React 16 and 17 to warrant improving this coverage?
  • What's the best way to update our CI to run against multiple versions?
    • An interesting example here: https://github.com/SAP/ui5-webcomponents-react/pull/787/files#diff-bdd00ef7ca7fea0d5b8e26a84ec28cf441b7fd06a7f343231e8027acdfd0cb9d
  • Do our existing test suites pass in React 16 and 17?
    • Does @testing-library/react work in React <18? If not, is it feasible to downgrade this dependency along with React deps without having to rewrite or modify tests or their config?
    • Do we instead need to avoid our existing tests and write new smoke tests for running specifically in React 16 and 17?
  • How can we avoid duplicate snapshotting? We don't want to run vrt multiple times
  • Should @avt tests be ran against multiple versions of react?
  • How much will this increase CI time? Do we need to Improve yarn build time with distributed caching #14244 first?

Steps to ensure compatibility

Preview Give feedback
@github-project-automation github-project-automation bot moved this to Triage in Roadmap Jul 31, 2023
@tay1orjones tay1orjones added the proposal: accepted This request has gone through triaging and we are accepting PR's against it. label Jul 31, 2023
@sstrubberg sstrubberg moved this from Triage to Icebox in Roadmap Aug 10, 2023
@tay1orjones
Copy link
Member Author

tay1orjones commented Jun 7, 2024

Concerns with this approach that were discussed today:

  • Some testing library versions (and other deps) only support certain react versions, and the syntax is different
  • Older dep versions often only support older/unsupported versions of node, or drop support for certain node versions
  • So tests (and the testing environment/deps) would need to be rewritten for react 15,16,17,18
  • We can't afford to rewrite tests in this way and configure the differing specific (older) supported node environments.
  • If we instead focus on new integration tests, we could put together some playwright tests to cover older versions of react. These would have to be just smoke tests though and not really extensive or cover all scenarios or component configurations.
  • If we compare the scale of doing all this work with the surface area of actual bugs we see due to differing react versions, it doesn't seem like this would pay off:
    • Usage of Carbon with React 16 is very low, ~4.9%
    • Usage of Carbon with React 17 is low, ~26.6%
    • Usage of Carbon with React 18 is the highest at ~68.35%
    • Usage of Carbon with React 19 is ~0.15%

Overall the consensus is that this work is not necessary at this time. Instead we will focus our efforts on fixing bugs that emerge in older versions of react as they are reported by users.

That said, #13610 is still valid and should remain open and something we should prioritize.

@tay1orjones tay1orjones closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@github-project-automation github-project-automation bot moved this from Icebox to Completed in Roadmap Jun 7, 2024
@tay1orjones tay1orjones changed the title Test against multiple versions of React Test against older versions of React Jun 7, 2024
@tay1orjones tay1orjones added proposal: not pursuing This has gone through triaging and because of priorities or mission, we will not be pursuing this. and removed proposal: accepted This request has gone through triaging and we are accepting PR's against it. type: enhancement 💡 labels Jun 7, 2024
@carbon-design-system carbon-design-system deleted a comment from github-actions bot Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal: not pursuing This has gone through triaging and because of priorities or mission, we will not be pursuing this.
Projects
Archived in project
Development

No branches or pull requests

1 participant