Repository navigation
Upgrade to webpack 5.112 and Angular CLI 20.3.41 by disabling emitDecoratorMetadata - #6549
Open
bram-atmire wants to merge 2 commits into
Open
bram-atmire wants to merge 2 commits into
bram-atmire wants to merge 2 commits into
Conversation
Bump @angular/ssr and @angular-devkit/build-angular to 20.3.41 together with webpack 5.112.2. build-angular 20.3.40 pins webpack 5.105.0 and imports webpack/lib files that webpack 5.112 moved, so the webpack update cannot be applied on its own. Disable emitDecoratorMetadata in tsconfig.json. With it enabled, @ngtools/webpack keeps imports that are only used as types (for example SimpleChanges), and webpack 5.112 now reports those missing exports as build errors. Nothing in the application reads the decorator metadata. Assisted-by: Claude Code [claude-opus-5-5]
bram-atmire
force-pushed
the
webpack-5.112-angular-20.3.41
branch
from
November 22, 2026 09:42
a783e31 to
96f1e70
Compare
These @typedObject classes were missing from the models list in provide-core.ts. MetadataSecurityConfiguration is only imported as a type, so it was only loaded (and registered) because emitDecoratorMetadata kept type-only imports. With that setting disabled, its module is dropped from the bundle, the metadata security configuration cannot be deserialized, and the submission form fields are never rendered. EditItem and EditItemMode are added for the same reason, although they are currently still loaded through value imports. Assisted-by: Claude Code [claude-opus-5-5]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
dspace-10_x), build(deps): bump the angular group with 3 updates #6482 and build(deps-dev): bump webpack from 5.107.2 to 5.112.2 in the webpack group across 1 directory #6397 (dspace-9_x), build(deps-dev): bump webpack from 5.107.2 to 5.112.2 in the webpack group across 1 directory #6406 (dspace-8_x)TL;DR
Needed to get us back on the latest webpack version.
Description
Since webpack 5.112, the Dependabot updates for webpack and for the Angular CLI build packages fail the build on every branch. This PR updates both together, disables
emitDecoratorMetadata, and registers three REST models that this exposed as missing.Instructions for Reviewers
Why the Dependabot PRs fail
@angular-devkit/build-angular20.3.40 pinswebpack@5.105.0and importswebpack/lib/...files that 5.112 moved. Mixed with our own webpack 5.112.2, the build fails withparser.getLocation is not a function. Angular CLI 20.3.41 moves to webpack 5.112, so both updates must go together.strictExportPresence: true. WithemitDecoratorMetadata: true,@ngtools/webpackkeeps imports that are only used as types, so the build fails with 42 errors likeexport 'SimpleChanges' ... was not found in '@angular/core'.Why
emitDecoratorMetadatacan be disabledNothing reads the
design:*metadata: no code insrc/, not@4science_ng-dynamic-forms/core(it uses its own metadata keys), and not Angular in AOT builds. The unit tests (JIT) pass. Angular CLI 20 no longer sets it for new projects.The setting did have a hidden effect: modules imported only as types were still loaded.
MetadataSecurityConfigurationis a@typedObjectthat is only imported as a type and was missing from themodelslist inprovide-core.ts. Without the setting it was never registered, and the submission form fields were not rendered (5 failing e2e tests in the first CI run).EditItemandEditItemModewere also missing from that list. All three are now added.List of changes in this PR:
tsconfig.json:emitDecoratorMetadataset tofalse.package.json/package-lock.json:@angular/ssrand@angular-devkit/build-angularto^20.3.41(as build(deps): bump the angular group with 3 updates #6485),webpackto^5.112.2(as build(deps-dev): bump webpack from 5.107.2 to 5.112.2 in the webpack group across 1 directory #6491).src/app/core/provide-core.ts: addMetadataSecurityConfiguration,EditItemandEditItemModetomodels.How to test
npm ciandnpm run build:prod: nowas not foundorgetLocationerrors.npm run lint,npm run test:headlessand the e2e tests pass. Locally, useTSESTREE_SINGLE_RUN=truefor lint: outside CI, typescript-eslint uses watch programs and needs more than 4 GB.AI Disclosure (REQUIRED)
Were AI tools used in the creation of this PR?
Claude Code (claude-opus-5-5) found the causes, made the changes and regenerated the lockfile. It ran build, lint,
check-circ-depsand the unit tests locally (6015/6015), checked that all changed package versions are at least 14 days old without install scripts, and found the missing models by comparing production bundles (ng build --stats-json) after the first CI run failed. The e2e tests were only run in CI. I reviewed the change and this description.Personally this is quite far from my own knowledge and comfort zone, but I was not able to detect any problems/conflicts with this, and I can't think of another approach to fix the Dependabot/Webpack/Angular upgrade path issues.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.