4ad9daaa0d
Several dependencies in our javascript web app are currently deadlocked:
create-react-app, react, and swagger-ui. It is not possible to upgrade
just one of those without updating all of them and bringing in many
associated changes. Further complicating things, create-react-app is
no longer maintained.
This change breaks the logjam by doing the following:
* Switch from create-react-app/Webpack to Vite and Rolldown. Vite is
a new build system that provides a development server and bundler
("Rolldown") to replace the build scripts supplied by CRA and bundling
from Webpack.
Vite lives up to its name and is extremely fast. It also makes few
impositions on our app, so we still control routing, fetching, etc,
just as before.
* Switch from jest to vitest. Jest can work with vite, but it's a little
complicated and not recommended. Vitest is API-compatible with jest,
so let's just switch to that. Notably, vitest can run in a hot-reload
fashion (just like the dev server), so unit tests are re-run immediately
after files are saved.
* One of our test libraries, react-test-renderer, is EOL and will not
be updated any more. They recommend using "testing-library" which is
designed not to allow react component introspection. This means that
some of our tests which evaluate the props of react components will need
to be updated to instead just check the actual results in the DOM.
This change updates our code to use testing-library, but does not
implement all of the checks we currently have in our tests. It does
perform some minimal verification, but we may need to rethink our
approach to determine whether it's worth detailed DOM inspection
in the future.
* All dependencies were re-added only as necessary. Generally our
dependency list looks similar to before, but this was a good
opportunity to make sure that everything listed in package.json
is actually still required.
* We had not completely finished the transition from Patternfly 3
to 4. This change completes that transition and removes some
PF3 compatability shims.
* We are updated to the current version of all dependencies except
React itself and PatternFly. We are currently at PatternFly
version 4, while the current version is 6. To upgrade to either
5 or 6 would require substantial work to every page to to the
volume and nature of the PF transition. A decision on how to
approach that is left for later consideration. Instead, we retain
our PF4 implementation and use the latest version of React that
is compatible with that: 18. That's still two major versions
of react newer, and only one behind the current release.
* Swagger-ui is updated from v3 to v5, and uses a new react component.
Note that it's support for newer react versions (19) is questionable,
and it brings in an enormous number of otherwise unused dependencies,
so we may want to consider removing or replacing it with something
else in the future.
* The library we used to display JSON trees is no longer supported,
so it is replaced with a similar one.
Change-Id: Ida44823081c927901f976c93dff6e4230a416646
29 lines
260 B
Plaintext
29 lines
260 B
Plaintext
*.sw?
|
|
*.egg
|
|
*.egg-info
|
|
*.pyc
|
|
*.retry
|
|
.idea
|
|
.mypy_cache
|
|
.test
|
|
.testrepository
|
|
.nox
|
|
.tox
|
|
.venv
|
|
.coverage
|
|
.stestr
|
|
AUTHORS
|
|
build/*
|
|
ChangeLog
|
|
doc/build/*
|
|
zuul/versioninfo
|
|
dist/
|
|
cover/
|
|
htmlcov/
|
|
web/dist
|
|
zuul/web/static/*
|
|
!.keep
|
|
node_modules
|
|
yarn-error.log
|
|
tools/ca/
|