-
Notifications
You must be signed in to change notification settings - Fork 12k
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-devkit/build-angular) : fix incorrect budget calculation #29234
base: main
Are you sure you want to change the base?
fix(@angular-devkit/build-angular) : fix incorrect budget calculation #29234
Conversation
656defa
to
3394f77
Compare
|
||
const failures = Array.from(checkBudgets(budgets, stats)); | ||
|
||
expect(failures.length).toBe(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(failures.length).toBe(0); | |
expect(failures).toHaveSize(0); |
@@ -338,5 +336,38 @@ describe('bundle-calculator', () => { | |||
message: jasmine.stringMatching('foo.ext exceeded maximum budget.'), | |||
}); | |||
}); | |||
|
|||
it('yields exceeded individual file budget - 29040', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct, as it does not yield exceeded
it('yields exceeded individual file budget - 29040', () => { | |
it('does not exceed the individual file budget limit', () => { |
@@ -12,6 +12,8 @@ import { formatSize } from './format-bytes'; | |||
// Re-export to avoid direct schema importing throughout code | |||
export { type BudgetEntry, BudgetType }; | |||
|
|||
export const kB = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const kB = 1000; | |
export const BYTES_IN_KILOBYTE = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this just a couple of NITs.
The commit scope should be @angular/build
and not @angular-devkit/build-angular
and please add a commit message body. https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines
3394f77
to
27710bb
Compare
27710bb
to
5f49618
Compare
This PR makes change to kB value which was incorrect earlier Fixes angular#29040
5f49618
to
ae19e25
Compare
Fixes #29040
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #29040
What is the new behavior?
It uses kb value from packages/angular/build/src/utils/bundle-calculator.ts so there is no difference in value when running tests
Does this PR introduce a breaking change?
Other information