feat(Build): modernize build and test tooling with Vite/Vitest & oxlint/oxfmt#3435
feat(Build): modernize build and test tooling with Vite/Vitest & oxlint/oxfmt#3435daker wants to merge 10 commits intoKitware:masterfrom
Conversation
65d7ab0 to
825c998
Compare
finetjul
left a comment
There was a problem hiding this comment.
J'ai tout review sauf package-lock.json
LGTM
Sources/Rendering/Core/HardwareSelector/test/testHardwareSelectorSpeed.js
Show resolved
Hide resolved
dfa94d2 to
a9bdd89
Compare
| return { | ||
| name: 'vtk-serve-data', | ||
| configureServer(server) { | ||
| server.middlewares.use('/Data', (req, res, next) => { |
There was a problem hiding this comment.
I think we serve /data lower case rather that /Data
There was a problem hiding this comment.
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", | |||
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Projects that are still using the UMD package :
https://github.com/openUC2/ImSwitch
https://github.com/sandialabs/slycat
There was a problem hiding this comment.
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).
|
LGTM, @finetjul I let you merge it. I put some comments as I did not tested. |
|
Should we try to rebase? What is preventing us to merge that PR? |
|
@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. |
|
@finetjul would you be able to test the build? |
not before next week |
f651a58 to
68d34ac
Compare
6f5a9ab to
39c691d
Compare
39c691d to
7aa3181
Compare
PaulHax
left a comment
There was a problem hiding this comment.
npm run docs:build-examples fails because Rollup packages removed from package.json but still imported in build-examples.mjs
UMD bundle still works, thanks for that.
| setTimeout(createRW, 100); | ||
| } else { | ||
| popMonitorGLContextCount(); | ||
| Promise.all(images).then(gc.releaseResources); |
There was a problem hiding this comment.
| return Promise.all(images).then(gc.releaseResources); |
We need to wait for these promises to finish before ending the test.
| 'vite.example.config.mjs' | ||
| ); | ||
| const DEFAULT_HOST = '0.0.0.0'; | ||
| const DEFAULT_PORT = '9999'; |
There was a problem hiding this comment.
Looks like we changed the docs in the PR to say examples are on 3000, but I think this will carry through and make the example port 9999
| outDir: umdOutputDir, | ||
| emptyOutDir: true, | ||
| sourcemap: true, | ||
| cssCodeSplit: false, |
There was a problem hiding this comment.
We should probaly note in BREAKING_CHANGES.md that UMD users will need to add <link rel="stylesheet" href="vtk.js.css"> now cuz CSS is not injected into JS bundle.
Or we could not break things by adding a plugin to bundle CSS in UMD.
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
Changes
PR and Code Checklist
npm run reformatto have correctly formatted codeTesting