Open AlanAcDz opened 2 weeks ago
Latest commit: a9f049511bed5ea905b1ad4fd944b93bfc1fa39f
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.
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
docs-uploadthing | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 12, 2024 5:22pm |
The pull request introduces significant updates to the documentation and implementation of the UploadThing library for SvelteKit. Key changes include modifications to code examples, emphasizing the use of the createUploadThing
helper function, and transitioning from named slots to snippets for content customization in components. Additionally, updates to various Svelte components and their corresponding package configurations reflect changes in state management and prop handling, ensuring compatibility with the latest library versions.
File Path | Change Summary |
---|---|
docs/src/app/(docs)/getting-started/svelte/page.mdx |
Updated documentation with new code examples and explanations for createUploadThing usage and component customization. |
examples/minimal-sveltekit/package.json |
Updated @uploadthing/svelte version from 7.1.1 to 7.2.0 and several devDependencies to newer versions. |
examples/minimal-sveltekit/src/routes/+page.svelte |
Changed how startUpload is accessed, now using ut.startUpload instead of destructuring. |
packages/svelte/package.json |
Updated @uploadthing/svelte version to 7.2.0 and modified peer dependencies to require svelte version ^5.0.0 . |
packages/svelte/src/lib/component/Cancel.svelte |
Restructured prop handling using a new Props type definition. |
packages/svelte/src/lib/component/UploadButton.svelte |
Consolidated props into a single Props type, updated internal state management, and adjusted upload handling logic. |
packages/svelte/src/lib/component/UploadDropzone.svelte |
Refactored props structure and upload handling logic, consolidating into a Props type and improving state management. |
packages/svelte/src/lib/component/Uploader.svelte |
Introduced a Props interface for clearer prop handling and removed workaround comments. |
packages/svelte/src/lib/component/create-dropzone.svelte.ts |
Enhanced state management and refactored property handling in createDropzone . |
packages/svelte/src/lib/create-uploadthing.svelte.ts |
Updated createRouteConfig and useUploadThing functions for simpler state management and modified import paths. |
packages/svelte/src/lib/index.ts |
Updated export paths to include .svelte file extension. |
packages/svelte/src/lib/utils/createFetch.svelte.ts |
Introduced FetchResponse class for state management and updated createFetch function to return this new instance. |
tooling/eslint-config/package.json |
Updated eslint-plugin-svelte version from ^2.35.1 to ^2.46.0 . |
tooling/eslint-config/svelte.js |
Added svelteFeatures with experimentalGenerics to ESLint configuration for Svelte files. |
createUploadThing
function, ensuring consistency in usage and documentation.UploadButton
and UploadDropzone
components discussed in the main PR.effect/Redacted
type for enhancing security in handling sensitive data, relevant to the main PR.examples
, 📚 documentation
🐰 In the meadow, changes abound,
With UploadThing, new paths are found.
Documentation shines, examples are bright,
SvelteKit's journey takes flight!
Snippets and props, all in a row,
Hopping along, watch our features grow! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This updates the svelte package to make full use of the new v5 features.
Props
Component props use the
$props
rune. Makes them easier to type and manage compared to the bunch ofexport let
declarations.State
$state
and$derived
runes are used not only inside components but also in plain ts files, replacing stores in these cases.createDropzone
function is vastly simplified and it's now more in line with the other packagesCaveats*
$state
rune to avoid this, but I would say it's the same DX hit. This is a breaking change for people using thecreateUploadThing
function directly, I have added a note in the docs for this.Snippets
Components now accept (as props) snippets instead of named slots. Also a breaking change and I added a note in the docs for this as well.
Other changes include the syntax change for declaring event listeners and no workarounds needed any more to work with generics in svelte components.
Summary by CodeRabbit
New Features
UploadButton
andUploadDropzone
components.Bug Fixes
Chores