Repository navigation
NXT-20982: Upgrade dependencies to latest majors (webpack-dev-server 6, chalk 6, et al.) - #409
Conversation
Upgrade 9 packages to new majors:
- chalk ^5.6.2 -> ^6.0.1
- dotenv ^17.4.2 -> ^18.0.9
- dotenv-expand ^13.0.0 -> ^1000.0.0
- validate-npm-package-name ^7.0.2 -> ^8.0.0
- @testing-library/jest-dom ^6.9.1 -> ^7.0.1
- jest-environment-jsdom 29.7.0 -> 30.5.2
- less-loader ^12.3.2 -> ^13.0.0
- sass-loader ^16.0.7 -> ^17.0.1
- postcss-preset-env ^10.6.1 -> ^11.6.1
Deferred (ecosystem/engine incompat): @babel/plugin-transform-modules-commonjs@8,
eslint@10 (requires Node >=20.19, config-enact compat), webpack-dev-server@6
(SockJS removal breaks react-refresh-webpack-plugin).
No source migration required: chalk uses dynamic import(), dotenv uses
config({processEnv:{}})+expand(), jest-dom via moduleNameMapper, loaders use
lessOptions/sassOptions (unchanged across majors).
- webpack-dev-server ^5.2.5 -> ^6.1.0 - @pmmmwh/react-refresh-webpack-plugin ^0.6.2 -> ^0.6.3 (adds WDS6 peer support) - engines.node: drop Node 20, require ^22.15.0 || >=24.0.0 (WDS6 needs >=22.15.0) WDS6 is ESM-only but loads via require(esm) on Node >=22.15. No serve.js code changes needed: WebpackDevServer/startCallback/stopCallback/setupMiddlewares APIs unchanged from v5. react-dev-utils uses native WebSocket (no SockJS), so SockJS removal in v6 has no impact. webpack 5.112.2 satisfies WDS6 peer ^5.101.0.
Three root causes surfaced by the dependency upgrades (all green on develop, failing on this branch) are addressed: 1. 'module.is is not a function' (isomorphic/screenshot/ui-tests framework bundle): the pre-existing webpack bump to 5.112.2 left @enact/dev-utils resolving its own nested webpack 5.109.2. EnactFrameworkPlugin requires webpack/lib/dll/DllModule, so the DLL runtime straddled two webpack copies and broke. Add overrides.webpack ^5.112.2 to dedupe to a single webpack. 2. LESS build failure (samples/theme-samples): less-loader 13 defaults lessLogAsWarnOrErr to true, emitting Less deprecations (mixin called without parentheses in @enact/ui) as webpack warnings; pack --production (CI=true) treats warnings as errors. Set lessLogAsWarnOrErr:false to restore pre-13 silent logging. 3. 'Property window is not declared configurable' (@enact/core specs under cli-testing): jest-environment-jsdom 30 pulls jsdom 26, where window.window is non-configurable, breaking jest.spyOn(window,'window','get'). This cannot be shimmed from a custom environment (the property is genuinely non-configurable). Revert jest-environment-jsdom to 29.7.0 (jsdom 20.0.3), which keeps window configurable. Verified the exact spy pattern passes. Other upgrades retained: chalk 6, dotenv 18, dotenv-expand 1000, validate-npm-package-name 8, @testing-library/jest-dom 7, less-loader 13, sass-loader 17, postcss-preset-env 11, webpack-dev-server 6, react-refresh-webpack-plugin 0.6.3.
Point @enact/dev-utils at enactjs/dev-utils#feature/NXT-20982, whose devDep webpack is aligned to ^5.112.2. This dedupes webpack to the single top-level copy naturally, so the temporary overrides.webpack ^5.112.2 workaround for the 'module.is is not a function' DLL failure (cause 1) is removed. Verified: webpack resolves to one 5.112.2 copy (no nested dev-utils webpack), and EnactFrameworkPlugin loads webpack/lib/dll/DllModule from the same single webpack instance the CLI compiles with.
Update the pinned @enact/dev-utils commit to include the public-API RuntimeGlobals change (enactjs/dev-utils@57b0a78), fixing the framework build failure 'Cannot find module webpack/lib/RuntimeGlobals' on webpack 5.112.
Pin @enact/dev-utils to enactjs/dev-utils@663a65f, which fixes the external framework build failure 'Cannot find module webpack/lib/dependencies/DelegatedSourceDependency' on webpack 5.112.
Pin @enact/dev-utils to enactjs/dev-utils@f4f3304.
jest-environment-jsdom is pinned back to 29.7.0, matching develop, so there is no net change to record.
|
@hong6316 Since this PR was merged, the enact CI clones So Could you take a look soon? Either revert |
enactjs/cli develop now installs @babel/core 8 while babel-preset-enact still requires Babel 7 (enactjs/cli#409), so every test suite fails to load. Use cli master until develop is fixed, as done in #3470. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dated position (#3467) * Fix VirtualList native scroll animation stopping at an outdated position `animateScroll` started a new requestAnimationFrame loop without cancelling the ongoing one. While a 5-way key is held and frames are delayed, a stale loop keeps scrolling toward its old target and its timeout fallback (`scrollTo` with the old target) overrides the latest target, so the list stops before the focused item at the start/end of the list. Cancel the ongoing animation before starting a new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Retarget the ongoing VirtualList native scroll animation instead of restarting it Cancelling the ongoing animation on every request made the scroll too slow to keep up with the focus while a 5-way key is held, and it reset `scrolling` to false until the next frame, so `onScrollEnd` could fire `onScrollStop` in the middle of a long-press scroll. Keep a single animation loop alive and update its target (and timeout start) on each request, and scale the step by the number of items left to scroll so the speed keeps up with the focus. A single key press scrolls at the same speed as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drive all pending animation frames in VirtualList native scroll tests The previous rAF mock kept only the last callback, so the stale concurrent loop from before the fix was never run and the tests passed without the fix. Also fix the CHANGELOG wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Temporarily clone Enact CLI master in CI enactjs/cli develop now installs @babel/core 8 while babel-preset-enact still requires Babel 7 (enactjs/cli#409), so every test suite fails to load. Use cli master until develop is fixed, as done in #3470. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Checklist
Issue Resolved / Feature Added
Updates the Enact CLI's dependencies to their latest major versions and migrates
the code/configuration accordingly. The following packages are upgraded:
chalk5 → 6dotenv17 → 18,dotenv-expand13 → 1000validate-npm-package-name7 → 8@testing-library/jest-dom6 → 7less-loader12 → 13,sass-loader16 → 17,postcss-preset-env10 → 11webpack-dev-server5 → 6 (and@pmmmwh/react-refresh-webpack-plugin0.6.2 → 0.6.3)webpack-dev-server6 is ESM-only and requires Node.js >= 22.15, so thesupported Node engines are updated to
^22.15.0 || >=24.0.0.Resolution
No source migration was required for most packages (chalk already uses dynamic
import(), dotenv usesconfig({processEnv})+expand(), jest-dom is wired viamoduleNameMapper, the style loaders use the unchangedlessOptions/sassOptions).Regressions surfaced by the upgrades were fixed:
less-loader13 now defaultslessLogAsWarnOrErrtotrue, surfacing Lessdeprecations as webpack warnings that fail
pack --productionunder CI. SetlessLogAsWarnOrErr: falseto restore the previous silent behavior.jest-environment-jsdom30 pulls jsdom 26, where the globalwindowproperty is non-configurable and breaks
jest.spyOn(window, 'window', 'get')used by framework specs. This is not shimmable from a custom environment, so
jest-environment-jsdomis kept at 29.7.0 (jsdom 20) which pairs fine withjest core 30.
webpack5.112 relocated internal modules used by@enact/dev-utils’s DLLplugins. The CLI now consumes the matching
@enact/dev-utilschanges (see thecompanion dev-utils PR), so a single webpack copy is resolved and the framework
bundle builds cleanly (no more
module.is is not a functionorCannot find module 'webpack/lib/RuntimeGlobals').Deferred (ecosystem not ready):
@babel/plugin-transform-modules-commonjs8 andeslint10.Additional Considerations
Validated with the
enact-release-testing-related-clipipeline and thedownstream framework jobs (isomorphic / cli-testing / samples / screenshot /
theme-samples / ui-tests) on Node 22+. The
@enact/dev-utilsdependencycurrently points at the
feature/NXT-20982branch and should be moved back to apublished version range once the companion dev-utils PR is released.
Links
NXT-20982
Comments
Enact-DCO-1.0-Signed-off-by: Taeyoung Hong (taeyoung.hong@lge.com)