Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaechele
Copy link
Contributor

@kaechele kaechele commented Jul 1, 2025

Changes

  1. Adapts the SvelteKit example to Svelte 5 runes syntax.
  2. Update dependencies
  3. Move openapi-fetch to devDependencies (Svelte is a compiler and doesn't need openapi-fetch at runtime).
  4. Remove unneeded @sveltejs/vite-plugin-svelte-inspector and tslib dependencies.
  5. Update SvelteKit boilerplate to what would be generated by a current sv create invocation.
  6. Consistently use async/await syntax.

also:

Update links to Svelte documentation in docs.

How to Review

  1. pnpm check shows no errors for SvelteKit example.
  2. pnpm dev still delivers a functioning example application.
  3. SvelteKit example uses current Svelte and TypeScript best practices.

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

kaechele added 2 commits July 1, 2025 11:19
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 15:53
@kaechele kaechele requested a review from a team as a code owner July 1, 2025 15:53
@kaechele kaechele requested a review from gzm0 July 1, 2025 15:53
Copy link

netlify bot commented Jul 1, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b3f6be1

Copy link

changeset-bot bot commented Jul 1, 2025

⚠️ No Changeset found

Latest commit: b3f6be1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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 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())}>

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