Skip to content

chore(dashboard): drop dead vite build config keys - #382

Merged
harshtandiya merged 5 commits into
developfrom
chore/vite-dead-config
Aug 27, 2026
Merged

chore(dashboard): drop dead vite build config keys#382
harshtandiya merged 5 commits into
developfrom
chore/vite-dead-config

Conversation

@harshtandiya

Copy link
Copy Markdown
Collaborator

What changed

Removes target: "es2015" and chunkSizeWarningLimit: 1500 from dashboard/vite.config.js.

Both sit inside frappeui({ buildConfig: {...} }), and frappe-ui's plugin never reads either one. node_modules/frappe-ui/vite/buildConfig.js builds its returned build object from exactly four keys — outDir, emptyOutDir, commonjsOptions, sourcemap. target appears nowhere in frappe-ui's vite plugins except frappeProxy.js's own proxy target.

The build output is the proof. With chunkSizeWarningLimit: 1500 set, it still warned at 500 kB:

(!) Some chunks are larger than 500 kB after minification

That warning is unchanged after this PR, because nothing was ever applying the value.

Not changed: the effective build target has always been Vite's default, currently baseline-widely-available. Setting it explicitly inside buildConfig would be equally inert, and pinning it at the top level would only restate the default — so both keys are deleted rather than moved. If the 500 kB warning is actually noise worth silencing, that belongs in a top-level build.chunkSizeWarningLimit, which is a separate call.

Stacked on #381 because vite.config.js is touched by that PR's reformat commit. Review that one first.

Demo

No visual change — build config only. Applying skip-demo.

Testing

yarn build before and after: same 2743 modules, same ~2.1s, same chunk sizes, same 500 kB warning. Nothing about the output moved, which is the point.

🤖 Generated with Claude Code

harshtandiyaand others added 4 commits August 27, 2026 16:50
The dashboard was formatted by two tools that disagreed. Biome owned
`dashboard/` via `yarn lint`, while the pre-commit prettier hook matched
`types_or: [javascript, vue, scss]` with no exclude for `dashboard/`, so it
also reformatted every Vue file on commit. The result was `.ts` files without
semicolons and `.vue` files with them, and 224 `biome check` errors that were
just the two tools undoing each other. Biome had no CI job, so nothing caught
it.
oxlint and oxfmt now cover the whole repo — dashboard, desk scripts and e2e —
with one config each, so `yarn lint`, pre-commit and CI all enforce the same
thing. `linter.yml` already runs pre-commit, so no new workflow is needed.
Notes on the configs:
- Both pre-commit mirrors default to `types_or: [javascript, jsx, ts, tsx]`,
which silently skips every `.vue` file. Both hooks override it.
- `.oxfmtrc.json` sets `useTabs` explicitly because `.editorconfig` covers
`*.js,*.vue,*.css,*.scss,*.html` but not `*.ts`.
- oxfmt also formats JSON, Markdown, YAML, TOML, HTML and CSS. DocType schemas
have Frappe-specific formatting, so `ignorePatterns` restricts oxfmt to
JS/TS/Vue, matching the hook's `types_or`.
- `eslint:recommended` is not a subset of oxlint's correctness and suspicious
categories. The six rules that fall outside them are listed explicitly; all
had zero violations. `no-console` is scoped to `buzz/**/*.js`, the only place
the old `types_or: [javascript]` hook ever applied it.
- The ~90-entry `globals` block in `.eslintrc` existed only to satisfy
`no-undef`, which oxlint ships as a nursery rule. It is dropped, not ported.
- `unicorn/no-empty-file` is off for `buzz/**/*.js`; those are Frappe's
generated doctype stubs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three of these were real bugs rather than style:
- `RegisterInterest.vue` declared a `campaign` prop and a local `campaign` ref
for the fetched document. In `<script setup>` the local binding shadows the
prop, so the template worked by accident. The ref is now `campaignDoc`.
- `FormFieldSections.vue` declared `sections` inside the `sections` computed,
shadowing it.
- `global.d.ts` nested ambient module declarations inside `declare global`,
which is not legal. Dropping `export {}` makes the file script-scope, so the
`Window` interface and the wildcard modules both work at top level. vue-tsc
never surfaced this.
The rest are mechanical: unused catch bindings, unused parameters and imports,
and redundant regex escapes.
Two suppressions rather than fixes. `unicorn/no-array-sort` wants `toSorted()`,
but Vite does not polyfill built-in methods, and both call sites sort an array
they just created, so the mutation is not observable. `CustomFieldInput`'s
`defineModel` is typed `any` because Frappe field values are heterogeneous and
the template binds the model straight into components that expect a string;
typing it honestly is a refactor, not a lint fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pure `oxfmt` output, no hand edits. Settles the two-formatter split: `.ts`
files keep the semicolon-free style Biome used, and `.vue` files lose the
semicolons prettier had been adding on every commit.
Two visible differences from before. `sortImports` replaces Biome's
`organizeImports` and uses a different ordering, so import blocks reshuffle.
And oxfmt formats `<template>` and `<style>` blocks, which Biome never touched
— it only handled `<script>` — so Vue markup reflows to the 100 column width.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`target` and `chunkSizeWarningLimit` were passed inside
`frappeui({ buildConfig: {...} })`, which never reads either. frappe-ui's
`buildConfig.js` builds its returned `build` object from exactly four keys:
`outDir`, `emptyOutDir`, `commonjsOptions` and `sourcemap`.
The build warning is the proof — it fired at 500 kB, not the 1500 kB the config
asked for, and it still does after this change.
So the effective target has always been Vite's default, currently
`baseline-widely-available`. Setting it explicitly in the same block would be
equally inert, and pinning it at the top level would only restate the default,
so both keys are removed rather than moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@harshtandiyaharshtandiya added the skip-demo Skip adding a video / screenshot in PR description. Passes the failing CI for demo addition label Aug 27, 2026
@greptile-apps

greptile-appsBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes two ineffective options from the dashboard’s nested frappe-ui build configuration.

  • Drops the unused target: "es2015" setting.
  • Drops the unused chunkSizeWarningLimit: 1500 setting.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

FilenameOverview
dashboard/vite.config.jsRemoves two nested build options that were not affecting the generated Vite configuration; no blocking issue was identified.

Reviews (2): Last reviewed commit: "Merge branch 'develop' into chore/vite-d..." | Re-trigger Greptile

Base automatically changed from chore/oxlint to developAugust 27, 2026 11:32
@harshtandiyaharshtandiya added the backport main backport to main branch label Aug 27, 2026
@harshtandiya
harshtandiya merged commit b538989 into developAug 27, 2026
9 checks passed
@harshtandiya
harshtandiya deleted the chore/vite-dead-config branch August 27, 2026 11:40
@github-actions

Copy link
Copy Markdown
Contributor

Successfully created backport PR for main:

harshtandiya added a commit that referenced this pull request Aug 27, 2026
chore(dashboard): drop dead vite build config keys (#382)
* chore: replace eslint, prettier and biome with oxlint and oxfmt
The dashboard was formatted by two tools that disagreed. Biome owned
`dashboard/` via `yarn lint`, while the pre-commit prettier hook matched
`types_or: [javascript, vue, scss]` with no exclude for `dashboard/`, so it
also reformatted every Vue file on commit. The result was `.ts` files without
semicolons and `.vue` files with them, and 224 `biome check` errors that were
just the two tools undoing each other. Biome had no CI job, so nothing caught
it.
oxlint and oxfmt now cover the whole repo — dashboard, desk scripts and e2e —
with one config each, so `yarn lint`, pre-commit and CI all enforce the same
thing. `linter.yml` already runs pre-commit, so no new workflow is needed.
Notes on the configs:
- Both pre-commit mirrors default to `types_or: [javascript, jsx, ts, tsx]`,
which silently skips every `.vue` file. Both hooks override it.
- `.oxfmtrc.json` sets `useTabs` explicitly because `.editorconfig` covers
`*.js,*.vue,*.css,*.scss,*.html` but not `*.ts`.
- oxfmt also formats JSON, Markdown, YAML, TOML, HTML and CSS. DocType schemas
have Frappe-specific formatting, so `ignorePatterns` restricts oxfmt to
JS/TS/Vue, matching the hook's `types_or`.
- `eslint:recommended` is not a subset of oxlint's correctness and suspicious
categories. The six rules that fall outside them are listed explicitly; all
had zero violations. `no-console` is scoped to `buzz/**/*.js`, the only place
the old `types_or: [javascript]` hook ever applied it.
- The ~90-entry `globals` block in `.eslintrc` existed only to satisfy
`no-undef`, which oxlint ships as a nursery rule. It is dropped, not ported.
- `unicorn/no-empty-file` is off for `buzz/**/*.js`; those are Frappe's
generated doctype stubs.
* fix: resolve oxlint findings across dashboard, desk scripts and e2e
Three of these were real bugs rather than style:
- `RegisterInterest.vue` declared a `campaign` prop and a local `campaign` ref
for the fetched document. In `<script setup>` the local binding shadows the
prop, so the template worked by accident. The ref is now `campaignDoc`.
- `FormFieldSections.vue` declared `sections` inside the `sections` computed,
shadowing it.
- `global.d.ts` nested ambient module declarations inside `declare global`,
which is not legal. Dropping `export {}` makes the file script-scope, so the
`Window` interface and the wildcard modules both work at top level. vue-tsc
never surfaced this.
The rest are mechanical: unused catch bindings, unused parameters and imports,
and redundant regex escapes.
Two suppressions rather than fixes. `unicorn/no-array-sort` wants `toSorted()`,
but Vite does not polyfill built-in methods, and both call sites sort an array
they just created, so the mutation is not observable. `CustomFieldInput`'s
`defineModel` is typed `any` because Frappe field values are heterogeneous and
the template binds the model straight into components that expect a string;
typing it honestly is a refactor, not a lint fix.
* style: reformat with oxfmt
Pure `oxfmt` output, no hand edits. Settles the two-formatter split: `.ts`
files keep the semicolon-free style Biome used, and `.vue` files lose the
semicolons prettier had been adding on every commit.
Two visible differences from before. `sortImports` replaces Biome's
`organizeImports` and uses a different ordering, so import blocks reshuffle.
And oxfmt formats `<template>` and `<style>` blocks, which Biome never touched
— it only handled `<script>` — so Vue markup reflows to the 100 column width.
* chore(dashboard): drop dead vite build config keys
`target` and `chunkSizeWarningLimit` were passed inside
`frappeui({ buildConfig: {...} })`, which never reads either. frappe-ui's
`buildConfig.js` builds its returned `build` object from exactly four keys:
`outDir`, `emptyOutDir`, `commonjsOptions` and `sourcemap`.
The build warning is the proof — it fired at 500 kB, not the 1500 kB the config
asked for, and it still does after this change.
So the effective target has always been Vite's default, currently
`baseline-widely-available`. Setting it explicitly in the same block would be
equally inert, and pinning it at the top level would only restate the default,
so both keys are removed rather than moved.
---------
(cherry picked from commit b538989)
Co-authored-by: Harsh Tandiya <harsh.tandiya@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport mainbackport to main branchskip-demoSkip adding a video / screenshot in PR description. Passes the failing CI for demo addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@harshtandiya