Skip to content

Task 022: Lazy-load notification form components - #21

Merged
Igloczek merged 3 commits into
masterfrom
task/022-lazy-load-notification-forms
Jun 30, 2026
Merged

Igloczek merged 3 commits into
masterfrom
task/022-lazy-load-notification-forms

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/022-lazy-load-notification-forms.md from the ponytail audit backlog.

Goal

Stop bundling all 94 notification forms on initial load.

Scope

  • Refactor src/components/notifications/index.ts to use dynamic imports keyed by provider type.
  • Update NotificationDialog.vue to resolve async components (loading state optional).
  • Keep the same registry keys and provider type strings as the server.

Acceptance criteria

  • index.ts has no static import X from "./X.vue" for every provider (async map or defineAsyncComponent factory).
  • Opening notification settings loads only the active provider chunk (verify in network tab or bundle analyze).
  • Creating/editing notifications for at least 3 providers (e.g. webhook, smtp, discord) works.
  • bun run lint passes.
  • bun run build:frontend succeeds.
  • Main dashboard JS chunk is smaller than baseline (compare ANALYZE=1 output).

Depends on

Nothing (can run in parallel with Task 018).

Verification

bun run lint
ANALYZE=1 bun run build:frontend
bun run test-e2e

Audit reference

Finding #3 — eager notification form imports.

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

Main bundle −224 kB; provider forms split into async chunks. No new registry abstraction.

Lean already. Ship.

3 files changed, 1163 insertions(+), 692 deletions(-)

@Igloczek
Igloczek force-pushed the task/022-lazy-load-notification-forms branch from fe2c944 to fb75c5d Compare June 30, 2026 12:03
Igloczek added a commit that referenced this pull request Jun 30, 2026
Consolidate duplicate templated field components into a single
TemplatedField with an `as` prop (`input` | `textarea`). Migrate all
14 notification forms and remove the old components.

Task 018 — ponytail audit finding #21.
Igloczek added 3 commits June 30, 2026 14:20
Replace 94 eager static imports with import.meta.glob + defineAsyncComponent
so each provider form loads as its own chunk on demand. Wrap the dynamic form
in NotificationDialog with Suspense for a loading spinner.

Main app chunk: 1869 kB → 1645 kB (−224 kB).
@Igloczek
Igloczek force-pushed the task/022-lazy-load-notification-forms branch from fb75c5d to 62ca9c5 Compare June 30, 2026 12:21
@Igloczek
Igloczek merged commit 898d93a into master Jun 30, 2026
@Igloczek
Igloczek deleted the task/022-lazy-load-notification-forms branch June 30, 2026 12:58
Igloczek added a commit that referenced this pull request Aug 8, 2026
Consolidate duplicate templated field components into a single
TemplatedField with an `as` prop (`input` | `textarea`). Migrate all
14 notification forms and remove the old components.

Task 018 — ponytail audit finding #21.
Igloczek added a commit that referenced this pull request Aug 8, 2026
…forms

Task 022: Lazy-load notification form components
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