fix: enable ts check in .svelte and some hidden problems#8
Merged
exoticknight merged 8 commits intomainfrom Jun 13, 2025
Merged
fix: enable ts check in .svelte and some hidden problems#8exoticknight merged 8 commits intomainfrom
exoticknight merged 8 commits intomainfrom
Conversation
…ead of String conversion
…tead of String conversion
…Imports and adjust include paths
…e and error handling
…gePart for improved readability
Contributor
There was a problem hiding this comment.
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
kwaa
reviewed
Jun 11, 2025
kwaa
approved these changes
Jun 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.