close
Skip to content

chore: drop duplicate getBackendConnectorName (template-connectors v2, PR 4)#9330

Draft
royendo wants to merge 2 commits intoroyendo/template-connectors-v2-frontendfrom
royendo/template-connectors-v2-cleanup
Draft

chore: drop duplicate getBackendConnectorName (template-connectors v2, PR 4)#9330
royendo wants to merge 2 commits intoroyendo/template-connectors-v2-frontendfrom
royendo/template-connectors-v2-cleanup

Conversation

@royendo
Copy link
Copy Markdown
Contributor

@royendo royendo commented Apr 28, 2026

PR 4 of 4 from PRD-template-connectors-v2.md. Stacked on top of #9329 (and #9326, #9325). Smaller than the PRD originally scoped — see "Why so small" below.

  • Drop the duplicate getBackendConnectorName export from web-common/src/features/templates/schema-utils.ts. Both live consumers (AddAiConnectorDialog.svelte and add-data/manager/steps/utils.ts) already import from web-common/src/features/sources/modal/connector-schemas.ts; the schema-utils.ts copy had zero importers outside its own file.

Why so small

The PRD's PR 4 scope listed deletion of the per-connector schema TS files (templates/schemas/*.ts), sources/sourceUtils.ts, sources/modal/submitAddDataForm.ts, and templates/JSONSchemaFormRenderer.svelte. None of those are safe to delete yet:

  • sourceUtils.ts (compileSourceYAML, prepareSourceFormData) is still imported by add-data/form/SourceForm.svelte, add-data/manager/steps/import.ts, and add-data/form/yaml-preview.ts. The new add-data manager flow (web-common/src/features/add-data/) was not in PR 3's scope and still uses these helpers for client-side YAML compilation.
  • submitAddDataForm.ts is still imported by AddDataFormManager.saveConnector (the connector test-and-save path) and by connectors/ai/saveAiConnector.ts.
  • JSONSchemaFormRenderer.svelte is still imported by AddDataForm.svelte, MultiStepConnectorFlow.svelte, and add-data/form/AddDataFormStructure.svelte.
  • The 22 source-connector schema TS files (s3.ts, gcs.ts, postgres.ts, etc.) are only imported by connector-schemas.ts, but multiStepFormSchemas is still seeded from those static imports. Dropping them would mean getConnectorSchema returns null until ListTemplates resolves and registerTemplateSchema runs — which means an empty form on first render and broken specs that don't seed via populateSchemaCache. The PRD even calls this out as one of the open decisions and recommends doing it but it needs to come with the test updates.

A follow-up PR (call it 4b) should:

  1. Rewire the add-data manager flow at web-common/src/features/add-data/ through GenerateFile so it stops importing sourceUtils/submitAddDataForm.
  2. Delete the static schema TS files and update connector-schemas.spec.ts to seed via populateSchemaCache.
  3. Manually QA both flows end-to-end before merging.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

@royendo royendo mentioned this pull request Apr 28, 2026
8 tasks
@royendo royendo force-pushed the royendo/template-connectors-v2-cleanup branch from 31cd853 to 49a87dd Compare April 28, 2026 23:03
royendo and others added 2 commits April 28, 2026 19:22
This export was a stale duplicate of the same function in
`web-common/src/features/sources/modal/connector-schemas.ts`. Both
live consumers (`AddAiConnectorDialog.svelte`, `add-data/manager/
steps/utils.ts`) already import from `connector-schemas.ts`; the
`schema-utils.ts` copy had zero importers outside its own file.

The broader cleanup the PRD called out — deleting the per-connector
schema TS files, `sourceUtils.ts`, and `submitAddDataForm.ts` — is
deferred until the new add-data manager flow at
`web-common/src/features/add-data/` is also rewired through
`GenerateFile`. Path 2 currently shares those helpers with the modal,
so they cannot be removed yet without breaking it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Deletes 22 hand-written `MultiStepFormSchema` TS files for source
connectors. They were only imported by `connector-schemas.ts`, which
the previous commit on the PR 3 branch refactored to populate its
schema cache dynamically from `ListTemplates`. The runtime templates
under `runtime/templates/definitions/` are now the single source of
truth for these connectors' form metadata.

Files removed: athena, azure, bigquery, clickhouse, delta, druid,
duckdb, gcs, https, iceberg, local_file, motherduck, mysql, pinot,
postgres, redshift, s3, salesforce, snowflake, sqlite, starrocks,
supabase.

Kept (still loaded statically; not driven by `ListTemplates`):

- `claude.ts`, `gemini.ts`, `openai.ts` — AI connectors. AI add-data
  flow is separate from the templates system per the PRD.
- `ducklake.ts`, `ducklake-utils.ts` — DuckLake's "parameters" tab
  composes the `attach` clause client-side via `composeDuckLakeAttach`,
  which needs the schema synchronously.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@royendo royendo force-pushed the royendo/template-connectors-v2-cleanup branch from 49a87dd to bd339db Compare April 28, 2026 23:22
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