-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: Upgrade packages #40935
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: Upgrade packages #40935
Conversation
WalkthroughThe updates modernize the development environment and codebase by upgrading dependencies, especially Changes
Sequence Diagram(s)sequenceDiagram
participant DevServer as WebpackDevServer
participant Middleware as MiddlewareStack
participant UserProxy as UserProxySetup
participant Utils as MiddlewareUtils
DevServer->>Utils: getHttpsConfig()
Utils-->>DevServer: HTTPS config object or boolean
DevServer->>Middleware: setupMiddlewares(middlewares, devServer)
Middleware->>Middleware: prepend evalSourceMapMiddleware
Middleware->>UserProxy: require user proxy setup if present
Middleware->>Middleware: append redirectServedPath, noopServiceWorkerMiddleware
Middleware-->>DevServer: return updated middlewares
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (11)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
♻️ Duplicate comments (2)
app/client/packages/storybook/package.json (1)
35-36
: Validate Vite 6 pinSee comment in root
package.json
; same potential resolution failure applies here.app/client/scripts/start.js (1)
141-146
: Duplicate shutdown handler – same caveatReplicate the error-aware pattern for
stdin
end handling to keep behaviour consistent.
🧹 Nitpick comments (10)
app/client/src/usagePulse/utils.ts (1)
75-76
: Minor nit – avoid regenerating fallback id every reload
nanoid()
is called only if no localStorage key exists, but we still allocate the generator each evaluation. Tiny, yet you can micro-optimise with a constant:- fallback = nanoid(); + fallback = nanoid(); // consider hoisting to a util if this growsapp/client/config/webpackDevServer.config.js (1)
116-133
: Middleware migration accurate – double-verify orderOrder preservation via
unshift
/push
mirrors v4 behaviour. Make sure any custom middleware added inpaths.proxySetup
doesn’t rely on the now-removeddevServer.app.use
chain.app/client/scripts/start.js (2)
1-1
:"use strict"
is redundant in ES modulesNode treats files executed via
import/require
as ES-modules/strict mode by default; keeping the directive adds noise only.-"use strict"; +// File is already executed in strict-mode – directive removed🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
134-138
:devServer.stop()
result is ignored & process exits unconditionally
stop()
returns a Promise that can reject. Exiting immediately masks shutdown errors and may leave orphaned child-processes.-devServer.stop().then(() => process.exit()); +devServer + .stop() + .then(() => process.exit(0)) + .catch((e) => { + console.error(chalk.red("Dev-server shutdown failed:"), e); + process.exit(1); + });app/client/src/widgets/WidgetUtils.ts (2)
24-25
: Generator recreated on every call
customAlphabet(ALPHANUMERIC, 10)
is executed each timegenerateReactKey
runs, doing extra crypto-setup work. Cache the generator once.-import { customAlphabet } from "nanoid"; +import { customAlphabet } from "nanoid"; + +const nanoId10 = customAlphabet(ALPHANUMERIC, 10);
115-121
: Reuse cached generator for better perf & readabilitySame optimisation applied in import diff; implementation becomes:
-export const generateReactKey = ({ - prefix = "", -}: { prefix?: string } = {}): string => { - return prefix + customAlphabet(ALPHANUMERIC, 10)(); -}; +export const generateReactKey = ({ prefix = "" } = {}): string => + prefix + nanoId10();app/client/src/utils/generators.tsx (2)
2-3
: Mirror the cached-generator optimisationApply the same cached generator pattern here to avoid duplicating heavy crypto setup.
-import { customAlphabet } from "nanoid"; +import { customAlphabet } from "nanoid"; + +const nanoId10 = customAlphabet(ALPHANUMERIC, 10);
8-12
: Use cached generator-return prefix + customAlphabet(ALPHANUMERIC, 10)(); +return prefix + nanoId10();app/client/packages/dsl/src/migrate/utils.ts (2)
2-3
: Same nanoid initialisation duplicatedConsider moving the cached generator to a shared util to avoid three identical constants across the codebase.
11-15
: Apply cached generator-return prefix + customAlphabet(ALPHANUMERIC, 10)(); +const nanoId10 = customAlphabet(ALPHANUMERIC, 10); +return prefix + nanoId10();
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
app/client/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (9)
app/client/config/webpackDevServer.config.js
(2 hunks)app/client/package.json
(3 hunks)app/client/packages/dsl/src/migrate/utils.ts
(2 hunks)app/client/packages/storybook/package.json
(1 hunks)app/client/scripts/start.js
(4 hunks)app/client/src/instrumentation/utils.ts
(1 hunks)app/client/src/usagePulse/utils.ts
(2 hunks)app/client/src/utils/generators.tsx
(2 hunks)app/client/src/widgets/WidgetUtils.ts
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/client/config/webpackDevServer.config.js (1)
app/client/scripts/start.js (5)
devServer
(115-115)fs
(17-17)paths
(31-31)require
(23-28)require
(69-69)
🪛 Biome (1.9.4)
app/client/scripts/start.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
🔇 Additional comments (6)
app/client/package.json (3)
160-160
: nanoid upgrade looks goodSwitching to
nanoid@3.3.11
is the correct move given the import updates elsewhere, and there are no API-level breaking changes between 3.3.x patch releases.
394-395
:✅ Verification successful
Confirm webpack-dev-server v5 side-effects
webpack-dev-server@5.2.2
introduces breaking changes around the dev-middleware API (now adopted inwebpackDevServer.config.js
). Verify that thescripts/start.js
logic that spawns the server doesn’t rely on any removed v4 fields (e.g.devServer.options
).Run to grep for now-removed API usages:
🏁 Script executed:
#!/usr/bin/env bash rg -n '"devServer\.' -g 'app/client/**/*.js' | headLength of output: 53
🏁 Script executed:
#!/usr/bin/env bash set -e echo "1) Searching for any use of devServer.options across the repo" rg -n 'devServer\.options' . echo echo "2) Searching for any devServer property access in JS/TS files" rg -n 'devServer\.' -g '*.{js,ts}' echo echo "3) Locating webpackDevServer.config.js in the repo" fd webpackDevServer.config.js || echo ">> No webpackDevServer.config.js found"Length of output: 172
🏁 Script executed:
#!/usr/bin/env bash set -e echo "Locating all start.js files:" files=$(fd -HI start.js) if [ -z "$files" ]; then echo ">> No start.js files found" exit 0 fi for f in $files; do echo echo "## Inspecting $f" echo "- Checking for devServer API usage" rg -n 'devServer\.' "$f" || echo " → No devServer references" echo "- Checking for spawn calls (webpack-dev-server startup)" rg -n 'spawn' "$f" || echo " → No spawn references" doneLength of output: 793
No legacy devServer API usage found in scripts/start.js
All checks confirm that we don’t rely on any removed v4 fields:
devServer.options
is not referenced anywhere in the repo.- In
app/client/scripts/start.js
, onlydevServer.startCallback(...)
anddevServer.stop()
are used—both supported in v5.- There are no spawn-based invocations of the old CLI.
No further changes required.
427-428
:✅ Verification successful
Possible non-existent versions – double-check
esbuild
&vite
pins
esbuild
is pinned to^0.25.1
and Storybook bumpsvite
to^6.2.7
. Those versions do not exist on the public npm registry at the time of writing (latest esbuild ≈ 0.21.x, vite ≈ 5.x). Yarn will fail to resolve them, blocking CI.
🏁 Script executed:
#!/usr/bin/env bash # Sanity-check that the requested versions are published. for pkg in esbuild@0.25.1 vite@6.2.7; do if npm view "$pkg" version >/dev/null 2>&1; then echo "✅ $pkg exists" else echo "❌ $pkg NOT FOUND" fi doneLength of output: 247
All pinned versions are valid
Quick sanity check confirms that both esbuild@0.25.1 and vite@6.2.7 are published on npm, so CI resolution won’t be blocked.
app/client/src/instrumentation/utils.ts (1)
8-14
: Tiny import tweak LGTMSwitching to named import
{ nanoid }
matches the v3 ESM build – no functional impact.app/client/src/usagePulse/utils.ts (1)
4-5
: Consistent nanoid import – all goodImport style now aligns with package upgrade; nothing else to flag.
app/client/config/webpackDevServer.config.js (1)
92-106
:server
option mapping is correctElegant IIFE gets the job done; matches WDS v5 contract for
"http" | "https" | {type,options}"
. Good catch on forwarding custom cert options.
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15632907059. |
Deploy-Preview-URL: https://ce-40935.dp.appsmith.com |
Description
nanoid
brace-expansion
webpack-dev-server
path-to-regexp
vite
http-proxy-middleware
Fixes the following issues
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15630439422
Commit: 2b6f4a4
Cypress dashboard.
Tags:
@tag.All
Spec:
Fri, 13 Jun 2025 10:49:32 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Style