Skip to content

refactor: move fetchDeployment into Deployment component#3340

Merged
rossnelson merged 4 commits intomainfrom
serverless-workers-crud
Apr 22, 2026
Merged

refactor: move fetchDeployment into Deployment component#3340
rossnelson merged 4 commits intomainfrom
serverless-workers-crud

Conversation

@rossnelson
Copy link
Copy Markdown
Collaborator

@rossnelson rossnelson commented Apr 22, 2026

Summary

Moves deployment data fetching into the Deployment component rather than SvelteKit's load layer, and cleans up the related page infrastructure that was no longer doing anything useful.

Why

fetchDeployment requires a server-relative base URL that isn't available at load time for package consumers. Running it inside the component ensures the transport is fully initialized before the call is made.

Test plan

  • Deployment detail page loads and displays version table
  • Delete version flow refreshes the page correctly
  • Delete deployment flow still works
  • Existing integration tests pass

@rossnelson rossnelson requested a review from a team as a code owner April 22, 2026 17:43
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Apr 22, 2026 8:19pm

Request Review

The Deployment component now owns the fetch call via a $derived expression,
so callers don't need to pass a deploymentPromise prop. loadDeploymentPage
retains only the depends() registration for SvelteKit invalidation.

This avoids the routeForApi timing issue where +page.ts runs before
page.data.webUrl is populated by the parent layout.
Comment thread src/lib/pages/deployment-page.ts
deployment-page.ts was a thin wrapper just to call depends('data:deployment'),
which was never effective because deployment.svelte fetches its own data via
$derived rather than consuming load() data (fetchDeployment requires a
server-relative transport not available in cloud-ui's load layer).

Replace with:
- Inline depends() directly in +page.ts (and note it wires the invalidate
  call in version-table-row, so keep it)
- Add a reloadCount $state in deployment.svelte so child actions can trigger
  a same-page re-fetch without navigating away
- Add onVersionDeleted callback prop to VersionTableRow; call it instead of
  invalidate('data:deployment') after a successful version delete
Nothing calls invalidate('data:deployment') anymore, so the load
function was entirely inert. Also tighten the comment in deployment.svelte.
Comment thread src/lib/pages/deployment.svelte Outdated
@rossnelson rossnelson merged commit 1729302 into main Apr 22, 2026
20 checks passed
@rossnelson rossnelson deleted the serverless-workers-crud branch April 22, 2026 20:36
rossnelson added a commit that referenced this pull request Apr 22, 2026
Auto-generated version bump from 2.49.0 to 2.49.1

Bump type: patch

Changes included:
- [`fccd87f9`](fccd87f) Bump Go toolchain to 1.26.2 for CVE fix (#3336)
- [`0361e3e9`](0361e3e) Add manual refresh of call stack (#3330)
- [`17293020`](1729302) refactor: move fetchDeployment into Deployment component (#3340)

Co-authored-by: rossnelson <146089+rossnelson@users.noreply.github.com>
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.

2 participants