#42438·dify

[Refactor/Chore] Align nuqs peer resolution to avoid duplicate browser runtime modules

Author: hyobanCreated Sep 17, 2026Updated Sep 17, 2026
Labelsproject#dify

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is a refactor/chore rather than a support question.
  • I have searched existing issues, including closed ones.
  • I confirm that I am using English to submit this report.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • I have filled in the required template fields.

Description

Align workspace peer dependency resolution so the browser build includes one nuqs 2.10.1 instance. In a local Dify build, packages/nuqs-jotai/node_modules/nuqs resolves to the Next 16.3.4 peer context, while web/node_modules/nuqs resolves to Next 16.3.5. Both copies appear in Rolldown's client package graph, contributing 25,545 and 39,411 bytes respectively.

Reproduction:

  1. Install dependencies from the affected lockfile and build the Vinext browser target.
  2. Compare the two nuqs symlink targets / lockfile importer entries.
  3. Inspect the client package graph and find two nuqs 2.10.1 package roots with distinct Next peer contexts.

Motivation

This duplicates runtime code. This is not a confirmed URL-state bug: this nuqs release shares adapter context, throttle queue, debounce controller and sync emitter through global singletons keyed by version (and React identity for the context).

Acceptance criteria:

  • Align workspace peer resolution and regenerate the lockfile using the project's package manager.
  • Verify only one nuqs instance contributes browser runtime modules.
  • Preserve adapter behavior and nuqs-jotai URL update/queue semantics.
  • Measure rebuilt output; the package contribution numbers above are not guaranteed savings or production transferred bytes.

Additional Context

Observed on a local Dify 1.17.1 development branch based on 06e473015a9a1abb71da88ac0a0e92d96a992008, with local DevTools integration patches; Vinext 1.0.0-beta.10, Vite+ core 0.3.2, Node 24.21.0. This report describes that branch/lockfile state and should be rechecked against current main before making changes. Related URL-state consolidation: #30180.