Skip to content

📦(frontend) setup browserlist and support chrome >= 109#750

Merged
jbpenrath merged 1 commit into
mainfrom
feat/setup-browserlist
Jul 20, 2026
Merged

📦(frontend) setup browserlist and support chrome >= 109#750
jbpenrath merged 1 commit into
mainfrom
feat/setup-browserlist

Conversation

@jbpenrath

@jbpenrath jbpenrath commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Purpose

Some of our users has reported issues using the application with Chrome 109. Instead of polyfilling one by one each method, we setup vite legacy plugin and configured a browserlist. It adds a 23.5Kb Gzipped module but the polyfill strategy management is more standard and robust.

Then with the upgrade to vite 8.1.5 we save ~400kb (~125kb gzipped) on the global bundle size 😉

Close #741

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Improved browser compatibility via automatic runtime polyfills for modern builds, aligned to the supported Chrome/Edge baseline.
  • Improvements

    • Refreshed the frontend build tooling and browser targeting rules to match the supported audience.
    • Updated build minification for faster, more efficient production output.
  • Chores

    • Updated development dependencies to newer Vite tooling.

@jbpenrath jbpenrath self-assigned this Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b97bf587-29e0-4123-aaa1-767103ccbe6f

📥 Commits

Reviewing files that changed from the base of the PR and between b2ed3a7 and a65797d.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/frontend/package.json
  • src/frontend/vite.config.ts

📝 Walkthrough

Walkthrough

The frontend adds Browserslist targets, updates Vite tooling, enables runtime polyfills through the legacy plugin, disables legacy chunks, and switches build minification to Oxc.

Changes

Frontend browser targeting

Layer / File(s) Summary
Browser target and toolchain configuration
src/frontend/package.json
Adds @vitejs/plugin-legacy, updates Vite to 8.1.5, and defines supported browser targets with exclusions.
Vite compatibility and minification
src/frontend/vite.config.ts
Reads the package browser targets, enables modern runtime polyfills through the legacy plugin, disables legacy chunks, and sets minification to oxc.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: sylvinus

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The compatibility fix is addressed via plugin-legacy/Browserslist, but the linked issue's requested shims, tests, and changelog update are not shown. Add the four Array.prototype shims before BlockNote, include the requested tests, and update the changelog, or explain why the approach differs.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main frontend browser-compatibility change, despite the minor spelling error.
Out of Scope Changes check ✅ Passed The changes stay focused on frontend browser compatibility and Vite configuration; no unrelated code changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/frontend/vite.config.ts`:
- Around line 11-13: Replace the synchronous readFileSync/JSON.parse logic used
to initialize browserslist in vite.config.ts with a direct package.json import,
relying on the existing resolveJsonModule setting. Preserve the browserslist
string[] typing and remove the now-unused filesystem/path dependencies if
applicable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fc0b8b84-0702-4dbe-8537-6fcd9053e36c

📥 Commits

Reviewing files that changed from the base of the PR and between 39f2d9c and 19caabf.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/frontend/package.json
  • src/frontend/vite.config.ts

Comment thread src/frontend/vite.config.ts Outdated
@jbpenrath
jbpenrath force-pushed the feat/setup-browserlist branch from 19caabf to b2ed3a7 Compare July 16, 2026 11:05
@jbpenrath
jbpenrath requested a review from sylvinus July 16, 2026 11:06
@jbpenrath

jbpenrath commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@sylvinus I know that keeping bundle size as small as possible is important for you. So before merging that, I would like to know if you are ok to increase a little bit the bundle size (~66kb / 23.5kb gziped) in favor of maintanability and support of some "old" browsers.

@sylvinus

Copy link
Copy Markdown
Member

@jbpenrath ok for me. Shouldn't we also add a target minimum firefox version? I think @lebaudantoine knows which version some ministries are pinned at, which could be a good floor?

@sylvinus

Copy link
Copy Markdown
Member

Also do we have a clean message in case of non-support for older browsers?

Some of our users has reported issues using the application
with Chrome 109. Instead of polyfilling one by one each
method, we setup vite legacy plugin and configured a
browserlist. It adds a 23.5Kb Gzipped module but the
polyfill strategy management is more standard and robust.

Close #741
@jbpenrath
jbpenrath force-pushed the feat/setup-browserlist branch from b2ed3a7 to a65797d Compare July 20, 2026 15:40
@jbpenrath
jbpenrath merged commit f058ee4 into main Jul 20, 2026
15 checks passed
@jbpenrath
jbpenrath deleted the feat/setup-browserlist branch July 20, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants