Skip to content

Commit d826a53

Browse files
committed
fix(template): import beta plugins from /beta subpath
The init template hard-coded a single `from '@databricks/appkit'` import for every plugin, which would resolve to `undefined` for beta plugins (they live behind the `/beta` subpath export). Splits the import emission by plugin stability: - Stable plugins stay on the existing line. - Each beta plugin gets its own `from '@databricks/appkit/beta'` import line. Backwards-compatible with the current Databricks CLI: until pluginVar exposes Stability, `$p.Stability` resolves to the empty string, every plugin compares unequal to "beta", and rendering matches today's output. Once databricks/cli#5090 lands the field, beta plugins start routing to the right import automatically. The plugins: [...] array body is unchanged — both stable and beta plugins are constructed identically (`plugin()`) once they're in scope, so the runtime call list doesn't depend on tier. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
1 parent 37c456b commit d826a53

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

template/server/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { createApp{{range $name, $_ := .plugins}}, {{$name}}{{end}} } from '@databricks/appkit';
1+
import { createApp{{range $name, $p := .plugins}}{{if ne $p.Stability "beta"}}, {{$name}}{{end}}{{end}} } from '@databricks/appkit';
2+
{{- range $name, $p := .plugins}}
3+
{{- if eq $p.Stability "beta"}}
4+
import { {{$name}} } from '@databricks/appkit/beta';
5+
{{- end}}
6+
{{- end}}
27
{{- if .plugins.lakebase}}
38
import { setupSampleLakebaseRoutes } from './routes/lakebase/todo-routes';
49
{{- end}}

0 commit comments

Comments
 (0)