Skip to content

Angular: zoneless tests and core components changes - #35749

Merged
vorobey merged 28 commits into
DevExpress:feature/angular-zoneless-supportfrom
vorobey:feature/angular-zoneless-support-wrappers
Oct 30, 2026
Merged

vorobey merged 28 commits into
DevExpress:feature/angular-zoneless-supportfrom
vorobey:feature/angular-zoneless-support-wrappers

Conversation

@vorobey

@vorobey vorobey commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

PR applies changes for supporting Angular zoneless mode (default for new Angular 21+ apps). Zone-based apps keep working as before; no breaking changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new suites are omitted from standard CI execution, and the drag test can mask a missing change-detection trigger.

2 open issues
What changed in this PR

Adds zone-based and zoneless change-detection tests for the Angular wrappers, supported by new Karma environments.

Changes:

  • Adds shared regression tests for both change-detection modes.
  • Separates Zone.js polyfills from common test setup.
  • Adds Nx test/debug targets and core-file lint directives.
File Description
packages/​nx-infra-plugin/​src/​executors/​karma-multi-env/​schema.json Allows both new environments.
packages/​nx-infra-plugin/​src/​executors/​karma-multi-env/​schema.d.ts Extends environment types.
packages/​nx-infra-plugin/​src/​executors/​karma-multi-env/​karma.types.ts Maps new environments to shims.
packages/​nx-infra-plugin/​src/​executors/​karma-multi-env/​karma-multi-env.impl.ts Includes new environments in execution order.
packages/​devextreme-angular/​tests/​src/​zone-modes/​change-detection.spec.ts Adds change-detection regression tests.
packages/​devextreme-angular/​src/​core/​events-strategy.ts Adds a lint suppression only.
packages/​devextreme-angular/​src/​core/​component.ts Adds a lint suppression only.
packages/​devextreme-angular/​project.json Adds test/debug targets and cache inputs.
packages/​devextreme-angular/​karma.zoneless.test.shim.js Initializes tests without Zone.js.
packages/​devextreme-angular/​karma.zoneless-testing.module.js Provides zoneless change detection.
packages/​devextreme-angular/​karma.zone.test.shim.js Initializes zone-based regression tests.
packages/​devextreme-angular/​karma.zone-polyfills.test.shim.js Centralizes Zone.js loading.
packages/​devextreme-angular/​karma.test.shim.js Uses zone polyfills and excludes dedicated suites.
packages/​devextreme-angular/​karma.server.test.shim.js Uses zone polyfills.
packages/​devextreme-angular/​karma.hydration.test.shim.js Uses zone polyfills.
packages/​devextreme-angular/​karma.common.test.shim.js Removes shared Zone.js loading.
packages/​devextreme-angular/​.gitignore Ignores Chrome Headless artifacts.

Review effort: Balanced

@vorobey
vorobey deleted the branch DevExpress:feature/angular-zoneless-support October 19, 2026 15:49
@vorobey vorobey closed this Oct 19, 2026
@vorobey vorobey reopened this Oct 19, 2026
@vorobey
vorobey requested a balanced review from Copilot October 19, 2026 15:51
@vorobey vorobey self-assigned this Oct 19, 2026
@vorobey vorobey added the 26_2 label Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Programmatic option-change subscriptions can still leave zoneless views stale.

3 open issues

Review effort: Balanced

@vorobey
vorobey marked this pull request as ready for review October 20, 2026 07:02
@vorobey vorobey removed the .d.ts label Oct 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Public instance.on('optionChanged') handlers can still leave zoneless views stale.

3 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Callback-only nested widget events can still leave plain-field updates unrendered in zoneless applications.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Notify Angular for callback-only nested widget actions

packages/​devextreme-angular/​src/​core/​events-strategy.ts:34

The notification is still inside if (emitter.observers.length), so callback-only nested widgets are missed. For example, a toolbar button configured through items[].options.onClick can have no click emitter subscribers. Core _createActionByOption invokes fireEvent before executing the option callback separately (core/widget/component.ts:466–470); updating a plain host field in that callback does not notify Angular, leaving a zoneless view stale unless another change-detection trigger occurs. Cover user-configured option callbacks in the notification path and add a zoneless regression test, while preserving suppression for widget-internal callbacks.

3 resolved since last review

Review effort: Balanced

@vorobey
vorobey requested a review from a team October 20, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Shared change-detection and global event-hook changes need human validation across both Angular modes because runtime behavior was not verified.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Unresolved callback-notification gaps and outside-zone Form updates undermine the intended change-detection behavior and backward compatibility.

No open issues 🎉

3 previously missed issues

In code that hasn't changed since last review

Medium severity Notify configured public callbacks without observers

packages/​devextreme-angular/​src/​core/​events-strategy.ts:33

The new notifications only run when the emitter has observers. A handler configured with button.instance.option('onClick', handler) runs separately as an action callback, so an otherwise unbound button executes it but leaves plain host fields it changes stale in a zoneless app. Also notify for configured public event callbacks and cover this registration path with a zoneless test.

Medium severity Avoid marking views for outside-zone updates

packages/​devextreme-angular/​src/​ui/​form/​index.ts:779

This unconditionally marks the view even when fieldDataChanged comes from ngZone.runOutsideAngular(() => form.instance.updateData(...)) with no Angular event bindings. In zone-based Angular 21 apps, markForCheck() schedules change detection even outside the zone, so background form updates that previously avoided change detection now refresh the application. Please apply the same canMarkForCheck(ngZone) guard used by NgEventsStrategy, or restrict this fallback to zoneless mode, and cover the outside-zone case.

Medium severity Test scroll position changes through the widget API

packages/​devextreme-angular/​tests/​src/​zone-modes/​change-detection.spec.ts:445

Dispatching a scroll event does not change the container's scroll position, so this test never moves the virtual viewport. The virtual-scrolling handler skips viewport updates when the offset is unchanged, leaving row loading and page changes untested. Scroll through the widget API and assert that the visible row range changes before checking the change-detection count.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Nested widget event strategies still lack change-detection notification, allowing application handlers to leave zoneless views stale; this path needs a fix and regression coverage.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because option-registered callbacks can bypass zoneless change-detection notification, leaving updated state unreflected in bindings.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because configured widget callbacks without event subscribers can bypass zoneless change-detection notification and leave displayed state stale.

No open issues 🎉

Review effort: Balanced

@vorobey
vorobey merged commit 6ffadd8 into DevExpress:feature/angular-zoneless-support Oct 30, 2026
257 of 275 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants