Skip to content

fix(@angular-devkit/build-angular): isolate zone.js usage when rendering server bundles#24192

Merged
alan-agius4 merged 1 commit intoangular:14.2.xfrom
alan-agius4:zone-js-patch-worker
Nov 7, 2022
Merged

fix(@angular-devkit/build-angular): isolate zone.js usage when rendering server bundles#24192
alan-agius4 merged 1 commit intoangular:14.2.xfrom
alan-agius4:zone-js-patch-worker

Conversation

@alan-agius4
Copy link
Copy Markdown
Collaborator

@alan-agius4 alan-agius4 commented Nov 7, 2022

When generating an app-shell via the app-shell builder, the server application rendering will now take place within a Node.js Worker. Since the rendering requires the presence of Zone.js, this change allows for the Zone.js patching to be isolated from the remainder of the builder and Angular CLI code. This prevents Zone.js from persisting past the needed render operation. This also allows for a workaround to a Zone.js/Node.js v18 problem where the TypeScript dynamic import workaround involving the Function constructor to ensure a native dynamic import expression will cause a failure when running on Node.js v18.10.

(cherry picked from commit 484cda5)

Patch version of #24042 which is needed to address angular/angular#47872

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Nov 7, 2022
@alan-agius4 alan-agius4 marked this pull request as ready for review November 7, 2022 10:40
@alan-agius4 alan-agius4 force-pushed the zone-js-patch-worker branch 3 times, most recently from a015d4c to c6e0cab Compare November 7, 2022 13:00
…ing server bundles

When generating an app-shell via the app-shell builder, the server application rendering
will now take place within a Node.js Worker. Since the rendering requires the presence of
Zone.js, this change allows for the Zone.js patching to be isolated from the remainder
of the builder and Angular CLI code. This prevents Zone.js from persisting past the needed
render operation. This also allows for a workaround to a Zone.js/Node.js v18 problem where
the TypeScript dynamic import workaround involving the Function constructor to ensure a native
dynamic import expression will cause a failure when running on Node.js v18.10.

(cherry picked from commit 484cda5)
@alan-agius4 alan-agius4 requested a review from clydin November 7, 2022 14:13
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 7, 2022
@alan-agius4 alan-agius4 merged commit 12b2dc5 into angular:14.2.x Nov 7, 2022
@alan-agius4 alan-agius4 deleted the zone-js-patch-worker branch November 7, 2022 17:43
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants