Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/build): handle external @angular/ packages during SSR #29094

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

alan-agius4
Copy link
Collaborator

This commit introduces ngServerMode to ensure proper handling of external @angular/ packages when they are used as externals during server-side rendering (SSR).

Closes: #29092

@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 Dec 9, 2024
This commit introduces `ngServerMode` to ensure proper handling of external `@angular/` packages when they are used as externals during server-side rendering (SSR).

Closes: angular#29092
const source = await javascriptTransformer.transformFile(filePath);
let source = await javascriptTransformer.transformFile(filePath);

if (filePath.includes('@angular/')) {
Copy link

Choose a reason for hiding this comment

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

What happens if the name does not include '@angular/'?

Copy link
Collaborator Author

@alan-agius4 alan-agius4 Dec 9, 2024

Choose a reason for hiding this comment

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

The ngServerMode is not added. And the resolved module will be returned with the standard transformations.

@alan-agius4 alan-agius4 requested a review from clydin December 9, 2024 16:09
@alan-agius4 alan-agius4 marked this pull request as ready for review December 9, 2024 16:09
…ng SSR

Co-authored-by: Charles <19598772+clydin@users.noreply.github.com>
@alan-agius4 alan-agius4 requested a review from clydin December 9, 2024 16:49
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker merge: squash commits When the PR is merged, a squash and merge should be performed merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 9, 2024
@alan-agius4 alan-agius4 merged commit d811a7f into angular:main Dec 9, 2024
33 checks passed
@alan-agius4 alan-agius4 deleted the externals-angular branch December 9, 2024 17:26
@alan-agius4
Copy link
Collaborator Author

The changes were merged into the following branches: main, 19.0.x

alan-agius4 added a commit that referenced this pull request Dec 9, 2024
…29094)

This commit introduces `ngServerMode` to ensure proper handling of external `@angular/` packages when they are used as externals during server-side rendering (SSR).

Closes: #29092
(cherry picked from commit d811a7f)
@angular-automatic-lock-bot
Copy link

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 Jan 9, 2025
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 area: @angular/build merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed merge: squash commits When the PR is merged, a squash and merge should be performed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR build prerender broken if configuration has externalDependencies options
3 participants