Skip to content

[web] update web frameworks including PixiJS to recent versions / update to Node 22#797

Open
EskoDijk wants to merge 5 commits into
openthread:mainfrom
EskoDijk:pr-update-web-frameworks
Open

[web] update web frameworks including PixiJS to recent versions / update to Node 22#797
EskoDijk wants to merge 5 commits into
openthread:mainfrom
EskoDijk:pr-update-web-frameworks

Conversation

@EskoDijk
Copy link
Copy Markdown
Contributor

This is a maintenance PR to upgrade Node to version 22, and use more recent (maintained) NPM libraries for everything. It's executed in 4 stages (commits).

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the web development environment to Node 22 and updates PixiJS to version 8, migrating the visualization code to the new PixiJS API and replacing the pixi-scrollbox dependency with a custom scrollable container. Critical issues were identified in the review: the Dockerfile references a non-existent Go version (golang:1.26-bookworm), a memory leak exists in LogWindow.js where cleared log items are not destroyed, and calling the removed PIXI.isWebGLSupported method in PixiJS v8 will throw a runtime TypeError.

Comment thread etc/docker/environment/Dockerfile
Comment thread web/site/js/vis/LogWindow.js
Comment thread web/site/js/visualize.js
EskoDijk added 5 commits May 29, 2026 15:27
…io model) (openthread#797)

Partition formation time is increased to ensure the partition gets formed, even in unlucky random seeds.
…thread#797)

Stage 0 of the web/site JS dependency migration. Prep work only; no
runtime code changes and bindata.go output is byte-identical.

- Move google-protobuf and grpc-web to dependencies (both imported at
  runtime); bump google-protobuf range to ^3.21.4 to match lockfile.
- Remove unused grpc and @grpc/proto-loader devDeps (-87 packages);
  proto codegen uses the protoc-gen-grpc-web binary, not these.
- Add build npm script; pack-web now calls npm run build.
- Add .nvmrc (22) and engines (node >=22, npm >=10).
- Dockerfile installs Node 22 Docker image as base instead of Debian's
  Node 18 for a pinned, reproducible web build toolchain.
…gration stage 1) (openthread#797)

Stage 1 of the web/site JS dependency migration (still on Pixi 5).

- webpack ^5.97.1, webpack-cli ^5.1.4. Rewrote webpack.config.js to use
  entry/output (output dir static/js, filename [name].js) since
  webpack-cli 5 treats -o as an output directory, not a file. build
  script is now just `webpack`. Dropped unsupported '*' resolve ext.
- Added TerserPlugin extractComments:false so license comments stay
  inline instead of emitting *.LICENSE.txt items that go-bindata
  would embed and serve (webpack 4 produced no such files).
- chart.js ^4.4.7: no code changes, all options used are valid in v4.
- grpc-web ^1.5.0 (same major, backward compatible).

No resolve.fallback needed: google-protobuf's only node-builtin
reference (util.inspect) is cleanly ignored by webpack 5.

Verified: regenerated bindata.go embeds only the 3 bundles.
…ead#797)

Stage 2 of the web/site JS dependency migration. Verified working in a
browser (rendering, node select/drag, log window scroll).

- pixi.js ^7.4.3. Dropped pixi.js-legacy, pixi-scrollbox and
  pixi-viewport entirely: the scrollbox/viewport pair was the
  unmaintained bottleneck (pixi-viewport skips Pixi 7, scrollbox has no
  Pixi 7 release) and only LogWindow used it.
- Loader -> Assets API in visualize.js (Assets.add + await Assets.load),
  adapted to the existing Resources().<alias>.texture accessor shape.
- interactive=true -> eventMode='static' everywhere; mouse/touch
  listeners -> pointer events. Drag tracking uses globalpointermove
  since v7 made plain move events local (DOM-like), which would break
  fast drags that leave the object bounds.
- e.data.getLocalPosition -> e.getLocalPosition; removed PIXI.utils
  .sayHello (gone in v7); transparent:true -> backgroundAlpha:0;
  pixi.js-legacy imports -> pixi.js in all 9 vis files.
- Reimplemented LogWindow without pixi-scrollbox: a masked container
  with wheel scrolling and bottom-tailing, preserving the
  addLog/clear/resetLayout contract.

visualize bundle shrank 767->705 KiB via v7.
…read#797)

Stage 3 (final) of the web/site JS dependency migration. Verified
working in a browser.

- pixi.js to 8.18.1.
- Application is async in v8: new PIXI.Application() + await app.init();
  app.view -> app.canvas; init + Assets load + loadOk wrapped in an
  async init(). PIXI.utils is gone -> PIXI.isWebGLSupported().
- All new PIXI.Text(text, style) -> new PIXI.Text({text, style}).
- Graphics fluent API: beginFill/lineStyle/drawRoundedRect/drawCircle/
  drawRect/endFill -> shape-first then .fill()/.stroke().
- _drawNodeLinks: v8 strokes the whole current path at once, so segments
  are grouped by (color, width) and each group stroked after beginPath().
  Parent-tree links now get a consistent selection-aware width (the old
  code reused the last-set lineStyle, which was order-dependent).
- webpack output.asyncChunks:false: Pixi v8 uses dynamic import()
  internally, which would split the bundle into async chunks; the site
  serves one go-bindata-embedded bundle per entry, so inline them.
- Fix stage-2 bug: otCommitIdMsg is a wrapper Text (VObject), so
  it needs .interactive=true (VObject setter), not .eventMode
- pin exact dependency versions in package.json to prevent CI/local build
  differences.
- bump chart.js to 4.5.1
- added early log line texture destroy()
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.

1 participant