Skip to content

chore: pre-bundle appkit-ui and lucide-react in template Vite config - #750

Open
MarioCadenas wants to merge 3 commits into
mainfrom
work/19-pre-bundle-appkit-ui-and-lucid
Open

MarioCadenas wants to merge 3 commits into
mainfrom
work/19-pre-bundle-appkit-ui-and-lucid

Conversation

@MarioCadenas

@MarioCadenas MarioCadenas commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

Pre-bundle @databricks/appkit-ui/react, @databricks/appkit-ui/react/beta and lucide-react in the template's Vite config. They are added to optimizeDeps.include in template/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

  • Repository checks: 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.
  • Setup: I scaffolded fresh template apps from this branch (tools/smoke-test-template.ts), ran the template's dev server, and opened pages in headless Chrome.
  • Scaffold with every plugin's pages: all three dependencies resolve and are pre-bundled at startup, with no "failed to resolve" or optimize errors. Every page renders with one page load per navigation.
  • Default scaffold: I added a page importing @databricks/appkit-ui/react/beta while the dev server was running.
    • Before this change: Vite logged new dependencies optimized: @databricks/appkit-ui/react/beta and optimized dependencies changed. reloading, and the browser reloaded (3 page loads for 2 navigations).
    • With this change: no re-optimize and no reload (2 page loads for 2 navigations), and the new page renders.

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.

MarioCadenas and others added 2 commits November 25, 2026 16:16
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>
@MarioCadenas MarioCadenas changed the title Pre-bundle appkit-ui and lucide-react in template Vite chore: pre-bundle appkit-ui and lucide-react in template Vite config Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks 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 @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

@MarioCadenas

Copy link
Copy Markdown
Collaborator Author

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)

  • critical: The change has no public pull request on databricks/appkit. (databricks/appkit pull requests for work/19-pre-bundle-appkit-ui-and-lucid)
    Proof: gh pr list --repo databricks/appkit --state all --head work/19-pre-bundle-appkit-ui-and-lucid returned []; git ls-remote --heads origin work/19-pre-bundle-appkit-ui-and-lucid returned no branch; GitHub commit-to-PR lookup reported no commit found for fd97659.

No code change.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
@MarioCadenas

Copy link
Copy Markdown
Collaborator Author

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.

@MarioCadenas
MarioCadenas marked this pull request as ready for review November 25, 2026 17:07
@MarioCadenas
MarioCadenas requested a review from a team as a code owner November 25, 2026 17:07
@MarioCadenas
MarioCadenas requested a review from pkosiec November 25, 2026 17:07

This branch has not been deployed

No deployments
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.

1 participant