Repository navigation
chore: pre-bundle appkit-ui and lucide-react in template Vite config - #750
MarioCadenas wants to merge 3 commits into
Conversation
Add '@databricks/appkit-ui/react', '@databricks/appkit-ui/react/beta' and 'lucide-react' to optimizeDeps.include in the template, after the React entries. Vite then pre-bundles them at startup, so the first page that imports them doesn't make Vite re-optimize dependencies and reload the page. Checked in freshly scaffolded template apps running the template dev server, with pages opened in headless Chrome: - All three resolve and are pre-bundled at startup, with no resolve or optimize errors, and every page of the all-plugins scaffold renders without an extra reload. - In the default scaffold, adding a page that imports '@databricks/appkit-ui/react/beta' while the server runs made Vite log "new dependencies optimized" and "optimized dependencies changed. reloading" and reload the browser before this change; after it, no re-optimize and no reload. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
No code change: the previous run failed before it started because the package manager was missing from the check environment. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 45660629240 -R databricks/appkit -n appkit-template-0.105.0-pr.442faca-work-19-pre-bundle-appkit-ui-and-lucid-750 -D appkit-pr-750 \
&& unzip -o "appkit-pr-750/appkit-template-0.105.0-pr.442faca-work-19-pre-bundle-appkit-ui-and-lucid-750.zip" -d "appkit-pr-750" \
&& databricks apps init --template "appkit-pr-750"The template pins |
|
Review 1 · Fail · 1 critical Does the change do what the task asked? No. Gate: major and worse must be fixed. 1 finding (1 important). 1 finding (1 important). The Vite configuration contains the three requested entries, and a scaffolded app rendered the beta-importing page without an extra reload. The task is incomplete because no PR has been opened on databricks/appkit for this branch or commit. Important (required)
|
No code change. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
|
Review 2 · Pass Does the change do what the task asked? Yes. Gate: major and worse must be fixed. No findings: nothing needs fixing. No findings: nothing needs fixing. The earlier missing-PR finding is fixed: public PR #750 is open at the reviewed commit, with a conventional title and verification details. This round adds an empty signed-off commit, and the prescribed repository check passed; I found no qualifying findings. No findings. |
What
Pre-bundle
@databricks/appkit-ui/react,@databricks/appkit-ui/react/betaandlucide-reactin the template's Vite config. They are added tooptimizeDeps.includeintemplate/client/vite.config.ts, after the four React entries already there.Why
Vite then pre-bundles these dependencies at startup. The first page that imports them no longer makes Vite re-optimize dependencies and reload the page.
How it was verified
pnpm install --frozen-lockfile && pnpm run check && pnpm run knip && pnpm build && pnpm run typecheck && pnpm vitest run --changed "$(git merge-base HEAD origin/main)"passes. No test covers this config file.tools/smoke-test-template.ts), ran the template's dev server, and opened pages in headless Chrome.@databricks/appkit-ui/react/betawhile the dev server was running.new dependencies optimized: @databricks/appkit-ui/react/betaandoptimized dependencies changed. reloading, and the browser reloaded (3 page loads for 2 navigations).Notes
The second commit is empty. It only re-ran the checks, and squashing drops it.
This pull request and its description were written by Isaac.