Skip to content

fix: enable ts check in .svelte and some hidden problems#8

Merged
exoticknight merged 8 commits intomainfrom
fix/svelte
Jun 13, 2025
Merged

fix: enable ts check in .svelte and some hidden problems#8
exoticknight merged 8 commits intomainfrom
fix/svelte

Conversation

@exoticknight
Copy link
Member

No description provided.

@exoticknight exoticknight self-assigned this Jun 11, 2025
@exoticknight exoticknight requested a review from Copilot June 11, 2025 10:34

This comment was marked as outdated.

@exoticknight exoticknight requested review from Copilot and kwaa June 11, 2025 11:12
Copy link
Contributor

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 enables TypeScript checking for .svelte files and addresses several hidden issues by refining type definitions and state handling within the codebase. Key changes include:

  • Removal of the examples directory from the main tsconfig.svelte.json, relying on a dedicated config file for examples.
  • Updating error and abort controller state initialization in Chat from null to undefined.
  • Adjustments to snippet parameter types and minor dependency updates in package configurations.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.svelte.json Removed the examples folder from the include array to delegate type-checking to a separate config.
packages/svelte/src/chat.svelte.ts Modified error and abort controller state assignments to use undefined instead of null.
packages/shared/src/types/ui.ts Reformatted type definition for UIMessagePart without functional changes.
packages/shared/src/types/stream-text.ts Reformatted type definition for StreamTextDataChunk.
package.json Updated dependency versions to their latest patches.
examples/svelte/tsconfig.json Added a dedicated tsconfig for Svelte examples.
examples/svelte/src/message-bubble.svelte Enhanced snippet parameter type annotations and implemented optional chaining.
examples/svelte/src/app.svelte Updated attachment and tool typing, and ensured consistency in error state usage.
examples/svelte/package.json Updated Svelte version.
examples/react/src/ui-message-part.tsx Adjusted template rendering to directly access properties.
.vscode/settings.json Enabled the Svelte TypeScript plugin.
Comments suppressed due to low confidence (3)

tsconfig.svelte.json:14

  • Removal of 'examples/svelte/src' from the tsconfig include array may affect type-checking; confirm that the separate config for examples adequately covers the necessary files.
   -    "examples/svelte/src",

packages/svelte/src/chat.svelte.ts:28

  • Changing the initial value of #error from null to undefined might affect consumers expecting a nullable error; ensure that all related type checks and usages are updated accordingly.
#error = $state<Error>()

packages/svelte/src/chat.svelte.ts:49

  • Switching from null to undefined for #abortController requires consistent handling across the code; verify that all checks against this property use undefined instead of null.
#abortController: AbortController | undefined

@exoticknight exoticknight merged commit 20012b6 into main Jun 13, 2025
1 check passed
@exoticknight exoticknight deleted the fix/svelte branch June 13, 2025 12:52
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.

3 participants