Skip to content
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

chore: bump effect deps #1095

Merged
merged 4 commits into from
Dec 12, 2024
Merged

chore: bump effect deps #1095

merged 4 commits into from
Dec 12, 2024

Conversation

juliusmarminge
Copy link
Collaborator

@juliusmarminge juliusmarminge commented Dec 12, 2024

fixes https://discord.com/channels/966627436387266600/1316504654225477662

Summary by CodeRabbit

  • Chores

    • Updated dependencies for "uploadthing" and "@uploadthing/shared".
    • Bumped internal effect dependencies.
    • Updated dependency versions in multiple package.json files to improve compatibility.
  • Bug Fixes

    • Enhanced error handling and control flow in upload functions for improved consistency and clarity.

Copy link

vercel bot commented Dec 12, 2024

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 Dec 12, 2024 11:47am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Dec 12, 2024 11:47am

Copy link

changeset-bot bot commented Dec 12, 2024

🦋 Changeset detected

Latest commit: fdb8a6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
uploadthing Patch
@uploadthing/shared Patch
@uploadthing/expo Patch
@uploadthing/nuxt Patch
@uploadthing/react Patch
@uploadthing/solid Patch
@uploadthing/svelte Patch
@uploadthing/vue Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Walkthrough

This pull request introduces updates to several package dependencies, specifically for "uploadthing", "@uploadthing/shared", and various versions of the effect and @effect/platform packages. The modifications primarily involve version increments in the package.json files across multiple projects, along with changes to error handling logic in the client.ts file of the uploadthing package. These adjustments are focused on dependency management and error handling without altering core functionalities.

Changes

File Change Summary
.changeset/early-bananas-exist.md Patched dependencies: "uploadthing" and "@uploadthing/shared".
examples/backend-adapters/server/package.json Updated dependencies: @effect/platform from 0.69.24 to 0.70.7, @effect/platform-node from 0.64.26 to 0.65.7, effect from 3.10.15 to 3.11.5.
packages/shared/package.json Updated dependency: effect from 3.10.15 to 3.11.5; modified exports for types.
packages/uploadthing/package.json Updated version to 7.4.0; updated dependencies: @effect/platform from 0.69.24 to 0.70.7, effect from 3.10.15 to 3.11.5.
packages/uploadthing/src/client.ts Modified error handling in controllableUpload and typedUploadFiles functions.
playground-v6/package.json Updated dependency: effect from 3.10.15 to 3.11.5.
playground/package.json Updated dependency: effect from 3.10.15 to 3.11.5.

Possibly related PRs

  • chore: update effect/platform past API changes #1005: This PR updates the dependencies related to effect, which is also mentioned in the main PR as a patched dependency.
  • chore: bump internal effect pacakge #1009: Similar to the main PR, this PR updates the version of the effect dependency, indicating a direct relationship in terms of dependency management.
  • chore: bump eff #1015: This PR also updates the @effect/platform dependency, which aligns with the dependency updates in the main PR.
  • chore: bump effect #1030: This PR updates the effect dependency version, which is relevant to the changes made in the main PR regarding dependency management.
  • fix: nuxt module options #1056: This PR includes patches for both uploadthing and @uploadthing/shared, which are directly related to the dependencies mentioned in the main PR.
  • feat: support more input parsers #1061: This PR adds support for new input parsers, which may involve changes to the handling of dependencies, including effect, thus relating it to the dependency management focus of the main PR.

Suggested labels

sdk, examples

Suggested reviewers

  • markflorkowski

🐇 In the garden where updates bloom,
Dependencies rise, dispelling gloom.
With versions fresh, we hop and play,
In code's embrace, we find our way.
So let’s rejoice, with joy we sing,
For every patch, a brighter spring! 🌼


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the sdk label Dec 12, 2024
Copy link

pkg-pr-new bot commented Dec 12, 2024

Open in Stackblitz

More templates

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/shared@1095
npm i https://pkg.pr.new/pingdotgg/uploadthing@1095

commit: fdb8a6e

Copy link
Contributor

github-actions bot commented Dec 12, 2024

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 27.60KB See Treemap 📊
PR (68d6e15) 29.30KB See Treemap 📊
Diff ↑1.71KB

@juliusmarminge juliusmarminge changed the title add devtools debugger chore: bump effect deps Dec 12, 2024
@juliusmarminge juliusmarminge added the release canary Trigger a canary release to npm label Dec 12, 2024
Copy link
Contributor

A new canary is available for testing. You can install this latest build in your project with:

pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]
pnpm add @uploadthing/[email protected]

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Dec 12, 2024
@juliusmarminge juliusmarminge marked this pull request as ready for review December 12, 2024 11:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
packages/uploadthing/src/client.ts (2)

270-275: Consider documenting the Effect upgrade impact

The error handling changes are part of a broader Effect library upgrade. Consider adding a note in the changelog about this breaking change in error handling patterns for consumers who might be directly handling these errors.


Test coverage needed for pause/resume and error handling

The verification process reveals that there are no dedicated test cases for the pause/resume functionality and the associated error handling (UploadPausedError and UploadAbortedError). This is concerning given that:

  1. The code implements critical pause/resume functionality with error handling
  2. These features are exposed through public API methods (pauseUpload, resumeUpload)
  3. The error states are used across multiple framework integrations (React, Vue, Svelte, Solid)

Please add test cases to cover:

  • Pausing and resuming uploads
  • Error handling for interrupted uploads
  • Abort scenarios
  • Multiple file upload pause/resume states
🔗 Analysis chain

Line range hint 156-275: Verify test coverage for error handling scenarios

While the changes look correct, it's important to ensure that all error handling scenarios are covered in the test suite, particularly:

  1. Success cases with the new Success tag
  2. Error cases with the new Cause tag
  3. Interrupt handling for upload pausing
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Look for test files covering these scenarios
echo "Checking for relevant test coverage..."
fd -e test.ts -e spec.ts | xargs rg -l "uploadEffect|typedUploadFiles"

Length of output: 159


Script:

#!/bin/bash
# Let's try a broader search for test files and patterns
echo "Looking for test files in the repository..."
fd -e test.ts -e spec.ts

echo -e "\nSearching for upload-related tests with broader patterns..."
rg -l "upload.*test|test.*upload" --type ts

echo -e "\nSearching for specific test cases..."
rg -C 3 "pauseUpload|resumeUpload|UploadPausedError|UploadAbortedError" --type ts

Length of output: 23141


Script:

#!/bin/bash
# Let's check the test coverage for these specific error scenarios
echo "Checking test coverage for error handling..."
rg -C 5 "UploadPausedError|UploadAbortedError" packages/uploadthing/test/

echo -e "\nChecking test cases for pause/resume functionality..."
rg -C 5 "pauseUpload|resumeUpload" packages/uploadthing/test/

Length of output: 361

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4112a7f and fdb8a6e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .changeset/early-bananas-exist.md (1 hunks)
  • examples/backend-adapters/server/package.json (1 hunks)
  • packages/shared/package.json (1 hunks)
  • packages/uploadthing/package.json (1 hunks)
  • packages/uploadthing/src/client.ts (3 hunks)
  • playground-v6/package.json (1 hunks)
  • playground/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • playground/package.json
  • .changeset/early-bananas-exist.md
  • playground-v6/package.json
  • examples/backend-adapters/server/package.json
🔇 Additional comments (5)
packages/shared/package.json (1)

39-39: Verify effect upgrade compatibility

The upgrade from [email protected] to [email protected] is a minor version bump. Let's verify the changes and potential impacts.

✅ Verification successful

Based on the results, I can generate the final response as we have sufficient information. The changelog shows that version 3.11.5 contains only patch changes focused on JSONSchema improvements, internal refactoring, and bug fixes. Additionally, the search results show that all packages in the monorepo using effect are already aligned to version 3.11.5.

Effect upgrade is safe to proceed

The upgrade from [email protected] to [email protected] contains only non-breaking changes:

  • JSONSchema improvements and bug fixes
  • Internal refactoring changes
  • All other packages in the monorepo are already using the same version
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the changelog between versions and any potential breaking changes

# Get the changelog for effect package between versions
gh api repos/Effect-TS/effect/releases | jq -r '.[] | select(.tag_name | contains("3.11.")) | .body'

# Check if there are any other packages in the monorepo using effect
rg '"effect":\s*"[^"]*"' --type json

Length of output: 10728

packages/uploadthing/package.json (2)

154-158: Verify compatibility between effect packages

The PR updates both @effect/platform (0.69.24 -> 0.70.7) and effect (3.10.15 -> 3.11.5). Let's verify their compatibility and potential impacts.

✅ Verification successful

Based on the search results, I can verify the compatibility between the effect packages. The pnpm-lock.yaml shows that @effect/[email protected] is correctly paired with [email protected] as a peer dependency, and this combination is being used consistently across the project. Additionally, the codebase shows active usage of these packages in multiple files with proper imports.

The version update is safe and compatible

  • The packages are correctly paired in the lockfile with @effect/[email protected] using [email protected] as its peer dependency
  • The codebase shows proper usage of these packages in multiple files like packages/uploadthing/src/sdk/utils.ts, packages/uploadthing/src/internal/upload.server.ts, etc.
  • The version bump follows semantic versioning (minor version updates)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check compatibility between effect packages and their changelogs

# Get the changelog for @effect/platform package
gh api repos/Effect-TS/platform/releases | jq -r '.[] | select(.tag_name | contains("0.70.")) | .body'

# Check if these versions are commonly used together in other projects
gh api graphql -f query='
query {
  search(query: "\"@effect/platform\": \"0.70.7\" \"effect\": \"3.11.5\"", type: CODE, first: 5) {
    nodes {
      ... on CodeResult {
        repository {
          nameWithOwner
        }
        file {
          path
        }
      }
    }
  }
}'

Length of output: 1058


Script:

#!/bin/bash
# Let's try a different approach to check compatibility

# Check if there are any imports or usage of @effect/platform in the codebase
rg "@effect/platform" -A 2 -B 2

# Check for any effect-related imports to understand usage patterns
rg "from ['\"](effect|@effect)" -A 2 -B 2

# Look for any migration guides or documentation
fd -t f "README|CHANGELOG|MIGRATION" -X cat {}

Length of output: 79928


154-158: Request context for the dependency updates

The dependency updates look consistent across packages:

However, the PR description references a Discord issue without providing context about the specific problem being addressed. Could you please provide more details about the issue that these version bumps are fixing?

✅ Verification successful

Effect dependency updates appear to be safe and consistent

The dependency updates are well-aligned with the codebase usage:

  • The effect package is extensively used throughout the codebase with numerous imports from various modules
  • @effect/platform is used in key server and client components for HTTP operations
  • Both packages are updated in lockstep ([email protected] and @effect/[email protected]), maintaining version compatibility

The version bumps appear to be minor updates that shouldn't introduce breaking changes. No immediate issues or inconsistencies are found in the usage patterns that would be affected by these updates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any related changes in the codebase that might be affected by these updates

# Look for effect-related imports that might need updates
rg "from ['\"]effect/" --type typescript

# Look for @effect/platform imports
rg "from ['\"]@effect/platform" --type typescript

Length of output: 168


Script:

#!/bin/bash
# Let's try without the typescript file type flag since it's not recognized
# Look for effect-related imports
rg "from ['\"]effect/"

# Look for @effect/platform imports
rg "from ['\"]@effect/platform"

# Also check for direct requires
rg "require\(['\"]effect"
rg "require\(['\"]@effect/platform"

Length of output: 9427

packages/uploadthing/src/client.ts (2)

203-208: LGTM! Consistent error handling pattern

The error handling changes in resumeUpload follow the same pattern as the parent function, maintaining consistency in the Effect error handling approach.


156-161: Verify consistent usage of new Effect error handling patterns

The change from Right/Left to Success/Cause aligns with the Effect library upgrade. Let's ensure this pattern is consistently applied across all Effect-based operations in the codebase.

✅ Verification successful

Effect error handling patterns have been consistently updated

The codebase shows consistent usage of the new Success/Cause pattern in packages/uploadthing/src/client.ts. While Either type definitions still exist in type files (packages/shared/src/types.ts and packages/uploadthing/src/sdk/types.ts), there are no remaining instances of the old Right/Left pattern in the actual implementation code. This confirms that the Effect library upgrade changes have been properly applied across all relevant code paths.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of the old Effect error handling pattern
# that might have been missed during the upgrade

echo "Checking for old Right/Left pattern usage..."
rg --type typescript '_tag === "(Right|Left)"' 

echo "Checking for new Success/Cause pattern usage..."
rg --type typescript '_tag === "(Success|Cause)"'

Length of output: 374


Script:

#!/bin/bash
# Search for any remaining instances of the old Effect error handling pattern
# that might have been missed during the upgrade

echo "Checking for old Right/Left pattern usage..."
rg '_tag === "(Right|Left)"' 

echo "Checking for new Success/Cause pattern usage..."
rg '_tag === "(Success|Cause)"'

# Also check for imports or uses of Either type which might indicate old pattern
echo "Checking for Either type usage..."
rg "Either[<,]" 

Length of output: 785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant