[PR #27130] fix: immer version and ref in code base #31685

Closed
opened 2026-02-21 20:49:56 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/27130

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

close #27128

This pull request updates how the immer library is imported across many files in the codebase. The change standardizes the import style from using a default import (import produce from 'immer') to a named import (import { produce } from 'immer'). This improves consistency and may help with compatibility with certain bundlers or future library updates.

Refactoring: Standardizing immer imports

Minor adjustment: Importing additional named exports

  • In web/app/components/app/configuration/debug/index.tsx, changed the import of both produce and setAutoFreeze to use named imports from immer.

No functional code was changed—this is purely an import style update for consistency and maintainability.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/27130 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary close #27128 This pull request updates how the `immer` library is imported across many files in the codebase. The change standardizes the import style from using a default import (`import produce from 'immer'`) to a named import (`import { produce } from 'immer'`). This improves consistency and may help with compatibility with certain bundlers or future library updates. **Refactoring: Standardizing `immer` imports** * Changed all instances of `import produce from 'immer'` to `import { produce } from 'immer'` in various files, including components related to app publishing, configuration (prompts, variables, vision, audio, document), chat hooks, and feature panels. [[1]](diffhunk://#diff-64be354beafbd54cc065e22643ea0ee6a2e8210d5d2b32dc34b1d8d20ae30463L3-R3) [[2]](diffhunk://#diff-f0f3d56fec719f7cb90a51c341bcf6891f6e1513d2e9d77bccc6545a2b391c55L8-R8) [[3]](diffhunk://#diff-cc265fe4ba479244ebc24200d07b5e696ff3435f8b3522e6420979e8c14ff828L5-R5) [[4]](diffhunk://#diff-a86c61b88c871ad120b6e92ac1ff479df26e24699919bab80ebf77b9bbbd9a2dL6-R6) [[5]](diffhunk://#diff-53ad744b36921bca72a943b1d2c0a3f25e9687147a1c9aa2b793ce237631099cL6-R6) [[6]](diffhunk://#diff-e78d64ae07f296a35d2835ebc2a839bbd55d76087b9bac104c60c84a94f46fd7L7-R7) [[7]](diffhunk://#diff-b135d101839f53c7d2da6c6f5a224483b717595835d070e29be0054ddfb9bfecL5-R5) [[8]](diffhunk://#diff-954bfada023dafdb65e83b71d21f94b2402684d8a75037769e5c92a2f554c098L5-R5) [[9]](diffhunk://#diff-ed838c7b6de760fd20c8789d61aa7fad4801436cde6a0684346ce522766f404aL7-R7) [[10]](diffhunk://#diff-dc816592cd7ae2924a30e32fa709e83926335e50039e3c5ae3a742ec4966480eL5-R5) [[11]](diffhunk://#diff-53d7d30a8c993029a1d211e879d1c88c06ba0aab8bc85aecd28e3c8012d01095L5-R5) [[12]](diffhunk://#diff-b95302ceb0629e85afdd55b205d3c05e971825969477408b261e823826ae876dL5-R5) [[13]](diffhunk://#diff-a794220421d553afefd370bd9b065266e72045914f5bb7489b388fa1d0274b29L7-R7) [[14]](diffhunk://#diff-ae22d377bda7f4465c29b2c734e377887e6ac9740acbc67ad2ef33901ec121d4L5-R5) [[15]](diffhunk://#diff-a689df9812aa3b68d0b037271ab5da41f984345987c7bd9bd81ae22d4da600e3L3-R3) [[16]](diffhunk://#diff-860201755406051d16c4be4d9158b628dae8f5d9e3ca54c1b30d3f97e842caaaL9-R9) [[17]](diffhunk://#diff-021d7b2c76d35cf28cf1561709d269efb16513940ecbe20220f08bf7a33e94c6L11-R11) [[18]](diffhunk://#diff-28543f9917cb44a1b032dda5b7039fc022d10680ba9f28cd7c85852a6a508eb3L11-R11) [[19]](diffhunk://#diff-cb33ea24eb6338889fcf44d89f9fa8c6edc2af0e075042148a1e8828a85a50a4L4-R4) [[20]](diffhunk://#diff-68ac419a1e0c9b71ca7f7dbd19b750433d20ae90e5934cd652918cd0ed68d278L2-R2) **Minor adjustment: Importing additional named exports** * In `web/app/components/app/configuration/debug/index.tsx`, changed the import of both `produce` and `setAutoFreeze` to use named imports from `immer`. No functional code was changed—this is purely an import style update for consistency and maintainability. ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:49:56 -05:00
yindo closed this issue 2026-02-21 20:49:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31685