angular-cn/tools
Pete Bacon Darwin e511bfcab5 fix(ivy): ensure that the correct `document` is available (#33712)
Most of the use of `document` in the framework is within
the DI so they just inject the `DOCUMENT` token and are done.

Ivy is special because it does not rely upon the DI and must
get hold of the document some other way. There are a limited
number of places relevant to ivy that currently consume a global
document object.

The solution is modelled on the `LOCALE_ID` approach, which has
`getLocaleId()` and `setLocaleId()` top-level functions for ivy (see
`core/src/render3/i18n.ts`).  In the rest of Angular (i.e. using DI) the
`LOCALE_ID` token has a provider that also calls setLocaleId() to
ensure that ivy has the same value.

This commit defines `getDocument()` and `setDocument() `top-level
functions for ivy. Wherever ivy needs the global `document`, it calls
`getDocument()` instead.  Each of the platforms (e.g. Browser, Server,
WebWorker) have providers for `DOCUMENT`. In each of those providers
they also call `setDocument()` accordingly.

Fixes #33651

PR Close #33712
2019-11-11 14:01:04 -08:00
..
brotli-cli build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
build build: remove obsolete files (#26471) 2018-10-23 08:57:41 -07:00
cjs-jasmine build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
gulp-tasks build: move clang formating out of gulp stream for cldr (#33699) 2019-11-11 09:38:58 -08:00
material-ci ci: re-enable disabled tests in material-unit-tests test blocklist (#33221) 2019-10-17 14:14:53 -04:00
ng_rollup_bundle build: fix ng_package & ng_rollup_bundle windows issues (#33607) 2019-11-06 19:56:57 +00:00
ngcontainer build: use bazel version from node modules (#26691) 2018-10-30 16:19:13 -04:00
npm style: add file header (#28871) 2019-02-28 12:06:36 -08:00
public_api_guard fix(ivy): ensure that the correct `document` is available (#33712) 2019-11-11 14:01:04 -08:00
rxjs build: update to rules_nodejs 0.32.2 (#31325) 2019-07-01 14:16:42 -07:00
size-tracking build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
source-map-test build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
symbol-extractor refactor(ivy): rename `tView.firstTemplatePass` to `tView.firstCreatePass` (#31270) 2019-11-04 21:39:23 +00:00
testing build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
ts-api-guardian build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
tslint build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
validate-commit-message build: remove the deprecated `aio` commit message scope (#32341) 2019-08-27 09:06:35 -07:00
yarn build: upgrade yarn to 1.3.2 (#21406) 2018-01-10 12:32:26 -08:00
BUILD.bazel build: add tsconfig-test to dependency for tsconfig in core/test/strict_types (#31471) 2019-07-12 11:38:16 -04:00
bazel_stamp_vars.js build: add pre-release check that validates the version name (#29551) 2019-03-27 12:26:13 -07:00
check-environment.js build: update to Node 10 (#25822) 2018-09-06 14:58:30 -07:00
defaults.bzl build: add @angular/localize to ng-update packageGroup (#33721) 2019-11-11 09:39:42 -08:00
jasmine-seed-generator.js test: run unit tests in random order (#19904) 2018-07-06 13:48:02 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
postinstall-patches.js build: remove vendored Babel typings (#33226) 2019-10-17 18:45:52 -04:00
rebase-pr.js ci: rebase PRs on target branch (#29215) 2019-03-12 11:34:58 -07:00
rollup_bundle_commonjs_ignoreGlobal.patch build: update to nodejs rules 0.37.1 (#32151) 2019-09-25 11:29:12 -07:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: ts-api-guardian tsconfig warning with bazel (#27583) 2018-12-13 11:01:48 -08:00
types.d.ts build(bazel): use bazel managed node_modules for downstream angular from source build support (#24663) 2018-07-26 17:02:21 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00
verify-codeownership.js ci: check code-ownership on CI (#32577) 2019-09-10 17:30:55 -04:00