Skip to content

chore: NO-JIRA upgrade vite to version 8#1136

Merged
Brad Paugh (braddialpad) merged 11 commits intostagingfrom
feat/upgrade-vite-8
Mar 31, 2026
Merged

chore: NO-JIRA upgrade vite to version 8#1136
Brad Paugh (braddialpad) merged 11 commits intostagingfrom
feat/upgrade-vite-8

Conversation

@braddialpad
Copy link
Copy Markdown
Contributor

Upgrades vite and any related dependencies to the latest version.

@braddialpad Brad Paugh (braddialpad) added the visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests label Mar 18, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3460286646

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Comment thread package.json
@iropolo
Copy link
Copy Markdown
Contributor

Some AI comparison tests.

Version Upgrades

Package Before After
vite ^5.4.2 ^8.0.0
vitest ^1.6.1 ^4.1.0
@vitejs/plugin-vue ^5.2.3 ^6.0.5
@vitest/coverage-v8 ^1.0.0 ^4.1.0
storybook 10.2.6 10.3.0

Configuration Changes

  1. Rollup → Rolldown: All rollupOptions renamed to rolldownOptions (Vite 8 uses Rolldown as bundler)
  2. Build target: Added target: 'es2020' to multiple vite configs
  3. CSS output naming: Changed from style.css to dialtone-combinator.css in combinator package
  4. Coverage config: Removed all: true from vitest coverage options

Test Changes

  • Deleted: div.test.js (104 lines) - Rich text editor div extension tests
  • Fixed: Mock syntax in suggestion_utils.test.js (arrow function → regular function for VueRenderer mock)
  • Added: vi.clearAllMocks() in combobox tests

Test Execution

Metric Vite 5 (staging) Vite 8 (PR) Difference
Test Files 97 passed 96 passed -1
Tests 2065 passed 2057 passed -8
Total Duration 27.20s 24.40s -10.3% ✅
Transform Time 4.19s 17.83s +325% ❌
Test Execution 52.95s 42.49s -19.7% ✅
Environment Setup 38.80s 39.05s +0.6%
Errors 0 1 ⚠️

Build Performance

Metric Vite 5 (staging) Vite 8 (PR) Difference
Build time 10.09s 14.12s +40% slower
Total time 11.34s 15.61s +37.6% slower

Bundle Size (dialtone-vue)

File Vite 5 Vite 8 Change
emoji-picker.cjs 21.26 kB 1,412.37 kB +6547% ❌
rich-text-editor.cjs 74.60 kB 202.31 kB +171% ❌
dialtone-vue.cjs 21.39 kB 20.62 kB -3.6% ✅
datepicker.cjs 12.86 kB 13.58 kB +5.6%
popover.cjs 14.51 kB 14.48 kB -0.2% ✅

@iropolo
Copy link
Copy Markdown
Contributor

Quick go through.

Emoji-Picker Bundle Bloat (21KB → 1.4MB)
Root Cause
Rolldown doesn't honor regex patterns in external the same way Rollup does.

The config uses regex externals:

rolldownOptions: {
  external: [
    /^@dialpad/,  // ❌ Not working in Rolldown
    ...
  ]
}

Evidence:

Vite 5 (Rollup) output correctly externalizes:

import { DtIconSearch, ... } from "@dialpad/dialtone-icons/vue3";

Vite 8 (Rolldown) bundles all icons into a 1.2MB chunk instead
Fix
Convert regex externals to explicit string patterns or use a function:

rolldownOptions: {
  external: (id) => {
    // Explicit function to check externals
    if (id.startsWith('@dialpad/')) return true;
    if (id.startsWith('@tiptap/') && !id.includes('vue-3')) return true;
    if (id.startsWith('date-fns')) return true;
    if (id.startsWith('emoji-toolkit')) return true;
    if (id.startsWith('overlayscrollbars')) return true;
    if (id.startsWith('prosemirror')) return true;
    if (['regex-combined-emojis', 'deep-equal', 'tippy.js', 'vue'].includes(id)) return true;
    return false;
  }
}

@jawrey
Copy link
Copy Markdown
Contributor

Justin Awrey (jawrey) commented Mar 19, 2026

Interesting findings, especially WRT to the build time increases. On GCT across ~30 packages we're seeing an avg build time delta of -30% and bundle size delta of -10%. I wonder what is causing it to actually be slower

Edit: same analysis on GCT for reference: https://github.com/dialpad/goblin-client-tools/pull/135#issuecomment-4092980647

@braddialpad
Copy link
Copy Markdown
Contributor Author

Nice comparison Ignacio Ropolo (@iropolo). I feel we must be doing something wrong here to have results this poor. I will look into making some improvements.

@braddialpad
Copy link
Copy Markdown
Contributor Author

Alright so... funny thing. It seems this branch was not actually using vite 8, that pnpm-lock was still stuck on version 7, so that would explain no performance improvements.

Fixed that and a bunch of other things.

The build times remain roughly the same, this is mainly due to vite-plugin-dts being a big bottleneck. I tried to upgrade to the rolldown version of that, but did not have good success so I'm just going to leave it.

Bundle size is reduced by 200kb which is pretty decent.

@github-actions
Copy link
Copy Markdown
Contributor

✔️ Deploy previews ready!
😎 Dialtone documentation preview: https://dialtone.dialpad.com/deploy-previews/pr-1136/
😎 Dialtone-vue preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-1136/

@braddialpad Brad Paugh (braddialpad) merged commit 0a36752 into staging Mar 31, 2026
19 checks passed
@braddialpad Brad Paugh (braddialpad) deleted the feat/upgrade-vite-8 branch March 31, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

visual-test-ready Add this tag when the PR is ready for visual test, to trigger GHA visual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants