Skip to content

feat(Build): modernize build and test tooling with Vite/Vitest & oxlint/oxfmt#3435

Open
daker wants to merge 9 commits intoKitware:masterfrom
daker:vite-vitest-migration
Open

feat(Build): modernize build and test tooling with Vite/Vitest & oxlint/oxfmt#3435
daker wants to merge 9 commits intoKitware:masterfrom
daker:vite-vitest-migration

Conversation

@daker
Copy link
Collaborator

@daker daker commented Mar 3, 2026

Context

This PR completes a tooling migration from the legacy webpack/rollup + Karma/Tape setup to a unified Vite + Vitest stack. It updates local development, build output, test execution, and CI integration to run on the new toolchain.

Results

  • Reduce maintenance overhead from multiple legacy build/test systems.
  • Standardize on a modern, faster toolchain for both local and CI workflows.
  • Improve consistency between build and test environments by sharing Vite-based config.
  • Remove UMD build.
  • Everything should works as before.

Changes

  • Replaced legacy build configuration with vite.config.js.
  • Added Vitest browser-runner configuration via vitest.config.js.
  • Migrated test infrastructure and tests to Vitest.
  • Removed old webpack, rollup-legacy, and Karma-related configs/plugins/utilities.
  • Migrate ExampleRunner to vite devserver.
  • Updated GitHub Actions workflows to run the Vite/Vitest pipeline.
  • Updated dependencies and lockfile to reflect the new build/test stack.
  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js:
    • OS:
    • Browser:

@daker daker force-pushed the vite-vitest-migration branch 29 times, most recently from 65d7ab0 to 825c998 Compare March 5, 2026 12:40
@daker daker marked this pull request as ready for review March 5, 2026 12:51
@daker
Copy link
Collaborator Author

daker commented Mar 10, 2026

@jourdain if you skip the changes in the test files that should pass, it will reduce the number of changes that need to be reviewed.

@jourdain
Copy link
Collaborator

BTW, how long does the test takes to run with vitest?

@daker
Copy link
Collaborator Author

daker commented Mar 10, 2026

It reports 4min 9secs with GH actions

Screenshot_20260310-221026.png

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

J'ai tout review sauf package-lock.json

LGTM

@daker daker force-pushed the vite-vitest-migration branch 5 times, most recently from dfa94d2 to a9bdd89 Compare March 10, 2026 23:04
return {
name: 'vtk-serve-data',
configureServer(server) {
server.middlewares.use('/Data', (req, res, next) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we serve /data lower case rather that /Data

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remember, you had to fix that for the website / examples online.

@@ -27,13 +27,12 @@
"url": "https://github.com/kitware/vtk-js/issues"
},
"homepage": "https://github.com/kitware/vtk-js#readme",
"main": "./dist/umd/vtk.js",
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't Vite also generate a umd format too? It can be ok to discontinue umd but we need to let the community know. I think you've updated the doc to promote esm usage as script.

Maybe that is enough. What do you think @finetjul ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Projects that are still using the UMD package :

https://github.com/openUC2/ImSwitch
https://github.com/sandialabs/slycat

image

Copy link
Member

Choose a reason for hiding this comment

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

I do not realize how much work it is to keep umd builds. If it is challenging, ok to drop it.
If we drop umd, the PR should be considered as a breaking change (new major) and documented (in BREAKING_CHANGES.md how to move from umd to esm).

@jourdain
Copy link
Collaborator

LGTM, @finetjul I let you merge it. I put some comments as I did not tested.

@jourdain
Copy link
Collaborator

Should we try to rebase? What is preventing us to merge that PR?

@jourdain
Copy link
Collaborator

@PaulHax @finetjul @sankhesh

@daker
Copy link
Collaborator Author

daker commented Mar 25, 2026

@jourdain i can try to bring back the umd build with vite but we need to test the builds to see if nothing is broken.

@jourdain
Copy link
Collaborator

@finetjul would you be able to test the build?

@finetjul
Copy link
Member

@finetjul would you be able to test the build?

not before next week

@daker daker force-pushed the vite-vitest-migration branch from f651a58 to 68d34ac Compare March 25, 2026 19:34
@daker daker force-pushed the vite-vitest-migration branch from 68d34ac to ed7c3c4 Compare March 25, 2026 19:36
@daker daker force-pushed the vite-vitest-migration branch from 6f5a9ab to 39c691d Compare March 25, 2026 19:49
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.

3 participants