Skip to content

Conversation

@NicholasBoll
Copy link
Collaborator

@NicholasBoll NicholasBoll commented Dec 3, 2025

Summary

Fixes: #3669

Convert Storybook from webpack to vite

  • Upgrade Storybook from v7 to v8
  • Upgrade Storybook from webpack to vite
  • Upgrade from Jest to vitest
  • Upgrade Cypress from webpack to vite
  • Upgrade prettier
  • Upgrade eslint

Release Category

Infrastructure


PR Summary: Tooling Infrastructure Upgrade

🔧 Build & Development Tooling

Storybook: v7 → v8 (Webpack → Vite)

  • @storybook/react-webpack5 7.6.21 → @storybook/react-vite 8.4.7
  • @storybook/addon-essentials 7.6.21 → 8.4.7
  • @storybook/addon-storysource 7.6.21 → 8.4.7
  • Added @storybook/builder-vite 8.4.7
  • Removed @storybook/blocks, @storybook/components, @storybook/source-loader
  • Impact: Faster Storybook builds and HMR with Vite

Test Runner: Jest → Vitest

  • Removed jest ^29.7.0, jest-environment-jsdom, jest-junit, ts-jest
  • Added vitest ^4.0.1
  • Added vite ^7.1.11
  • @testing-library/jest-dom ^5.16.4 → ^6.6.3
  • Renamed jest/ folder to test-utils/
  • Impact: Faster test execution with native ESM support

Cypress: Webpack → Vite

  • cypress ^14.5.4 → ^15.6.0
  • cypress-axe ^1.5.0 → ^1.7.0
  • cypress-real-events ^1.7.1 → ^1.15.0
  • Removed @cypress/webpack-preprocessor, cypress-plugin-tab, cypress-storybook
  • cy.tab() replaced with cy.realPress('Tab') throughout
  • Impact: Faster component test bundling

ESLint: v6 → v9 (Flat Config)

  • eslint ^6.8.0 → ^9.39.2
  • @typescript-eslint/parser ^5.60.0 → ^8.51.0
  • @typescript-eslint/eslint-plugin ^5.60.0 → ^8.51.0
  • eslint-plugin-react ^7.16.0 → ^7.37.5
  • eslint-plugin-react-hooks ^4.3.0 → ^7.0.1
  • eslint-plugin-prettier ^3.1.1 → ^5.5.4
  • eslint-config-prettier ^6.3.0 → ^10.1.8
  • Removed eslint-plugin-jest
  • Migrated from .eslintrc.js to eslint.config.js (flat config)
  • Impact: Better performance, modern config format

Prettier: v2 → v3

  • prettier ^2.2.0 → ^3.4.2
  • Added @trivago/prettier-plugin-sort-imports ^5.2.1
  • Config moved from .prettierrc.js to .prettierrc.mjs
  • Impact: Auto-sorted imports, ES module config

📦 Utility Migration to ES Modules

All utility scripts in /utils/ converted from CommonJS to ES modules:

  • require() → import
  • module.exports → export
  • JSON imports use createRequire pattern

⚠️ Breaking Changes for Contributors

  • Test command: yarn test now runs vitest instead of jest
  • Lint command: yarn lint uses ESLint 9 flat config (auto-detected)
  • Cypress tests: Use cy.realPress('Tab') instead of cy.tab()

… chore/upgrade-storybook-to-vite

# Conflicts:
#	.nvmrc
#	modules/docs/lib/MDXElements.tsx
#	modules/docs/lib/Value.tsx
#	modules/docs/mdx/14.0-UPGRADE-GUIDE.mdx
#	modules/styling-transform/package.json
#	package.json
#	yarn.lock
Comment on lines +103 to +107
cy.realPress('Tab');
cy.focused().should('contain', 'Acknowledge');
cy.realPress('Tab');
cy.focused().should('contain', 'Cancel');
cy.realPress('Tab');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cy.tab doesn't work with something. cy.realPress doesn't return the subject.

Comment on lines +115 to +119
cy.realPress('Tab');
.should('contain', 'Cancel')
.tab()
.realPress('Tab');
.should('contain', 'Delete Item')
.tab();
.realPress('Tab');
Copy link
Collaborator Author

@NicholasBoll NicholasBoll Dec 3, 2025

Choose a reason for hiding this comment

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

Suggested change
cy.realPress('Tab');
.should('contain', 'Cancel')
.tab()
.realPress('Tab');
.should('contain', 'Delete Item')
.tab();
.realPress('Tab');
cy.realPress('Tab');
cy.focused().should('contain', 'Cancel');
cy.realPress('Tab');
cy.focused().should('contain', 'Delete Item');
cy.realPress('Tab');

@mannycarrera4
Copy link
Contributor

future change: Change storybook files to not re exported the renamed story

@mannycarrera4
Copy link
Contributor

NB: Update cypress specification path for `

@cypress
Copy link

cypress bot commented Dec 4, 2025

Workday/canvas-kit    Run #9982

Run Properties:  status check passed Passed #9982  •  git commit 6013ee62c6 ℹ️: Merge 9e5060ba81c4cbca338fe2f35b505b12103e8905 into 8b8292b4bf50a29c055a3ee4ced5...
Project Workday/canvas-kit
Branch Review chore/upgrade-storybook-to-vite
Run status status check passed Passed #9982
Run duration 02m 22s
Commit git commit 6013ee62c6 ℹ️: Merge 9e5060ba81c4cbca338fe2f35b505b12103e8905 into 8b8292b4bf50a29c055a3ee4ced5...
Committer Nicholas Boll
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 929
View all changes introduced in this branch ↗︎
UI Coverage  19.6%
  Untested elements 1540  
  Tested elements 373  
Accessibility  99.28%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 95  

@mannycarrera4 mannycarrera4 mentioned this pull request Dec 8, 2025
8 tasks
mannycarrera4 and others added 2 commits December 8, 2025 14:18
Co-authored-by: Nicholas Boll <nicholas.boll@gmail.com>
Co-authored-by: Nicholas Boll <nicholas.boll@gmail.com>
@RayRedGoose RayRedGoose requested a review from Copilot December 15, 2025 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades Canvas Kit's build infrastructure from Webpack to Vite, Storybook from v7 to v8, and the testing framework from Jest to Vitest. This is a significant modernization effort that impacts configuration files, test files, and the development workflow.

Key Changes:

  • Upgraded Storybook from v7.6.20 to v8.4.7 with Vite builder
  • Migrated test framework from Jest to Vitest (v4.0.1)
  • Upgraded Cypress from v14.5.4 to v15.6.0 with Vite integration
  • Upgraded Prettier from v2.2.0 to v3.4.2 with import sorting plugin
  • Converted configuration files from CommonJS to ES modules
  • Updated all test files to use Vitest APIs instead of Jest

Reviewed changes

Copilot reviewed 242 out of 247 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
package.json Updated dependencies to Storybook v8, Vite v7, Vitest v4, and Prettier v3; added "type": "module"
vite.config.ts New Vite configuration with alias setup for Canvas Kit packages
vitest.config.ts New Vitest configuration with jsdom environment and test patterns
vitest.setup.ts New Vitest setup file replacing jest/setupTests.ts
.storybook/main.ts Migrated from Webpack to Vite builder with custom plugins for documentation
cypress.config.ts Updated Cypress to use Vite dev server instead of Webpack
babel.config.js Simplified to ES module format, removed test-specific configuration
Multiple test files Converted from Jest (jest.fn()) to Vitest (vi.fn()) APIs
Multiple MDX files Added missing Meta imports from @storybook/blocks
Utility files Converted from CommonJS (require) to ES modules (import)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,9 +1,10 @@
import {fireEvent, render} from '@testing-library/react';
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

Unused import fireEvent.

Copilot uses AI. Check for mistakes.
@mannycarrera4 mannycarrera4 added the ready for review Code is ready for review label Dec 30, 2025
@mannycarrera4 mannycarrera4 moved this to 👀 In review in Canvas Kit Dec 30, 2025
@mannycarrera4 mannycarrera4 added this to the 15.0.0 milestone Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

15.x ready for review Code is ready for review

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants