Skip to content

build: update beasties to 0.5.1 - #34014

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:build/udate-beasties
Sep 3, 2026
Merged

build: update beasties to 0.5.1#34014
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:build/udate-beasties

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Updates Beasties to version 0.5.1 and simplifies the inline critical CSS
implementation in @angular/build and @angular/ssr by using Beasties'
native preload: 'media-script' and nonce callback support.

Additionally, refactors inlineCriticalCss in @angular/build into a
standalone function and relocates InlineCriticalCssProcessor into
@angular-devkit/build-angular for Webpack-based builders.

@alan-agius4
alan-agius4 requested a review from clydin September 3, 2026 10:55
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Sep 3, 2026
@angular-robot angular-robot Bot added the area: build & ci Related the build and CI infrastructure of the project label Sep 3, 2026
@alan-agius4
alan-agius4 marked this pull request as ready for review September 3, 2026 12:27

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the beasties dependency to version 0.5.1 and refactors the inline critical CSS processing logic to utilize its new features, such as the native nonce option and the data-beasties-media attribute. The review feedback highlights a potential Content Security Policy (CSP) bypass risk where returning null instead of undefined for the CSP nonce could cause Beasties to output a literal nonce="null" attribute. Additionally, defensive programming is suggested by using optional chaining when calling remove() on elements cast to any to prevent potential runtime crashes.

Comment thread packages/angular/build/src/utils/index-file/inline-critical-css.ts
Comment thread packages/angular/ssr/src/utils/inline-critical-css.ts Outdated

@clydin clydin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup.

@alan-agius4 alan-agius4 removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 3, 2026
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Sep 3, 2026
Updates Beasties to version 0.5.1 and simplifies the inline critical CSS
implementation in @angular/build and @angular/ssr by using Beasties'
native preload: 'media-script' and nonce callback support.

Additionally, refactors `inlineCriticalCss` in @angular/build into a
standalone function and relocates `InlineCriticalCssProcessor` into
@angular-devkit/build-angular for Webpack-based builders.
@alan-agius4
alan-agius4 merged commit 55583c4 into angular:main Sep 3, 2026
39 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the build/udate-beasties branch September 3, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants