Skip to content

console: bump vite-plugin-svgr to 5 and jsdom to 30 - #39683

Open
leedqin wants to merge 1 commit into
MaterializeInc:mainfrom
leedqin:console-vite-group
Open

leedqin wants to merge 1 commit into
MaterializeInc:mainfrom
leedqin:console-vite-group

Conversation

@leedqin

@leedqin leedqin commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

Supersedes #39533. Dependabot's version of this bump breaks the build: vite-plugin-svgr 5 can't parse our icon template. That one error also takes down the unit tests, e2e, the Vercel previews and the Rust builds, which bundle the Console.

Description

  • vite 8.3.2, vitest 5.0.3, vite-plugin-svgr 5.2.0 and jsdom 30.1.2.
  • vite-plugin-svgr 5 transforms the generated icon components with oxc whenever vite runs on rolldown, which vite 8 always does, and it ignores esbuildOptions. Our svgr template emits TypeScript, so vite.config.ts now sets oxcOptions.lang to tsx. The icons now compile to the automatic JSX runtime, like the rest of the app.
  • jsdom 30.1.2 no longer focuses inputs hidden with display: none. The Query History tests opened each filter accordion item with getByLabelText, which matches the hidden panel (it's labelled by its button) instead of the button. The panel never opened, and the tests typed into its hidden inputs. They now click the button by role, and the duration test can assert that its error is visible. They pass on both jsdom 29 and 30.
  • engines.node changes to jsdom 30's range, ^22.22.2 || ^24.15.0 || >=26.0.0. CI, the Console Docker image and the Volta pin already run Node 26.

Verification

QueryHistoryList.test.tsx changes as described above. yarn storybook:build still works, since Storybook picks up svgr through the shared vite config.

🤖 Generated with Claude Code

Also bumps vite to 8.3.2 and vitest to 5.0.3. vite-plugin-svgr 5 transforms
icons with oxc whenever vite runs on rolldown, so the TypeScript svgr
template needs oxcOptions.lang instead of esbuildOptions.loader. The
generated icons now use the automatic JSX runtime, like the rest of the app.

jsdom 30.1.2 no longer focuses inputs hidden with display: none. The Query
History tests opened filter accordion items by clicking the hidden panel
rather than its button, so they were typing into closed panels. They now
click the button. engines.node takes jsdom 30's Node range.
@leedqin leedqin mentioned this pull request Oct 8, 2026
@leedqin
leedqin marked this pull request as ready for review October 8, 2026 20:20
@leedqin
leedqin requested a review from a team as a code owner October 8, 2026 20:20
@leedqin
leedqin requested a review from Alphadelta14 October 8, 2026 20:20
leedqin added a commit that referenced this pull request Nov 6, 2026
### Motivation

`yarn gen:types` fails with `function "pg_get_serial_sequence" does not
exist`. kysely-codegen runs kysely's Postgres introspector for its table
query. Since the bump to kysely 0.28 (#35669), that query calls
`pg_get_serial_sequence`, which Materialize lacks. kysely 0.29 still
does. The query also lists only relkinds `r`, `v` and `p`, so the
catalog's builtin materialized views (`m`) never reached the types under
kysely-codegen 0.17. #40044's types were generated with both patched by
hand in `node_modules`.

This also bumps kysely to 0.29 and kysely-codegen to 0.20, superseding
#39686.

### Description

- `bin/kysely-codegen.ts` runs kysely-codegen programmatically with an
introspector that overrides only the table query. kysely-codegen's
materialized view query, enum handling and serializer still apply.
- The script writes the copyright header to `types/materialize.d.ts`.
The codegen output lacks it, and the copyright lint fails without it.
- `bin/generate-types` exits on errors, pulls the requested image (a
cached `latest` went stale), and stops the container on exit. Before,
each run left a container bound to port 6875, and the next run generated
types from that old container.
- kysely 0.28.17 → 0.29.8 and kysely-codegen 0.17 → 0.20.0:
- 0.29 rejects `limit(sql.raw(...))`. `rawLimit` and the lag history
limit now call `query.limit(sql.lit(n))`, which still inlines the limit
as a literal, as Materialize requires.
- `rawLimit` used to append its limit with `modifyEnd`. In 0.29,
compiling end modifiers calls `Array.prototype.toSorted`, which Chrome
109 lacks. No console query uses end modifiers now. Neither `rawLimit`
caller has an OFFSET or another end modifier, so the compiled SQL is
unchanged.
- kysely 0.29 is ESM-only and kysely-codegen 0.20 `require`s it, so
`yarn gen:types` needs Node 22.12 or later. CI and the Volta pin run
Node 26, and #39683 updates `engines.node`.
- `types/materialize.d.ts` is regenerated against v26.49.1.
kysely-codegen 0.17 and 0.20 produce identical output.
  - Adds `mz_builtin_columns` and `mz_builtin_index_columns`.
- Builtin columns lose their `Generated<>` wrappers, because #40316
changed `pg_attribute.atthasdef` to report no default for them. The
console only selects from these relations, where `Generated<T>` and `T`
read the same.
- Drops the two hand-added `TODO` markers from #39992. The generator now
emits `mz_cluster_auto_scaling_strategies` and
`mz_cluster_reconfigurations`, and `AUTO_SCALING_MIN_VERSION` still
gates them at runtime. The file is now exactly the generator output.

Worth checking on the preview, since these run the changed limits:
- the Query History list;
- a sink's Errors tab;
- the freshness lag charts on the environment overview and the cluster
pages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
leedqin added a commit that referenced this pull request Nov 10, 2026
### Motivation

Supersedes #39655. Dependabot's version of this bump fails typecheck and
several unit tests.

### Description

msw is only used by tests.

- `request.clone()` now keeps the declared body type, where msw 2
returned a plain `Request` whose `json()` was `any`. The three SQL
handlers that destructure the body now declare it with `http.post<never,
ExtendedRequest>`.
- `HttpResponse` is now generic, so two pending handlers resolve a plain
`Response`.
- `onUnhandledRequest` is renamed to `onUnhandledFrame`. msw 3 ignores
the old name at runtime, so keeping it would let unhandled requests
reach the real network instead of erroring. `vitest.setup.ts` uses the
new name.
- msw 3 answers a few ticks later, so `AlterClusterModal`'s "closes the
modal on success" test now waits for `onClose` instead of checking right
after the click.

- **Test server:** msw 3 mocks Node's `fetch` at the socket level
(undici). When a test aborts an in-flight request, undici opens a
replacement socket it never writes to. msw passes that idle socket
through to the real network, and the next fetch can reuse it and fail
with `fetch failed`. That made a few tests flaky under CI load.
- `src/api/mocks/server.ts` now builds the server with msw's
`defineNetwork` and the interceptor that patches `fetch` directly, so
mocked requests never touch undici.
- This uses msw's experimental API, with a TODO to return to
`setupServer` once mswjs/interceptors#863 (the upstream fix, still a
draft) ships.
- With faster responses, one Object Explorer spinner test now holds its
request open, as its sibling tests already do.

msw 3 requires Node 22.12 or later. CI and the Volta pin run Node 26,
and #39683 updates `engines.node`.

### Verification

Existing tests, plus five consecutive full-suite runs on Node 26 (CI's
Node version) with no failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
leedqin added a commit that referenced this pull request Nov 11, 2026
### Motivation

`console/package.json` declares `"node": ">=20.12.2"`, but the installed
dependency tree no longer runs there. Checking every installed package's
`engines.node` against candidate versions:

| Node | Packages whose `engines.node` rejects it |
|---|---|
| 20.12.2 | 60 (jsdom's CSS packages, …) |
| 20.19.0 | 18 (`@mswjs/interceptors` 0.45, `@rolldown/plugin-babel`,
`@testing-library/jest-dom` 7, `eslint-plugin-unicorn` 79, …) |
| 22.12.0 | 25 (`@eslint/*` needs 22.13, …) |
| 22.18.0 | 7 (`node-gyp` 13, `which` 7, `abbrev` 5, `nopt` 10,
`lint-staged` 17, `undici` 8.12, …) |
| 24.11.0 | 5 (`node-gyp` 13 and its helpers) |
| 22.22.2, 24.15.0, 26.0.0 | none |

msw 3 (#39684) and kysely 0.29 (#40550) both deferred this change to
#39683, which is still open.

### Description

`engines.node` becomes `^22.22.2 || ^24.15.0 || >=26.0.0`, the
intersection of every installed package's range. Volta (26.10.0),
`console/Dockerfile` and CI already run Node 26. It is the same range as
#39683, so that PR merges cleanly on this line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants