@angular-devkit/build-angular 12.1.2 → 12.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "12.1.2",
3
+ "version": "12.1.3",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
- "@angular-devkit/architect": "0.1201.2",
10
- "@angular-devkit/build-optimizer": "0.1201.2",
11
- "@angular-devkit/build-webpack": "0.1201.2",
12
- "@angular-devkit/core": "12.1.2",
9
+ "@angular-devkit/architect": "0.1201.3",
10
+ "@angular-devkit/build-optimizer": "0.1201.3",
11
+ "@angular-devkit/build-webpack": "0.1201.3",
12
+ "@angular-devkit/core": "12.1.3",
13
13
  "@babel/core": "7.14.6",
14
14
  "@babel/generator": "7.14.5",
15
15
  "@babel/helper-annotate-as-pure": "7.14.5",
@@ -21,7 +21,7 @@
21
21
  "@babel/template": "7.14.5",
22
22
  "@discoveryjs/json-ext": "0.5.3",
23
23
  "@jsdevtools/coverage-istanbul-loader": "3.0.5",
24
- "@ngtools/webpack": "12.1.2",
24
+ "@ngtools/webpack": "12.1.3",
25
25
  "ansi-colors": "4.1.1",
26
26
  "babel-loader": "8.2.2",
27
27
  "browserslist": "^4.9.1",
@@ -70,7 +70,7 @@
70
70
  "text-table": "0.2.0",
71
71
  "tree-kill": "1.2.2",
72
72
  "tslib": "2.3.0",
73
- "webpack": "5.42.0",
73
+ "webpack": "5.44.0",
74
74
  "webpack-dev-middleware": "5.0.0",
75
75
  "webpack-dev-server": "3.11.2",
76
76
  "webpack-merge": "5.8.0",
@@ -57,6 +57,27 @@ function getKeywords() {
57
57
  return ['class'];
58
58
  }
59
59
  exports.getKeywords = getKeywords;
60
+ /**
61
+ * Determines whether a property and its initializer value can be safely wrapped in a pure
62
+ * annotated IIFE. Values that may cause side effects are not considered safe to wrap.
63
+ * Wrapping such values may cause runtime errors and/or incorrect runtime behavior.
64
+ *
65
+ * @param propertyName The name of the property to analyze.
66
+ * @param assignmentValue The initializer value that will be assigned to the property.
67
+ * @returns If the property can be safely wrapped, then true; otherwise, false.
68
+ */
69
+ function canWrapProperty(propertyName, assignmentValue) {
70
+ if (angularStaticsToWrap.has(propertyName)) {
71
+ return true;
72
+ }
73
+ const { leadingComments } = assignmentValue.node;
74
+ if (leadingComments === null || leadingComments === void 0 ? void 0 : leadingComments.some(
75
+ // `@pureOrBreakMyCode` is used by closure and is present in Angular code
76
+ ({ value }) => value.includes('#__PURE__') || value.includes('@pureOrBreakMyCode'))) {
77
+ return true;
78
+ }
79
+ return assignmentValue.isPure();
80
+ }
60
81
  /**
61
82
  * Analyze the sibling nodes of a class to determine if any downlevel elements should be
62
83
  * wrapped in a pure annotated IIFE. Also determines if any elements have potential side
@@ -130,7 +151,7 @@ function analyzeClassSiblings(origin, classIdentifier, allowWrappingDecorators)
130
151
  nextStatement.remove();
131
152
  --i;
132
153
  }
133
- else if (angularStaticsToWrap.has(propertyName) || assignmentValue.isPure()) {
154
+ else if (canWrapProperty(propertyName, assignmentValue)) {
134
155
  wrapStatementPaths.push(nextStatement);
135
156
  }
136
157
  else {
@@ -119,7 +119,7 @@ function serveWebpackBrowser(options, context, transforms = {}) {
119
119
 
120
120
  Binding this server to an open connection can result in compromising your application or
121
121
  computer. Using a different host than the one passed to the "--host" flag might result in
122
- websocket connection issues. You might need to use "--disableHostCheck" if that's the
122
+ websocket connection issues. You might need to use "--disable-host-check" if that's the
123
123
  case.
124
124
  `);
125
125
  }