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 #10042

Run Properties:  status check passed Passed #10042  •  git commit ad9f61d736 ℹ️: Merge ac9845e383f7693308c8db35f2a0264f91672295 into 54d08f77d0527af840c9f102ce9a...
Project Workday/canvas-kit
Branch Review chore/upgrade-storybook-to-vite
Run status status check passed Passed #10042
Run duration 02m 16s
Commit git commit ad9f61d736 ℹ️: Merge ac9845e383f7693308c8db35f2a0264f91672295 into 54d08f77d0527af840c9f102ce9a...
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 15
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 802
View all changes introduced in this branch ↗︎
UI Coverage  19.4%
  Untested elements 1527  
  Tested elements 365  
Accessibility  99.47%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 71  

@mannycarrera4 mannycarrera4 mentioned this pull request Dec 8, 2025
8 tasks
@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.

@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
@alanbsmith alanbsmith force-pushed the chore/upgrade-storybook-to-vite branch from e12ef42 to ac9845e Compare January 7, 2026 23:27
@alanbsmith alanbsmith force-pushed the chore/upgrade-storybook-to-vite branch from ac9845e to c8b241a Compare January 7, 2026 23:42
Copy link
Contributor

@mannycarrera4 mannycarrera4 left a comment

Choose a reason for hiding this comment

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

@NicholasBoll your parting gift. I'll send you a potato soon

@alanbsmith alanbsmith enabled auto-merge (squash) January 7, 2026 23:47
@alanbsmith alanbsmith merged commit b4f302f into Workday:prerelease/major Jan 7, 2026
19 of 20 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Canvas Kit Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants