Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ab0847

Browse files
arturovtAndrewKushnir
authored andcommitted
refactor(core): mark VERSION as @__PURE__ for better tree-shaking
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to optimizers that the constructor is side-effect free. Without this hint, bundlers such as Terser or ESBuild may conservatively retain the `VERSION` instantiation even when unused. With the annotation, the constant can be tree-shaken away in production builds if not referenced, reducing bundle size. (cherry picked from commit d3f67f6)
1 parent 5f14367 commit 8ab0847

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

β€Žpackages/common/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/elements/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ import {Version} from '@angular/core';
1111
/**
1212
* @publicApi
1313
*/
14-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
14+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/forms/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/platform-browser-dynamic/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/platform-browser/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/platform-server/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/router/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

β€Žpackages/upgrade/src/common/src/version.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import {Version} from '@angular/core';
1717
/**
1818
* @publicApi
1919
*/
20-
export const VERSION = new Version('0.0.0-PLACEHOLDER');
20+
export const VERSION = /* @__PURE__ */ new Version('0.0.0-PLACEHOLDER');

0 commit comments

Comments
Β (0)