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

fix: automatic dev mode detection #1106

Merged
merged 3 commits into from
Dec 30, 2024
Merged

Conversation

juliusmarminge
Copy link
Collaborator

@juliusmarminge juliusmarminge commented Dec 30, 2024

this bug is so cursed...

NODE_ENV is set when the docs are built on Vercel, which causes the packages to be built with this variable defined.

and then when we go and publish pacakges we're pickign up that cached build and getting the process.env.NODE_ENV statically replaced...

tried fixing this by omitting the variable from the turbo process in #1105 but that was pure pain..

fix by patching bunchee to not append NODE_ENV to the @rollup/plugin-replace plugin

Summary by CodeRabbit

  • Chores

    • Added a patch for bunchee@6.1.2 to resolve dependency configuration
    • Updated formatting for patched dependencies in project configuration
  • Bug Fixes

    • Improved automatic detection of development mode for the uploadthing module

Copy link

vercel bot commented Dec 30, 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 30, 2024 0:17am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Dec 30, 2024 0:17am

Copy link

changeset-bot bot commented Dec 30, 2024

🦋 Changeset detected

Latest commit: 64ddb63

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

This PR includes changesets to release 1 package
Name Type
uploadthing 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 30, 2024

Walkthrough

This pull request involves modifications to the package.json file in the "uploadthing-turbo" project. A new patched dependency for bunchee@6.1.2 has been added to the pnpm.patchedDependencies section, with a corresponding patch file created at patches/bunchee@6.1.2.patch. The patch file contains commented-out code in the dist/index.js file, specifically targeting conditional checks related to the NODE_ENV variable within the getDefinedInlineVariables function. Additionally, a minor formatting change was made to an existing entry in package.json.

Changes

File Change Summary
package.json - Added "bunchee@6.1.2": "patches/bunchee@6.1.2.patch" to pnpm.patchedDependencies
- Reformatted existing @mswjs/interceptors@0.26.15 patch line
patches/bunchee@6.1.2.patch - Commented out conditional checks for NODE_ENV in getDefinedInlineVariables function
- Preserved logic for 'edge-light' export condition
.changeset/tame-stingrays-brush.md - Introduced a patch to fix automatic detection of development mode in the uploadthing module

Possibly related PRs

  • fix: @uploadthing/mime-types exports not supported in Expo #1013: This PR introduces a patch for the @uploadthing/mime-types package, which is relevant as it involves updates to the package management and dependencies, similar to the changes made in the main PR regarding package.json.
  • fix: nuxt module tailwind support #1033: This PR addresses compatibility issues with the Nuxt module and Tailwind CSS, which may relate to the dependency management aspect of the main PR, particularly in how patched dependencies are handled.
  • chore(release): 📦 version packages #1041: This PR includes updates to the @uploadthing/nuxt and uploadthing packages, which are directly related to the changes in the main PR regarding dependency management in package.json.
  • fix: nuxt module options #1056: This PR focuses on enhancing the Nuxt module options, which may connect to the overall dependency management and configuration updates reflected in the main PR.
  • feat: support browser runtime for tw plugin #1072: This PR introduces support for a browser runtime for the Tailwind plugin, which relates to the dependency management and configuration aspects of the main PR.
  • chore: fix peer dep ranges #1103: This PR addresses peer dependency ranges across multiple packages, which is relevant to the changes in the main PR regarding the management of dependencies in package.json.

Suggested labels

@uploadthing/react

Suggested reviewers

  • markflorkowski

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a1d43c and 64ddb63.

📒 Files selected for processing (1)
  • .changeset/tame-stingrays-brush.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/tame-stingrays-brush.md

🪧 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. (Beta)
  • @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.

@juliusmarminge juliusmarminge changed the title don't inject NODE_ENV to rollup replace plugin fix: automatic dev mode detection Dec 30, 2024
Copy link
Contributor

github-actions bot commented Dec 30, 2024

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 29.30KB See Treemap 📊
PR (9c50448) 29.30KB See Treemap 📊
Diff No change

Copy link
Contributor

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

pnpm add @uploadthing/expo@7.1.5-canary.8479c92
pnpm add @uploadthing/mime-types@0.3.4-canary.8479c92
pnpm add @uploadthing/nuxt@7.1.5-canary.8479c92
pnpm add @uploadthing/react@7.1.5-canary.8479c92
pnpm add @uploadthing/shared@7.1.5-canary.8479c92
pnpm add @uploadthing/solid@7.1.5-canary.8479c92
pnpm add @uploadthing/svelte@7.1.5-canary.8479c92
pnpm add uploadthing@7.4.3-canary.8479c92
pnpm add @uploadthing/vue@7.1.5-canary.8479c92

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Dec 30, 2024
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