Skip to content

Align the tooling, workflows and development environment with the other projects - #791

Draft
bedrich-schindler wants to merge 43 commits into
masterfrom
maintenance/align-tooling-versions
Draft

bedrich-schindler wants to merge 43 commits into
masterfrom
maintenance/align-tooling-versions

Conversation

@bedrich-schindler

@bedrich-schindler bedrich-schindler commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Align the build, lint and test configs, the GitHub workflows and the
development environment with Docoff and the RACOM projects. The component
source code does not change. The production bundle is smaller, see Behaviour
changes.

Dependencies

  • Pin @playwright/test to 1.65.0, the version of the playwright Docker
    image, and update the Babel, Jest, webpack and other development packages.
  • Replace @typescript/native and the @typescript/typescript6 alias with
    typescript ~6.0.3, which tsc, typescript-eslint and the IDE share.
  • Add jest-fail-on-console.

Build

  • Rename babel.config.js and postcss.config.js to .mjs, and apply
    @babel/preset-react only outside .ts files.
  • Split the webpack config into webpack/ with one file per section, as in
    the other projects. webpack no longer runs Babel on node_modules.
  • Give StyleLintPlugin the glob and ignorePath of lint:stylelint, write
    the VisualizerPlugin output to stats.html, and remove includePaths
    from the sass-loader options.
  • Order the tsconfig.json options, set target to esnext, exclude
    *.test.ts(x) from the declaration build, and type-check
    playwright-ct.config.ts.
  • Remove grid: true from postcss.config.mjs. It added -ms-grid-*
    declarations for Internet Explorer, which no project supports.

Lint

  • Lint scripts, webpack and the root config files with ESLint, with a
    react-ui/tooling block for the tooling files.
  • Use the lint:* scripts of the RACOM projects and add
    .markdownlint-cli2.jsonc, which lints every Markdown file that Git does
    not ignore.
  • Replace the backtracking kebab-case part of selector-class-pattern with
    [a-z0-9]+(-[a-z0-9]+)*-?, which accepts the same names.
  • Use the shared .editorconfig and .markdownlint.jsonc.

Tests

  • Rename jest.config.js to jest.config.mjs, limit Jest to src and
    tests, and replace tests/jest/setupJest.ts with
    tests/jest/setupFailOnConsole.ts.
  • Remove launchOptions from playwright-ct.config.ts, do not open the HTML
    report after a failure, and add test:playwright:clear-cache.
  • Use the RADES mixPropTests, which passes onBeforeTest and
    onBeforeSnapshot through, and rename helpTextAndValidationTextPropType
    to helpTextAndValidationTextPropTest.

CI

  • Pin Node.js and npm through NODE_VERSION and NPM_VERSION, also in
    pull-request-preview.yml, and use actions/checkout@v6 and
    actions/setup-node@v7. lint.yml is the same file as in docoff,
    eslint-config and stylelint-config. The job names do not change.
  • Pass repo-token to pr-labeler-action under with, set the release_url
    output, and install the Playwright browsers once.
  • Build the PR preview when tsconfig.build.json changes, remove the unused
    .github/markdown-link-check.json, and update CODEOWNERS.
  • Install mkdocs-material 9.8.0 in the documentation workflows, as
    docker/mkdocs/Dockerfile does, and include the version in the cache key.
  • Remove the browser install step from the Playwright workflow. The pinned
    container image already has the browsers.

Development environment

  • Use the development environment layout, setup.sh and
    docker/build-docker-images.sh of the other projects, and run fixuid
    before chown in the entrypoint.
  • Move the Chrome host scripts to tools/agents/mcps/chrome-host/, the
    autostart scripts to scripts/docker/ and write-lockfile-hash.sh to
    scripts/writeLockfileHash.sh.
  • Align .env.dist, .gitignore and mkdocs.yml with the other projects.
  • Indent Python files with 4 spaces in .editorconfig.

Behaviour changes

  • The production bundle shrinks from 114 kB to 65 kB, because webpack can
    tree-shake the ES modules. It has the same 43 exports and the same CSS.
    createContext() calls in .ts files lose the /*#__PURE__*/
    annotation, and dist/react-ui.d.ts differs from v0.66.0 only in the
    order of Omit keys.
  • The default host ports are 21001 for the docs server, 21002 for the
    Playwright report and 21003 for the host Chrome debug port, instead of 8000,
    9323 and 9333.
  • The Docker images are named react-ui-devcontainer and
    react-ui-devcontainer-local. An existing docker-compose.yml and .env
    keep the old names and ports until they are recreated once with
    bash setup.sh --recreate-files.
  • The webpack build also reports src/docs/_assets/stylesheets/extra.css.
  • The built CSS has no -ms-grid-* declarations.

Testing

The component tests ran with the old and the new browser launch setup, and
1010 tests passed twice without a retry with the committed snapshots.

Before the last push, npm ci, lint, the unit tests and the build passed from
a clean install in this repository. All Playwright component tests passed.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://react-ui-org.github.io/react-ui/pr-preview/pr-791/

Built to branch gh-pages at 2026-11-20 09:15 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

* Pin `@playwright/test` to `1.65.0`, which is the version of the
  `playwright` Docker image.
* Update `@babel/core` and `@babel/preset-env` to `8.0.6`, `jest` and
  `babel-jest` to `30.5.2`, `webpack` to `5.111.1`, `autoprefixer` to
  `10.6.1`, `@types/node` to `26.6.6` and `dotenv` to `18.0.1`.
@bedrich-schindler
bedrich-schindler force-pushed the maintenance/align-tooling-versions branch from dc548af to ed17743 Compare November 18, 2026 19:22
TypeScript 7 type-checked and emitted the declarations, and TypeScript 6 was
installed for typescript-eslint. There is now one `typescript` package, so
`tsc`, typescript-eslint and the IDE use the same compiler.

* Remove `@typescript/native` and replace the `@typescript/typescript6` alias
  with `typescript` `~6.0.3`.
* Call `tsc` directly in `lint:types` and `build:types`.

The built `dist/react-ui.d.ts` differs from the one published in `v0.66.0`
only in the order of `Omit` keys.
@bedrich-schindler
bedrich-schindler marked this pull request as ready for review November 18, 2026 20:58
Babel applied `@babel/preset-react` to `.ts` files too, where it read a
generic arrow function or a type assertion as a JSX tag. The preset is now in
an override that excludes `.ts` files.

`babel.config.js` and `postcss.config.js` become `.mjs` files with ESM
syntax. The built CSS stays the same. In the bundle, `createContext()` calls
in `.ts` files lose the `/*#__PURE__*/` annotation.
* Limit Jest to `src` and `tests`. After a documentation build it also ran
  the copies of the tests in `site/`.
* Do not open the Playwright HTML report after a failure. In a container
  the report server waited for Ctrl+C.
* Collect the Playwright trace on the first retry. There is one retry, so
  the result is the same.
* Exclude `*.test.ts(x)` files from the declaration build.
The built CSS is the same without the option.
`sudo chown` ran before `fixuid` remapped the user, so it failed on Linux
hosts with a UID other than 1000. The `.gitignore` rule now ignores the
content of the local devcontainer directory, so that `Dockerfile.dist` is not
ignored.
The config is built from one file per section in `webpack/_config/`.
The files are ESM with the `.mjs` extension, because the package is CommonJS.
The Playwright component testing config becomes ESM too.

webpack no longer runs Babel on packages in `node_modules`, so
`babel.config.mjs` does not need `modules: commonjs`. The production bundle
shrinks from 114 kB to 65 kB, because webpack can now tree-shake the ES
modules. It has the same 43 exports and the built CSS is the same.
`target` changes from `es2020` to `esnext`, and `allowJs: false` is removed
because it is the default. The built declarations stay the same.
* `.editorconfig` sets 4 spaces for CSS too and gets sections for C++ files
  and `Makefile`, so that one file fits all projects.
* `.markdownlint.jsonc` checks duplicate headings only among siblings and no
  longer sets `allow_different_nesting`.
@bedrich-schindler bedrich-schindler changed the title Update development dependencies and pin @playwright/test Align development dependencies and tooling config files Nov 18, 2026
The common sections (dependencies, local environment, AI assistant files, IDE, Python, logs, `.gitkeep`) now have the same lines in the same order in every project with a development environment. Project paths are in the `# Project` section at the top.

* Ignore `/.env*` except the `.dist` files instead of `.env` in any directory.
* Ignore `/docker-compose.yml.backup`, `npm-debug.log*` and the IDE directories `.idea` and `.vscode`.
The RACOM projects use the name `writeLockfileHash.sh` for the same script. The file mode changes to 644 as in those projects, because `postinstall` runs the script with `sh`.
The development environment was an older copy of the one that the other projects use. The paths, the directory names and `setup.sh` differed, so the files could not be compared or updated together.

* Split the devcontainer into `docker/frontend-devcontainer/`, which is a copy of the shared `frontend-devcontainer` image source, and `docker/react-ui-devcontainer/`, which adds the `node`, `npm`, `npx` and `mkdocs` wrappers. The copy adds the check that warns when the environment definition changed after the container was created.
* Name the Docker directories and images with `-` instead of `_`: `react-ui-devcontainer` and `react-ui-devcontainer-local`.
* Replace `setup.sh` and `docker/build-docker-images.sh` with the shared versions. `setup.sh` gains `--rebuild-docker-images` and `--recreate-files`, normalizes the project name and maps `SHELL`, `EDITOR` and `VISUAL` to values that exist in the container.
* Move `scripts/mcps/chrome-host/` to `tools/agents/mcps/chrome-host/`, and `scripts/auto-start-node.sh` and `scripts/auto-start-mkdocs.sh` to `scripts/docker/autoStartNode.sh` and `scripts/docker/autoStartMkdocs.sh`.
* Open `CHROME_START_URL` in `start-host-chrome.sh` when it is set, otherwise the documentation as before.
* Add `tools/run-in-devcontainer.sh`.
* Remove `RUN mkdir /workspace` from the `node`, `playwright` and `mkdocs` images, because `WORKDIR` creates the directory.
* Update the paths in `.gitignore`, `.mcp.json`, `opencode.json`, `package.json`, `CLAUDE.md` and the contribution guidelines.
* Replace `/docker-compose.yml` in `CODEOWNERS` with `/docker-compose.base.yml` and `/docker-compose.yml.dist`. `/docker-compose.yml` is ignored by Git, so the rule matched no file.
The default host ports in `.env.dist` were 8000 and 9323, and the host Chrome debug port defaulted to 9333. The other projects used the same defaults, so two projects with the default configuration could not run side by side.

* Set `COMPOSE_DOCS_SERVER_PORT` to 21001, `COMPOSE_PLAYWRIGHT_REPORT_PORT` to 21002 and `CHROME_DEBUG_PORT` to 21003.
* Leave `COMPOSE_UID` and `COMPOSE_GID` empty. `setup.sh` fills them in, and the preset 1000 hid a missing configuration on hosts with another UID.
* Fix the width of the section frames and use the comments of the other projects.
* Document `CHROME_START_URL`.
* Update the Playwright report URL in the testing guidelines.

The ports inside the containers stay the same.
The kebab-case part `([a-z0-9]+-?)+` nests two quantifiers, so a class name that does not match takes exponential time to reject. A name of 31 characters took 11.8 s. The pattern `[a-z0-9]+(-[a-z0-9]+)*-?` accepts the same names and matches each name in one way only.

Both patterns give the same result for the 256 class names in `src/**/*.scss` and for all 2441405 strings of up to 9 characters over the alphabet `a`, `0`, `A`, `-`, `_`.
* Order `resolve.extensions` like the applications that use React UI:
  TypeScript before JavaScript. No two source files differ only in these
  extensions.
* Write the JSDoc types as `import('webpack').Configuration['…']`. The former
  `Configuration.…` form is not a valid type, because `Configuration` is an
  interface.
* Use `@returns` instead of `@return`.

The bundles and `dist/` are byte-identical to the previous build.
ESLint ignored every `*.js` file and everything outside `src` and `tests`. The allowlist in `eslint.config.mjs` now also contains `scripts`, `webpack` and the `*.config.js` and `*.config.mjs` files in the root, so ESLint lints 374 files instead of 353.

* Remove the `**/*.js` ignore and ignore the generated assets in `src/docs/_assets/generated`.
* Add the `react-ui/tooling` block, which lets the tooling files import development dependencies, use file extensions in imports and write to the console.
The `lint:*` scripts are now identical in React UI, `ra2_ui_web_client`, `web_client` and `rades_react`.

* Run `stylelint "{src,tests}/**/*.{css,scss}" --ignore-path .gitignore`. The generated assets are excluded through `.gitignore`. The same 116 files are linted as before.
* Add `.markdownlint-cli2.jsonc`, which makes `markdownlint-cli2` lint every Markdown file that Git does not ignore. It lints 72 files instead of the 60 files matched by `README.md` and `src/**/*.md`. The added files are `CLAUDE.md`, `LICENSE.md`, the files in `.claude` and `tools/agents/mcps/chrome-host/README.md`.
* Wrap the first paragraph of `CLAUDE.md`, which exceeded the line length limit.
* Write the `--host` option of `test:playwright:report` with a space, as the RACOM projects do.
- Define `NODE_VERSION` and `NPM_VERSION` in `env` of `lint.yml`, `test.yml`, `playwright.yml` and `release-management.yml` and install the pinned npm after Node.js. Node.js 26.13.1 bundles npm 11.20.0, so the versions in use do not change.
- Use `actions/checkout@v6` and `actions/setup-node@v7` in all workflows.
- Name the step that runs `npm run lint` in `lint.yml` `Lint`.
- Quote `$GITHUB_ENV` in the three steps that write the MkDocs cache ID.

`lint.yml` is now the same file as in `docoff`, `eslint-config` and `stylelint-config`. The job names do not change, so the required status checks still match.
`jest.config.js` was renamed to `jest.config.mjs`, so the `CODEOWNERS` entry matched no file.
The component testing webpack config caches its build in `tests/playwright/.temp/playwright-ct-cache/`. RADES has a script that removes the cache, React UI had none.
`mixPropTests` returned only `name` and `props`, so the hooks of the mixed prop tests were dropped. RADES already had a version that calls the hooks of both prop tests, with two unit tests.

* Use the RADES `utils/mixPropTests.ts` and its test.
* Add the optional `takeScreenshot` to `PropTest`, so that `types.ts` is byte-identical to the RADES file.
* Export `PropTest` and `PropTests` from `tests/playwright` and order the exports as in RADES.

All 1010 component tests pass with the unchanged snapshots.
`tsc --noEmit` checked only `src` and `tests`, so nothing type-checked the Playwright config.

`tsconfig.build.json` has its own `include`, so the build output is the same.
The step "Write out the release URL" prints `steps.github_release.outputs.release_url`, but the step `github_release` never wrote that output, so the printed URL was empty. The added line is the one that `eslint-config` and `stylelint-config` use.
RA2W and WECL write the output of `VisualizerPlugin` to `stats.html`, React UI wrote it to `statistics.html`.

* Write `stats.html` to the project root and give the path as a string, as RA2W and WECL do.
* Ignore `/stats.html` in Git.
`/scripts/`, `/setup.sh` and `/tools/` belong to the development environment like `/docker/`, but had no owner besides the default one.
`markdown_extensions` listed `attr_list` twice. `mkdocs build` passes with one entry.
Use the column width of `docker/node/Dockerfile` and `docker/playwright/Dockerfile` between the instruction and its argument.
Three imports were out of alphabetical order. The RADES file has them sorted.
The other workflows that run `npm ci` install npm `11.20.0` first. The preview build used the npm bundled with Node.js.

* Add `NPM_VERSION` and the `Install npm` step
* Name the steps `Install` and `Build` as in `lint.yml` and `release-management.yml`
`/.devcontainer/`, `/.env.dist`, `/.github/workflows/`, `/playwright-ct.config.ts` and the two `tsconfig` files get the owners of the other infrastructure and build tooling entries.
`StyleLintPlugin` linted `src/**/*.scss`, the `lint:stylelint` script lints `{src,tests}/**/*.{css,scss}` without the files in `.gitignore`. The plugin now gets the same glob and `ignorePath`, so the build also reports `src/docs/_assets/stylesheets/extra.css`.
* Write the `extra_css` comments above the items in `mkdocs.yml`, as RADES does
* Use a story ID that names no real component as the example in `resolveStory.ts`, so the file is the same in React UI, RADES and WECL
…extPropTest`

Every other shared prop test and its file end with `PropTest`. The test names are unchanged, so all 1010 Playwright tests pass with the existing snapshots.

The file was already moved in commit `f773fac3` by mistake. Here the export, the import in `tests/playwright/index.ts` and the seven spec files follow.
The component testing config passed `--use-gl=egl` and `--headless=new` and ignored the default `--headless` argument. Playwright 1.65.0 runs the Chromium headless shell unless `channel` is set, and the headless shell starts in the same mode with `--headless` and with `--headless=new`. Chromium renders in software in headless mode unless `--use-gl` is passed, so `--use-gl=egl` only removed that default.

* Remove `launchOptions` from `playwright-ct.config.ts`.
* Add a comment that states why no rendering flags are set.

Rendering does not change. The suite was run into separate snapshot directories with the old and the new setup: 891 of 894 snapshots are byte-identical, and the other 3 differ by 1 level in at most 14 pixels in `FormLayout` tests, one of which differs the same way between two runs of one setup. The committed snapshots stay as they are: 1010 tests passed twice without a retry.
@bedrich-schindler bedrich-schindler changed the title Align development dependencies and tooling config files Align the tooling, workflows and development environment with the other projects Nov 19, 2026
The workflows `docs.yml`, `pull-request-preview.yml` and
`release-management.yml` installed any `mkdocs-material` 9.x.
`docker/mkdocs/Dockerfile` pins 9.8.0 and links a live reload issue as the
reason. Local and CI builds could use different versions.

* Install `mkdocs-material==9.8.0` in the three workflows.
* Put the version into the key and the restore key of the `.cache` cache, so
  a version change starts with an empty cache.
`tools/agents/mcps/chrome-host/cdp_proxy.py` is indented with 4 spaces, and
`.editorconfig` set 2 spaces for every file without its own section.

* Add a `[*.py]` section with `indent_size = 4` after `[*.{cpp,hpp}]`.

The file stays byte-identical in frontend_tooling, React UI, docoff,
eslint-config and stylelint-config.
The job runs in `mcr.microsoft.com/playwright:v1.65.0-noble` pinned by the
same digest as `docker/playwright/Dockerfile`. The image has the browsers of
Playwright 1.65.0 in `/ms-playwright`, including `chromium-1254` and
`chromium_headless_shell-1254`, which `@playwright/test` 1.65.0 expects. The
image also has the system dependencies, so `npx playwright install --with-deps`
had nothing to install.
`grid: true` made Autoprefixer add `-ms-grid-*` declarations, which only
Internet Explorer reads. No project supports Internet Explorer: neither the
shared RACOM `.browserslistrc` nor the React UI one lists it. The built CSS
no longer has any `-ms-grid-*` declaration.
@adamkudrna

Copy link
Copy Markdown
Member

Are you going to upgrade Github actions to the latest versions, or shall we do it separately in #784?

This branch was successfully deployed

1 active deployment
pr-preview/pr-791 — 38c78523 Deployed Nov 20, 2026 by bedrich-schindler via Deploy PR Preview #175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants