angular-docs-cn/aio/scripts
Alex Rickabaugh 08a4f10ee7 fix(ivy): move setClassMetadata calls into a pure iife (#33337)
This commit transforms the setClassMetadata calls generated by ngtsc from:

```typescript
/*@__PURE__*/ setClassMetadata(...);
```

to:

```typescript
/*@__PURE__*/ (function() {
  setClassMetadata(...);
})();
```

Without the IIFE, terser won't remove these function calls because the
function calls have arguments that themselves are function calls or other
impure expressions. In order to make the whole block be DCE-ed by terser,
we wrap it into IIFE and mark the IIFE as pure.

It should be noted that this change doesn't have any impact on CLI* with
build-optimizer, which removes the whole setClassMetadata block within
the webpack loader, so terser or webpack itself don't get to see it at
all. This is done to prevent cross-chunk retention issues caused by
webpack's internal module registry.

* actually we do expect a short-term size regression while
https://github.com/angular/angular-cli/pull/16228
is merged and released in the next rc of the CLI. But long term this
change does nothing to CLI + build-optimizer configuration and is done
primarly to correct the seemingly correct but non-function PURE annotation
that builds not using build-optimizer could rely on.

PR Close #33337
2019-11-20 12:55:58 -08:00
..
contributors docs(aio): add missing mentors for collaborators (#29142) 2019-04-11 08:06:18 -07:00
_payload-limits.json fix(ivy): move setClassMetadata calls into a pure iife (#33337) 2019-11-20 12:55:58 -08:00
audit-web-app.js feat(docs-infra): support checking the scores on all audit categories (#31414) 2019-07-11 17:13:47 -04:00
build-404-page.js refactor: remove unused parameter in _main method invocation (#28203) 2019-01-23 10:58:38 -08:00
build-artifacts.sh ci(docs-infra): reduce verbosity of `yarn build` on CI (#26746) 2018-10-25 21:17:52 -04:00
check-environment.js build(aio): do not fail if `check-env` for the main angular project fails 2017-06-16 07:51:18 +01:00
create-preview.js ci(docs-infra): manually trigger the preview server webhook (#27458) 2018-12-04 13:59:54 -08:00
deploy-to-firebase.sh build(docs-infra): remove unnecessary script to workaround cli issue (#28012) 2019-01-09 10:29:43 -08:00
deploy-to-firebase.test.sh ci(docs-infra): move deployment to CircleCI (#26377) 2018-10-23 14:35:38 -07:00
payload.sh ci(docs-infra): check and track payload sizes for `test_aio_local` and `test_aio_local_ivy` (#31047) 2019-06-14 14:38:10 -07:00
switch-to-viewengine.js build(docs-infra): align config with what cli generates for new apps (#32923) 2019-10-04 08:27:21 -07:00
test-aio-a11y.js fix(docs-infra): fix API list search color and styles (#31272) 2019-07-12 17:55:02 -04:00
test-preview.js test(docs-infra): run basic smoke tests against PR previews (#26649) 2018-10-29 13:00:20 -04:00
test-production.sh ci(docs-infra): run a11y audits on certain pages on CI (#31414) 2019-07-11 17:13:47 -04:00