fix(template): drop root postinstall typegen to avoid deploy cache-bust - #546
Merged
Merged
Conversation
The Databricks Apps runtime treats any root preinstall/install/postinstall/prepare script as source-dependent and copies the full source tree before installing dependencies (the Dockerfile slow path). That puts every generated AppKit app on the slow path, so any source edit invalidates the dependency layer and reruns `npm install` on redeploy. Removing the root postinstall moves generated apps onto the runtime's manifest-first fast path, so source-only redeploys reuse the cached dependency layer. Type generation still runs where it is actually needed via `prebuild` and `predev`, so generated apps are functionally unchanged. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Contributor
🤖 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 32491644666 -R databricks/appkit -n appkit-template-0.64.0-pr.7c57306-fix-template-remove-postinstall-typegen-546 -D appkit-pr-546 \
&& unzip -o "appkit-pr-546/appkit-template-0.64.0-pr.7c57306-fix-template-remove-postinstall-typegen-546.zip" -d "appkit-pr-546" \
&& databricks apps init --template "appkit-pr-546"The template pins |
atilafassina
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the redundant root
postinstall: npm run typegenfrom the generated app template.Why
A root
postinstallruns on everynpm install. In container-based deploys, a root install-lifecycle script forces the build to copy the full application source before installing dependencies — so any source-only change invalidates the cached dependency layer and reinstalls from scratch on redeploy.Type generation is already wired where it is actually needed:
prebuild:npm run sync && npm run typegen -- --waitpredev:npm run sync && npm run typegenso the
postinstallinvocation is redundant for both local dev and deploy (deploy runsnpm install→npm run build, which triggersprebuild). Dropping it lets source-only redeploys reuse the cached dependency layer, which primarily benefits the developer inner loop (edit code → redeploy).Safety
typegenstill runs viaprebuild/predev.shared/appkit-typesis only atsconfiginclude, which tolerates an empty dir, plus a gitignored serving stub), so a freshnpm install && npm run typecheckwithout a build is unaffected.Verification
template/package.jsonremains valid JSON;typegen/sync/prebuild/predevintact