Skip to content

Commit 2beca80

Browse files
Webpack to Vite (#7687)
Resolves #7654, sunsetting Webpack support and introducing the more modern Vite as the core bundler for typescript in Cirq. Implementation notes: - Added a custom `canvas` polyfill in `vitest.setup.ts`, allowing for three.js to be tested without the browser environment. There have been [discussions](vitest-dev/vitest#274) about this in Vite and [external packages](https://github.com/schirrel/vi-canvas-mock) which could offer more context, but I opted to implement something custom considering that package deps have been pain point. - Testing and coverage matches 1:1 with old test criteria - We need to bump the node version up in the CI workflow to support more modern packages, bumped from v20 -> v22 --------- Co-authored-by: Pavol Juhas <[email protected]>
1 parent 3b3cd7d commit 2beca80

33 files changed

+2820
-10674
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ jobs:
400400
- name: Set up Node environment
401401
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
402402
with:
403-
node-version: '20.17.0'
403+
node-version: '22.16.0'
404404
- name: Install node dependencies
405405
run: check/npm ci
406406
- name: Check build matches the current
@@ -415,7 +415,7 @@ jobs:
415415
- name: Set up Node environment
416416
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
417417
with:
418-
node-version: '20.17.0'
418+
node-version: '22.16.0'
419419
- name: Install node dependencies
420420
run: check/npm ci
421421
- name: Lint Typescript files
@@ -430,7 +430,7 @@ jobs:
430430
- name: Set up Node environment
431431
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
432432
with:
433-
node-version: '20.17.0'
433+
node-version: '22.16.0'
434434
- name: Install node dependencies
435435
run: check/npm ci
436436
- name: Run unit tests
@@ -447,7 +447,7 @@ jobs:
447447
- name: Set up Node environment
448448
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
449449
with:
450-
node-version: '20.17.0'
450+
node-version: '22.16.0'
451451
- name: Install node dependencies
452452
run: check/npm ci
453453
- name: Run coverage test

cirq-web/cirq_web/.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
build/
22
**/node_modules
33
**/dist
4+
vitest.config.ts
5+
vitest.setup.ts
6+
vite.config.ts
7+
vitest.e2e.config.ts

cirq-web/cirq_web/.nycrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
File renamed without changes.

cirq-web/cirq_web/dist/bloch_sphere.bundle.js

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cirq-web/cirq_web/dist/bloch_sphere.bundle.js.LICENSE.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

cirq-web/cirq_web/dist/circuit.bundle.js

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cirq-web/cirq_web/dist/circuit.bundle.js.LICENSE.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

cirq-web/cirq_web/dist/html/bloch_sphere.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

cirq-web/cirq_web/dist/html/circuit.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)