-
-
Notifications
You must be signed in to change notification settings - Fork 550
Update docs and examples with Svelte 5 references and syntax #2368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Felix Kaechele <[email protected]>
Signed-off-by: Felix Kaechele <[email protected]>
👷 Deploy request for openapi-ts pending review.Visit the deploys page to approve it
|
|
There was a problem hiding this 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 updates the SvelteKit example to match Svelte 5 syntax and conventions while also updating dependencies, configuration files, and documentation links.
- Adapt SvelteKit examples to new Svelte 5 patterns (e.g. use of PageLoad type, $props(), and $state()).
- Update dependency versions and move/removal of unneeded packages.
- Revise documentation links to point to the current Svelte documentation.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/openapi-fetch/examples/sveltekit/tsconfig.json | Update compiler options and comment URLs to reflect current Svelte docs. |
packages/openapi-fetch/examples/sveltekit/svelte.config.js | Update comment URLs for SvelteKit integrations. |
packages/openapi-fetch/examples/sveltekit/src/routes/page-data/+page.ts | Update load function to use the PageLoad type and new URL syntax in comments. |
packages/openapi-fetch/examples/sveltekit/src/routes/page-data/+page.svelte | Change to new reactive syntax with $props() and update comments; note update of event binding attribute. |
packages/openapi-fetch/examples/sveltekit/src/routes/+page.svelte | Use async/await in onMount and update reactive state initialization; update event binding attribute. |
packages/openapi-fetch/examples/sveltekit/package.json | Update dependency versions and adjust dependency grouping. |
docs/* | Update documentation URLs to reflect Svelte 5 documentation. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
packages/openapi-fetch/examples/sveltekit/src/routes/page-data/+page.svelte:16
- Svelte components typically use the 'on:click' directive for event binding instead of the standard 'onclick' attribute. Reverting to 'on:click' may ensure consistent event handling within Svelte.
<button type="button" onclick={() => location.reload()}>Another fact!</button>
packages/openapi-fetch/examples/sveltekit/src/routes/+page.svelte:30
- Consider using Svelte's 'on:click' event binding syntax instead of the 'onclick' attribute to maintain consistency with Svelte best practices and framework reactivity.
<button type="button" onclick={async () => (fact = await getFact())}>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY very much for taking the time to do this! Much appreciated.
Changes
openapi-fetch
todevDependencies
(Svelte is a compiler and doesn't needopenapi-fetch
at runtime).@sveltejs/vite-plugin-svelte-inspector
andtslib
dependencies.sv create
invocation.also:
Update links to Svelte documentation in docs.
How to Review
pnpm check
shows no errors for SvelteKit example.pnpm dev
still delivers a functioning example application.Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)