Skip to content

chore: update vinext, add workaround - #32878

Merged
hyoban merged 5 commits into
mainfrom
3-3-vinext-workaround
Mar 3, 2026
Merged

hyoban merged 5 commits into
mainfrom
3-3-vinext-workaround

Conversation

@hyoban

@hyoban hyoban commented Mar 3, 2026 •

Copy link
Copy Markdown
Member

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

Follow #32559

  • Include "react/jsx-runtime", "react/jsx-dev-runtime" in optimizeDeps
  • Workaround for HydrationBoundary
  • Fix react scan init

Screenshots

Before After
... ...

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 make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings March 3, 2026 02:48
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 3, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Mar 3, 2026
@dosubot dosubot Bot added the dependencies Pull requests that update a dependency file label Mar 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on updating a key dependency and refining a development tool integration. The vinext package has been upgraded, and a specific workaround was introduced to mitigate hydration boundary issues it might present. Concurrently, the react-scan development utility's loading mechanism was simplified, transitioning from a lazy-loaded React component to a more direct script inclusion, which streamlines its setup and reduces component overhead.

Highlights

  • Dependency Update: The vinext dependency has been updated to a newer version, specifically from @e283197 to @cfae669.
  • ReactScan Integration Refactor: The ReactScanLoader component was refactored to directly load the react-scan script using next/script, removing the previous lazy-loaded component and Suspense wrapper.
  • Hydration Workaround: A workaround was implemented in HydrateQueryClient to address potential issues with vinext's handling of hydration boundaries, ensuring proper rendering when dehydratedState is null.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/app/components/devtools/react-scan/loader.tsx
    • Changed ReactScanLoader to import Script from next/script.
    • Removed the lazy loading mechanism for the ReactScan component.
    • Replaced the Suspense and ReactScan components with a direct Script tag loading react-scan/dist/auto.global.js.
  • web/app/components/devtools/react-scan/scan.tsx
    • Removed the entire ReactScan component file, as its functionality is now handled by the direct script import.
  • web/app/components/plugins/marketplace/hydration-server.tsx
    • Added a conditional check to return children directly if dehydratedState is null, serving as a workaround for vinext hydration boundary issues.
  • web/package.json
    • Updated the vinext dependency's version URL from e283197 to cfae669.
  • web/pnpm-lock.yaml
    • Updated the vinext dependency's resolution and tarball URL.
    • Added new entries for vite-plugin-commonjs and vite-plugin-dynamic-import with their respective resolutions and dependencies.
Activity
  • The author confirmed understanding that the PR might be closed if there was no previous discussion or associated issues.
  • The author stated that tests were added for each introduced change, aiming for atomic modifications.
  • The author confirmed that documentation was updated accordingly.
  • The author verified that make lint, make type-check (backend), and npx lint-staged (frontend) commands were run.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the vinext dependency and introduces a couple of workarounds. The react-scan developer tool is now loaded from a CDN via next/script instead of being bundled locally. Additionally, a defensive check has been added to HydrateQueryClient to handle cases where there's no dehydrated state, which improves robustness. My feedback includes a minor suggestion to improve the security and reliability of the CDN link for react-scan.

Note: Security Review did not run due to the size of the PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the web build/dev tooling around Vinext and introduces small workarounds to keep the app functioning under the updated Vinext behavior.

Changes:

  • Bump vinext to a newer commit in web/package.json and web/pnpm-lock.yaml (new transitive deps added).
  • Add a guard to skip HydrationBoundary when there’s no dehydrated state (Vinext workaround).
  • Replace the dev-only react-scan lazy-loaded component with a next/script loader that pulls react-scan from a CDN.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/pnpm-lock.yaml Updates lockfile for the new Vinext commit and adds new transitive dependencies.
web/package.json Bumps the Vinext dependency URL to the new commit.
web/app/components/plugins/marketplace/hydration-server.tsx Skips HydrationBoundary when no dehydrated state is produced (workaround).
web/app/components/devtools/react-scan/scan.tsx Removes the local React component integration for react-scan.
web/app/components/devtools/react-scan/loader.tsx Switches to loading react-scan via next/script in dev mode.
Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

web/app/components/plugins/marketplace/hydration-server.tsx:41

  • Grammar nit in the TODO: "vinext do not handle hydration boundary well" should be "vinext does not handle … well" (and consider capitalizing HydrationBoundary since it’s a component).
  // TODO: vinext do not handle hydration boundary well for now.
  if (!dehydratedState) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 3, 2026 02:55
lyzno1
lyzno1 previously approved these changes Mar 3, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

web/app/components/plugins/marketplace/hydration-server.tsx:42

  • The TODO comment has a grammar issue and no tracking reference. Consider changing it to “vinext does not handle HydrationBoundary well …” and include a link to the relevant vinext issue/PR so it’s clear when this guard can be removed.
  // TODO: vinext do not handle hydration boundary well for now.
  if (!dehydratedState) {
    return <>{children}</>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/package.json Resolved
@hyoban
hyoban merged commit d6ab36f into main Mar 3, 2026
21 checks passed
@hyoban
hyoban deleted the 3-3-vinext-workaround branch March 3, 2026 03:21
Ssazurov pushed a commit to Ssazurov/dify that referenced this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants