Skip to content

Conversation

ryoppippi
Copy link
Member

sveltekitのremote functionとtop-level-awaitが生えたので反映
めっちゃみやすくなったと思う

https://svelte.dev/docs/kit/remote-functions
https://svelte.dev/docs/svelte/await-expressions

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase to use SvelteKit's new remote functions and top-level await features, replacing the traditional server-side data loading approach with a more streamlined component-based data fetching pattern.

  • Enables experimental async support and remote functions in SvelteKit configuration
  • Converts server-side tweet fetching to a remote function with client-side component loading
  • Upgrades SvelteKit and Svelte to versions that support these new features

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
svelte.config.js Enables experimental async and remote functions features
src/routes/ListenersTweets.svelte Refactors to use individual Tweet components instead of server-provided data
src/routes/+page.svelte Removes dependency on server-side data loading
src/routes/+page.server.ts Removes server-side data loading logic (deleted)
src/lib/Tweet/index.ts Exports new Tweet component
src/lib/Tweet/getTweet.remote.ts Implements remote function for tweet fetching with validation
src/lib/Tweet/Tweet.svelte Creates component that uses remote function with top-level await
package.json Updates SvelteKit, Svelte versions and adds valibot dependency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Copy link

cloudflare-workers-and-pages bot commented Aug 1, 2025

Deploying vim-jp-radio-lp with  Cloudflare Pages  Cloudflare Pages

Latest commit: c4933da
Status: ✅  Deploy successful!
Preview URL: https://6da997fc.lp-d1f.pages.dev
Branch Preview URL: https://remote.lp-d1f.pages.dev

View logs

Copy link
Contributor

@tomoya tomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const { id }: Props = $props();
</script>

<svelte:boundary>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://svelte.dev/docs/svelte/await-expressions#Boundaries
boundaryで囲ってあげる必要がある

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boundaryを使う方法はprerenderだと動かないっぽい

Svelte does not yet support asynchronous server-side rendering, and as such it’s likely that you’re only calling remote functions from the browser, rather than during prerendering. Because of this you will need to use inputs, for now. We’re actively working on this roadblock.

https://svelte.dev/docs/kit/remote-functions#prerender

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なのでやめた

@ryoppippi
Copy link
Member Author

あれ、リスナーの声が表示されてない

@ryoppippi
Copy link
Member Author

だめじゃんあれ

@ryoppippi
Copy link
Member Author

直った!マージします

@ryoppippi ryoppippi merged commit 8e2d93b into main Aug 1, 2025
2 checks passed
@ryoppippi ryoppippi deleted the remote branch August 1, 2025 12:02
@ryoppippi
Copy link
Member Author

結局top-level-awaitは使わなかった

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