Repository navigation
UI: Angular 21 (from 18.2), with PrimeNG 21 and Nx 22 - #44
Open
belkassaby wants to merge 9 commits into
Open
belkassaby wants to merge 9 commits into
belkassaby wants to merge 9 commits into
Conversation
Nx 20.8 already supports Angular 19, but the Angular update had been skipped; it is replayed with nx migrate --from=@nx/angular@20.1.0 --exclude-applied-migrations. - @angular/* 19.2.9, zone.js 0.15, angular-eslint 19.8, jest-preset-angular 14.4. - Components are standalone by default in 19, so the explicit standalone: true is dropped (Angular's explicit-standalone-flag migration, reduced to that one line). - angular-eslint's prefer-standalone rule is off, as Nx's migration sets it. PrimeNG stays on 17 until its own step; its peer range (Angular <= 18) is why this step installs with --legacy-peer-deps.
…heir migrations - @angular/* 20.3.9, @angular/cli 20.3, Nx 21.6.11, angular-eslint 20.7, jest-preset-angular 14.6, TypeScript ~5.9.3 (Angular 20 needs 5.8+, 21 needs 5.9). - Nx's migrations: moduleResolution bundler, the serve target continuous, generator defaults that keep the pre-v20 file naming, ignore entries for Nx's AI rule files. - angular-eslint 20 recommends prefer-inject, so constructor injection moves to inject() with Angular's own inject migration (16 files), imports kept multi-line. - VennComponent imported NgFor without using it (Angular 20's NG8113 warning). The template control-flow migration is the next commit, on its own.
*ngIf, *ngFor and *ngSwitch are deprecated from Angular 20. Converted with Angular's control-flow migration (33 files). It could not take the analyze page's options block: its [ngSwitch] element also held two comments and the help text, which @switch does not allow beside its cases, so the switch moved to an inner ng-container holding only the cases and the analyze templates were migrated after. Inside @if (session.current && ...) the session is narrowed, so its ?. became . (NG8107).
…grations - @angular/* 21.2.9, @angular/cli 21.2, zone.js 0.16, Nx 22.7.12, angular-eslint 21.4. - Jest 30 with jest-preset-angular 16: the setup file uses setupZoneTestEnv, and the Jest config is CommonJS (Nx's migrations). - TypeScript configs: moduleResolution bundler, module preserve, lib es2022, isolatedModules for specs (Nx's migrations). - ng-mocks 14.18.6, the first release whose peer range takes Angular 21. - Nx adds ignore entries for its own generated folders. Angular's own 21 migrations found nothing to change.
…t it removed
PrimeNG 17 supports Angular 17-18 only; from 18 its major follows Angular's.
- primeng ^21.1.10, @angular/cdk 21.2.9 (now a peer), @primeuix/themes ^2.0.3.
- Theme: PrimeNG 18+ ships no theme CSS; the aura-light-green file becomes
providePrimeNG with Aura and a green primary (src/app/theme.ts), light only.
- What the theme file used to provide, restored in styles.scss:
- Inter, which it shipped and set on :root (@fontsource-variable/inter);
- .p-component's normal weight, so components inside bold text stay regular;
- PrimeNG 17's CSS variables, which PrimeFlex's utilities and the species tags read:
theme tokens point at PrimeNG's --p-* ones, named colour scales keep 17's values.
- Removed components: Dropdown -> Select, Messages -> Message (the top banner, its
content kept in one row, as p-messages laid it out).
- Changed behaviour, kept as it looked:
- Tag severity "warning" is "warn";
- p-message has no default icon, so the analyze page's messages name theirs;
- Divider centres its label by default, so the gene set page's are left-aligned;
- styles are injected only for components in use, so buttons and inputs styled
with p-button / p-inputtext get pButton / pInputText;
- AutoComplete's internal class names, which the suggestion list styles, renamed;
- responsiveLayout="stack" is no longer implemented, so the gene set list hides its
per-cell titles itself (it never stacked: PrimeNG 17 scrolls a scrollable table);
- p-button-secondary now colours a menubar item, so the Legacy Page item drops it.
- @types/node 22, as CI runs Node 22 (Vite's peer range wants 20.19+).
- The gene set page is lazy-loaded, as the analyze page already was: with Angular 21
and PrimeNG 21 the initial bundle reached 2.03 MB, past stage/prod's 2 MB error
budget; it is 1.90 MB.
Checked against main's build in headless Chrome with dev's data: home, search results
(wide and narrow), a gene set, and the analyze page match apart from button labels at
weight 500.
… pipeline's Node meets Angular 21's minimum Angular 21 needs Node 22.12 or later. GitHub Actions already sets up Node 22 (latest 22.x); ui/bitbucket-pipelines.yml, from the standalone repo, pinned node:22.6. The UI uses PrimeFlex, not Tailwind.
belkassaby
requested a deployment
to
jax-cluster-dev-10--dev
November 21, 2026 05:29 — with
GitHub Actions
Waiting
…or two-way state Angular's own migrations (signal-input, output, signal-queries), across the UI: 51 @input become input() / input.required(), 14 @output become output(), 19 @ViewChild become viewChild(). Safe mode skipped 17 inputs; best-effort mode took them, and what it needed by hand: - Inputs the component also writes become model(): the search filters' `filters`, the view switch's `value`, the search bar's `searchValue` (bound with [(ngModel)]), and the gene list's `genes` (given by the parent, or fetched for a gene set id). Their `(xChange)` bindings are unchanged. - output() refuses undefined where EventEmitter took it: `searchPaging` emits a response's paging, absent on some responses, so its type says Paging | undefined. - The Venn species table narrows its signal with @if (species(); as rows). - Tests set inputs as a parent template does, with fixture.componentRef.setInput, not by assignment (which would replace the signal). setInput is a real input change, so the gene network test lets Angular run ngOnChanges once and waits for Cytoscape to load, instead of also calling it by hand.
provideZonelessChangeDetection replaces zone.js. Angular now re-renders when a template event, a signal, the async pipe or markForCheck says the view changed -- not after every timer, promise or HTTP response. Every change made outside a template event now says so: - Page components whose state is plain fields set in subscriptions (analyze, gene set, similar gene sets, gene set search, gene set picker, search bar) mark themselves for checking after each emission with renderAfter(changes), a small operator put before .subscribe(...) (utils/render-after.ts): 16 subscriptions. - GenesetSearchSource, shared by the search and the picker, calls back its owner when results arrive; the deferred first search marks its component too. - The home page's spinner is a signal. - Already covered: the charts mark for check in their D3 and Cytoscape handlers, the gene list's fetched genes go into its genes model signal, and outputs and the session's async pipe notify by themselves. zone.js leaves the polyfills and the dependencies; the initial bundle is 1.86 MB (1.90 with zone.js). Tests run in jest-preset-angular's zoneless environment: the two polling tests use Jest's fake timers instead of fakeAsync (which needs zone.js), and the analyze tests mark the component before re-rendering after setting its state directly, as the app's code does. Checked in Chrome against dev's API (read-only, signed out): a search from the URL, a typed search, the next page, a gene set's details and genes, refetching genes by another identifier type, the analyze tool list and the gene set picker's suggestions all render, with no console errors.
belkassaby
temporarily deployed
to
jax-cluster-dev-10--dev
November 21, 2026 14:08 — with
GitHub Actions
Inactive
belkassaby
requested a deployment
to
jax-cluster-dev-10--sqa
November 23, 2026 16:22 — with
GitHub Actions
Waiting
…ion template as expandedrow PrimeNG 18+ dropped the table's "rowexpansion" template name, so the gene set list's expansion template was ignored and the chevron toggled nothing. Renamed to "expandedrow", with a test that expands and collapses a row.
belkassaby
requested a deployment
to
jax-cluster-dev-10--sqa
November 23, 2026 16:49 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
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.
Updates the v3 UI (
ui/) from Angular 18.2 to Angular 21.2, and moves it onto Angular 21's idiomatic features: signal inputs, outputs and queries, and zoneless change detection (zone.js removed). One Angular major per commit, each with its own migrations and a full check. PrimeNG has to follow: PrimeNG 17 supports Angular 17–18 only, and from 18 its major tracks Angular's.Commits
16b87ff4nx migrate --from=@nx/angular@20.1.0 --exclude-applied-migrations. Standalone is now the default, so 30standalone: truelines go.5c6c433dprefer-injectrule is met with Angular's owninject()migration (16 files).11d05202@if,@for,@switch) via Angular's migration.*ngIfand the others are deprecated from 20. One block had to be restructured first: the analyze page's optionsngSwitchheld comments and help text beside its cases. A separate commit, so it's easy to review or revert.cbf70823711b0c35@types/node22, and lazy loading for the gene set page.578b2943d348d62c@Inputbecomeinput(), 14@Outputbecomeoutput(), 19@ViewChildbecomeviewChild(). Inputs the component also writes, paired with anxChangeoutput, becomemodel(): the search filters, the view switch, the search bar's text and the gene list's genes. Tests set inputs withsetInput.d2e81a11provideZonelessChangeDetection(), with zone.js removed (details below).4e58bcb9rowexpansiontemplate, so the chevron did nothing.PrimeNG 17 → 21, kept looking the same
PrimeNG 18+ ships no theme CSS. The
aura-light-greentheme file becomesprovidePrimeNGwith Aura and a green primary (src/app/theme.ts), light only. The old file did more than color components, so this restores the rest instyles.scss::root. It now comes from@fontsource-variable/inter, the same OFL-licensed font..p-component { font-weight: normal }, so components inside the search page'sfont-boldblock stay regular. PrimeNG's own component weights still win, because its styles are injected after this sheet.text-color-secondary,surface-border,bg-green-100...) and the species tags read. The theme tokens point at PrimeNG's new--p-*tokens. The named color scales keep 17's exact values, because only the app and PrimeFlex use them.Removed or changed in PrimeNG, handled so nothing looks different:
warningis nowwarn(Tier III).p-messagehas no default icon any more, so the analyze page's messages set theirs.p-dividernow centers its label by default; the gene set page's dividers are set to left, as they rendered before.p-button/p-inputtextclasses alone now get thepButton/pInputTextdirectives (about 40 elements). Otherwise they'd only look right on pages that happened to render a real PrimeNG button.responsiveLayout="stack"is no longer implemented, so nothing hid the gene set list's per-cell titles any more; the list hides them itself. It never actually stacked: PrimeNG 17 scrolls a scrollable table instead.rowexpansiontemplate is nowexpandedrow. Under the old name PrimeNG ignores it, so the search results' expand chevron did nothing. Renamed, with a test that expands and collapses a row. The app's other template names are all still read.p-button-secondarynow colors a menubar item, so the gene set page's "Legacy Page" item drops it.Zoneless
Without zone.js, Angular re-renders only when a template event, a signal, the async pipe or
markForChecksays the view changed, not after every timer, promise or HTTP response. So every change made outside a template event now notifies Angular:renderAfter(changes)before.subscribe(...). It's a small operator that marks the component for checking after each emission (utils/render-after.ts), and covers 16 subscriptions.markForCheckin their D3 and Cytoscape handlers, the gene list's genes are a model signal, and outputs and the async pipe notify by themselves.fakeAsync, which needs zone.js. The analyze tests mark the component before re-rendering after changing its state directly, as the app does.The large pages keep their state as plain fields with explicit
markForCheck. That's Angular's documented zoneless pattern for existing code. Rewriting their state as signals touches every binding in templates of up to 800 lines, so it's left for later, page by page.Bundle size
With Angular 21 and PrimeNG 21, the initial bundle reached 2.03 MB. That's past the 2 MB error budget of the stage and prod build configurations, so the release build would fail. The gene set page is now lazy-loaded, as the analyze page already was. The initial bundle is 1.90 MB, and the page loads as its own 132 kB chunk. Without zone.js it's 1.86 MB.
Testing
npm ci, strict peer dependencies (no--legacy-peer-deps), Node 22:nx lint: clean.npm run build:jax-cluster-dev-10andbuild:jax-cluster-prod-10: all four environments build. Stage and prod give only the size warnings main already had.npm audit: 122 → 89 findings in total (critical 7 → 3, high 65 → 30). Production dependencies only: 10 → 8.For reviewers
--legacy-peer-deps, because PrimeNG 17's peer range blocks Angular 19+ until the PrimeNG commit. The final lockfile resolves strictly; CI'snpm ciis the check.ngx-csvis still CommonJS (a warning on the gene set page, as on main).