| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
update webpack configs
Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
✅ Deploy Preview for devspace-docs canceled.
|
Sorry, something went wrong.
Adversarial (claude) Review — PR #3230 "UI dep updates and migrations"OverviewThree concurrent migrations in one PR: React Router v5→v6, Sass @import→@use, and Webpack 4→5 cleanup. The SCSS and router-hook migrations are mechanically correct. The webpack changes contain a meaningful production regression that needs fixing before merge. HIGH — Production CSS extraction is brokenFile: ui/config/webpack.config.prod.js ExtractTextPlugin was removed (it doesn't work with webpack 5 — correct), but nothing replaced it. The prod config now uses style-loader for CSS, same as dev. This means:
The comment in the code literally documents the intent: // isDevelopment ? 'style-loader' : MiniCssExtractPlugin.loader,...but MiniCssExtractPlugin was never wired up. mini-css-extract-plugin is the webpack 5 replacement for ExtractTextPlugin and ships with webpack 5 installations. The prod config should use it. HIGH — --legacy-peer-deps without documented root causeFile: hack/build-ui.bash npm install --legacy-peer-deps && npm run buildThe commit message says "npm install with legacy deps for now" — the "for now" is load-bearing. --legacy-peer-deps silences peer dependency conflicts rather than resolving them. If two packages have genuinely incompatible requirements, they may both be installed, with unpredictable runtime behavior. The actual conflicting pairs should be identified and resolved (or explicitly pinned with a justification). As shipped, this is an untimed deferral. HIGH — inquirer v7→v13 in dist/npm/package.json may break the npm packageFile: dist/npm/package.json - "inquirer": "^7.0.5",
+ "inquirer": "^13.3.2",Inquirer became ESM-only starting at v9. If the DevSpace CLI npm package is distributed as CommonJS (which is typical for a CLI), require('inquirer') will throw an ERR_REQUIRE_ESM error at runtime in Node.js ≤ 21 without --experimental-require-module. This is a silent breaking change for users installing the npm package. Either stay on v8 (last CJS-compatible) or verify the package's module format and Node.js version requirements. MEDIUM — Service worker silently removed from production buildFile: ui/config/webpack.config.prod.js SWPrecacheWebpackPlugin and the service-worker.js generation are gone with no mention in the PR description. If the app was using this for offline capability or precaching (common for SPAs embedded in a CLI tool), this is a regression. Even if the service worker wasn't actively used, removing it without calling it out risks surprising consumers of the embedded UI. MEDIUM — configToYAML type regressionFile: ui/src/lib/utils.tsx // Old
export const configToYAML = (config: Config, reverse?: boolean) => {
// New
export const configToYAML = (config: object, reverse?: boolean) => {object accepts anything including functions and class instances, which js-yaml would serialize incorrectly. At minimum use Record<string, unknown>. If the callers always pass a plain Config-shaped object, keep the import or define a local structural type. Dropping to object loses all the benefit of TypeScript here. LOW — CustomNavLink active state can diverge from NavLink's aria-currentFile: ui/src/components/basic/CustomNavLink/CustomNavLink.tsx const isActive = targetPath ? currentPath.startsWith(targetPath) : currentPath === targetPath;
const classNames = [className, isActive ? activeClassName : undefined].filter(Boolean).join(' ');
return <NavLink {...props} className={classNames} to={to} />;NavLink in v6 adds aria-current="page" based on its own internal path matching (exact match by default, or controlled by the end prop). Our isActive uses startsWith. These two checks can diverge:
In practice, the current app's nav links go to full paths like /logs/containers, not parent segments like /logs, so this shouldn't fire. But the mismatch between visual active state (our CSS) and semantic active state (aria-current) is fragile as routes are added. LOW — CustomNavLink dead fallback branchFile: ui/src/components/basic/CustomNavLink/CustomNavLink.tsx const isActive = targetPath ? currentPath.startsWith(targetPath) : currentPath === targetPath;When targetPath is empty string (falsy), the fallback is currentPath === targetPath, i.e. currentPath === "". currentPath is the result of formatURL(location.pathname), which on any real page won't be empty, so this branch is dead. The correct fallback for an empty to would arguably be false. Minor, but the logic is surprising. CORRECT — these changes look good
Summary
The blockers before merge: the production CSS extraction gap (no MiniCssExtractPlugin), the unresolved peer dep conflict hidden behind --legacy-peer-deps, and the inquirer ESM compatibility risk in the npm package. The rest can be addressed as follow-ups. |
Sorry, something went wrong.
- replace webpack 4-only production plugins with webpack 5 equivalents - restore extracted CSS, asset-manifest generation, and service-worker output - remove the legacy peer dependency install workaround from the UI build script - align ui package dependencies and regenerate the lockfile to install cleanly - replace the outdated ts-jest preprocessor shim with a local TypeScript Jest transform - revert dist/npm inquirer and find-process to CommonJS-safe versions - tighten configToYAML typing and align CustomNavLink active state with NavLink semantics - fix TerminalCache typing so the UI build passes lint and type checks
Claude's follow up reviewHere's the round 2 verdict: All three previous HIGH blockers are resolved. The latest commit (b9fdade) correctly addresses every
One new LOW finding: ui/config/jest/typescriptTransform.js explicitly sets sourceMap: false and returns no Two carry-forward pre-existing issues (not from this PR): postcss-loader v4 with v3 API, and url-loader's Overall: ready to merge. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What issue type does this pull request address? (keep at least one, remove the others)
/kind enhancement
What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves #
Please provide a short message that should be published in the DevSpace release notes
Fixed an issue where DevSpace ...
What else do we need to know?