Skip to content

Commit 07bdf88

Browse files
MeAkibdgp1130
authored andcommitted
refactor(@angular/build): remove unused exports
Remove the `export` keyword from four symbols that are only referenced within their defining file: `calculateThresholds` and `checkThresholds`, whose external callers moved to `checkBudgets` in 4d27c38; `augmentAppWithServiceWorkerCore`, which is only called by the exported wrapper functions; and `getEntryPointName`, whose external call sites were removed in 75abe2c. The two threshold functions also leave the unsupported `private` entry point, which re-exports the bundle calculator module; neither `@angular-devkit/build-angular` nor `@angular/cli` references them, and both still compile. The public API golden is unchanged.
1 parent 207265a commit 07bdf88

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/angular/build/src/tools/esbuild/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export function isZonelessApp(polyfills: string[] | undefined): boolean {
285285
return !polyfills?.some((p) => p === 'zone.js' || /\.[mc]?[jt]s$/.test(p));
286286
}
287287

288-
export function getEntryPointName(entryPoint: string): string {
288+
function getEntryPointName(entryPoint: string): string {
289289
return basename(entryPoint)
290290
.replace(/(.*:)/, '') // global:bundle.css -> bundle.css
291291
.replace(/\.[cm]?[jt]s$/, '')

‎packages/angular/build/src/utils/bundle-calculator.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface BudgetStats {
5858
assets?: BudgetAsset[];
5959
}
6060

61-
export function* calculateThresholds(budget: BudgetEntry): IterableIterator<Threshold> {
61+
function* calculateThresholds(budget: BudgetEntry): IterableIterator<Threshold> {
6262
if (budget.maximumWarning) {
6363
yield {
6464
limit: calculateBytes(budget.maximumWarning, budget.baseline, 1),
@@ -354,7 +354,7 @@ export function* checkBudgets(
354354
}
355355
}
356356

357-
export function* checkThresholds(
357+
function* checkThresholds(
358358
thresholds: Iterable<Threshold>,
359359
size: number,
360360
label?: string,

‎packages/angular/build/src/utils/service-worker.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export async function augmentAppWithServiceWorkerEsbuild(
213213
);
214214
}
215215

216-
export async function augmentAppWithServiceWorkerCore(
216+
async function augmentAppWithServiceWorkerCore(
217217
config: Config,
218218
serviceWorkerFilesystem: Filesystem,
219219
baseHref: string,

0 commit comments

Comments
 (0)