Modernize Review Board JavaScript setup.

Review Request #14647 — Created Oct. 31, 2025 and updated — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

This change makes a bunch of changes to modernize our JavaScript build
process across our products:

Better handle npm workspaces.

Prior to this change, we had a reviewboard/package.json file which was
the "real" JS package file, and a symlink from the repository root into
that (for the purposes of npm install). This then also specified a
"workspaces" key which had .npm-workspaces/*, in which we'd
automatically create symlinks for djblets and reviewboard. This ended up
kind of double-installing packages, where we'd have both the top-level
reviewboard as well as a reviewboard inside the workspaces.

This change removes the symlink, and creates a new top-level
package.json file which just specifies the workspaces and scripts. All
actual dependencies now live only inside the reviewboard/package.json
file.

This allows creating additional symbolic links in the workspace
directory in order to bring in development copies of spina, ink,
beanbag-eslint-plugin, or whatever other JS dependencies on desires.

Depending on which JS packages one wants to include in their workspace,
this may require having a shared parent directory and a symbolic link
from ../node_modules to ./node_modules, since some things like to
resolve to absolute paths and then crawl up the directory tree (looking
at you, tsc).

Update and consolidate JS dependencies.

Several updates have been made to our JS dependencies:

  • We now rely on the new @beanbag/js-buildkit metapackage for our
    eslint and typescript dependencies.
  • babel-polyfill has been replaced with core-js and the
    useBuiltIns setting for @babel/preset-env (as per Babel's
    documentation). This ends up transforming the core-js library to only
    include what's needed for the browserslist target.
  • Most other dependencies have been updated to the latest. CodeMirror
    is updated within its major version, since version 6 is completely
    different.
  • Update to Storybook 10.
  • Update to ESLint 9.

Stop vendoring dependencies.

We had a number of things that were vendored into our source tree, many
from before we used node_modules at all.

  • We were both getting jasmine-core through npm as well as vendoring a
    copy of jasmine 5.1.0 into our lib/js directory. I've changed it so the
    js-test-libs index pulls in the relevant jasmine boot files from the
    installed jasmine-core, making it easier and more reliable to upgrade in
    the future. We also had vendored in sourcemapped-stacktrace and
    masonry-layout, which I've changed to also come entirely from npm.

I've also ported our old jasmine-hide-filtered and jasmine-sourcemaps
code to TypeScript.

  • jquery-ui's JavaScript was being pulled from node_modules, but we
    had vendored in a copy of the CSS and some of the images. Fixing this
    required some build-time shenanigans inside settings.py to find the
    relevant files.

  • Masonry (used in the admin dashboard) is a very simple update,
    especially since there haven't been any new versions at all.

Simplify browserslist.

Instead of a complicated browserslist config, I've changed it to just
specify baseline widely available. This ends up pulling in a few
more older versions of browsers than our old config did, but it seems
like it's the right choice in the current age.

Fix an issue in the page-banner CSS.

The newer version of LESS correctly identified :not('.ink-c-button')
as an error. I've removed the quotes so that CSS builds properly.

  • Smoke tested the dev server.
  • Built static media and verified that everything looked correct,
    especially the core-js polyfills and jQuery-UI stylesheets.
  • Ran python tests.
  • Ran js-tests.
  • Ran eslint (eek).
  • Built the rbintegrations extension to verify that static media
    building still worked for that.
  • Ran build-storybook
  • Ran the storybook and flipped through the couple components that are
    there. Verified that things worked as expected.
  • Verified that things that used jQuery-UI (comment dialog, autocomplete
    fields) looked correct.

Commits

Files