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

Upgrade JS deps - other dependencies #336

Open
2 tasks
emteknetnz opened this issue Nov 19, 2024 · 1 comment
Open
2 tasks

Upgrade JS deps - other dependencies #336

emteknetnz opened this issue Nov 19, 2024 · 1 comment

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Nov 19, 2024

Split from #308

Upgrade the following dependencies in supported modules to their latest major versions:

  • uuid
  • griddle-react
  • regenerator-runtime
  • qrcode.react
  • query-string

Details of which modules there are in can be found here

Note that immutable has been locked to ^4 as redux-form appears to be incompatible with ^5, at least in our usage of it - explanation

Acceptance criteria

  • uuid, griddle-react, regenerator-runtime, qrcode.react and query-string are upgraded to the latest major version in all supported modules
  • @testing-library/react is upgraded from 14 to 16

Update regular deps

Kitchen sink CI

PRs

Update @testing-library/react

Kitchen sink CI

  • todo

PRs

@emteknetnz
Copy link
Member Author

Note about qrcode.react

I attempted to upgrade qrcode.react from ^3 to ^4 in silverstripe/totp-authenticator, only to be greeted by a seemingly unsolvable "Warning: Invalid hook call. Hooks can only be called inside of the body of a function component." error which prevented the PR code from showing. To attempt to resolve this I tried converting all class components to functional components in totp and mfa, however this only moved the warning from a component in qrcode.react to one in totp-authenticator.

I did notice that silverstripe/react-injector was using react 16 instead of 18, however "manually" temporarily upgrading this to 18 did not resolve the react hook error.

I eventually decided to just not upgrade qrcode.react and there actually no code diff, just a difference in deps in package.json between the major versions, since the later version is not compatible with our javascript I think it's correct to just use the earlier version. The most recent release of qrcode.react ^3 is sept 2024 so it's still fairly up to date.

Note about griddle-react

I attempted to upgrade griddle-react from 0.8 to 1.13, however the API is very different between to the versions so it's non trivial. The dep is used in asset-admin TableView.js, ThumbnailView.js, and versioned-admin HistoryViewer.js. However I don't think there's even much point upgrading griddle at this point as it's basically abandoned. The last tag was 7 years ago. Instead I think we should migrate to something else, quite possibly using the same library as the new react gridfield will use. The timeframe for this would be after the CMS 6 stable has been released.

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

No branches or pull requests

2 participants