From 7b70760c8d4f69c498dc4a028beb6dda53acbcbe Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Mon, 11 Mar 2019 19:20:40 -0500 Subject: [PATCH] refactor: move DOCUMENT imports from platform-browser to common (#29237) PR Close #29237 --- packages/common/src/viewport_scroller.ts | 2 +- packages/core/test/application_ref_spec.ts | 2 +- packages/core/test/linker/integration_spec.ts | 3 +-- packages/core/test/linker/regression_integration_spec.ts | 5 +++-- packages/platform-browser-dynamic/testing/BUILD.bazel | 1 + .../testing/src/dom_test_component_renderer.ts | 3 ++- .../platform-browser/animations/src/animation_builder.ts | 2 +- packages/platform-browser/src/browser.ts | 3 +-- .../src/browser/location/browser_platform_location.ts | 3 +-- packages/platform-browser/src/browser/meta.ts | 2 +- .../platform-browser/src/browser/server-transition.ts | 2 +- packages/platform-browser/src/browser/title.ts | 2 +- packages/platform-browser/src/browser/transfer_state.ts | 2 +- packages/platform-browser/src/dom/events/dom_events.ts | 5 +---- .../platform-browser/src/dom/events/hammer_gestures.ts | 3 +-- packages/platform-browser/src/dom/events/key_events.ts | 2 +- packages/platform-browser/src/dom/shared_styles_host.ts | 2 +- .../src/security/dom_sanitization_service.ts | 2 +- packages/platform-browser/test/browser/bootstrap_spec.ts | 5 ++--- .../platform-browser/test/browser/transfer_state_spec.ts | 3 +-- packages/platform-server/src/location.ts | 4 ++-- packages/platform-server/src/platform_state.ts | 2 +- packages/platform-server/src/server.ts | 6 +++--- packages/platform-server/src/server_events.ts | 3 ++- packages/platform-server/src/server_renderer.ts | 5 +++-- packages/platform-server/src/styles_host.ts | 5 +++-- packages/platform-server/src/transfer_state.ts | 3 ++- packages/platform-server/test/integration_spec.ts | 8 ++++---- packages/platform-webworker/src/worker_app.ts | 4 ++-- packages/platform-webworker/src/worker_render.ts | 6 +++--- packages/router/test/bootstrap.spec.ts | 6 +++--- 31 files changed, 52 insertions(+), 54 deletions(-) diff --git a/packages/common/src/viewport_scroller.ts b/packages/common/src/viewport_scroller.ts index 8c332872a5..d4b8b5f128 100644 --- a/packages/common/src/viewport_scroller.ts +++ b/packages/common/src/viewport_scroller.ts @@ -186,4 +186,4 @@ export class NullViewportScroller implements ViewportScroller { * Empty implementation */ setHistoryScrollRestoration(scrollRestoration: 'auto'|'manual'): void {} -} \ No newline at end of file +} diff --git a/packages/core/test/application_ref_spec.ts b/packages/core/test/application_ref_spec.ts index 39034d1789..8a56680ec3 100644 --- a/packages/core/test/application_ref_spec.ts +++ b/packages/core/test/application_ref_spec.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {ResourceLoader} from '@angular/compiler'; import {APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, Compiler, CompilerFactory, Component, InjectionToken, NgModule, NgZone, PlatformRef, TemplateRef, Type, ViewChild, ViewContainerRef} from '@angular/core'; import {ApplicationRef} from '@angular/core/src/application_ref'; @@ -13,7 +14,6 @@ import {ErrorHandler} from '@angular/core/src/error_handler'; import {ComponentRef} from '@angular/core/src/linker/component_factory'; import {BrowserModule} from '@angular/platform-browser'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens'; import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util'; import {expect} from '@angular/platform-browser/testing/src/matchers'; import {ivyEnabled} from '@angular/private/testing'; diff --git a/packages/core/test/linker/integration_spec.ts b/packages/core/test/linker/integration_spec.ts index 992a013568..140dd9f776 100644 --- a/packages/core/test/linker/integration_spec.ts +++ b/packages/core/test/linker/integration_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {CommonModule} from '@angular/common'; +import {CommonModule, DOCUMENT} from '@angular/common'; import {Compiler, ComponentFactory, ComponentRef, ErrorHandler, EventEmitter, Host, Inject, Injectable, InjectionToken, Injector, NO_ERRORS_SCHEMA, NgModule, NgModuleRef, OnDestroy, SkipSelf, ViewRef, ɵivyEnabled as ivyEnabled} from '@angular/core'; import {ChangeDetectionStrategy, ChangeDetectorRef, PipeTransform} from '@angular/core/src/change_detection/change_detection'; import {getDebugContext} from '@angular/core/src/errors'; @@ -19,7 +19,6 @@ import {EmbeddedViewRef} from '@angular/core/src/linker/view_ref'; import {Attribute, Component, ContentChildren, Directive, HostBinding, HostListener, Input, Output, Pipe} from '@angular/core/src/metadata'; import {TestBed, async, fakeAsync, getTestBed, tick} from '@angular/core/testing'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens'; import {dispatchEvent, el} from '@angular/platform-browser/testing/src/browser_util'; import {expect} from '@angular/platform-browser/testing/src/matchers'; import {modifiedInIvy, obsoleteInIvy, onlyInIvy} from '@angular/private/testing'; diff --git a/packages/core/test/linker/regression_integration_spec.ts b/packages/core/test/linker/regression_integration_spec.ts index 8c19283f64..502e16734d 100644 --- a/packages/core/test/linker/regression_integration_spec.ts +++ b/packages/core/test/linker/regression_integration_spec.ts @@ -6,13 +6,14 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {ANALYZE_FOR_ENTRY_COMPONENTS, ApplicationRef, Component, ComponentRef, ContentChild, Directive, ErrorHandler, EventEmitter, HostListener, InjectionToken, Injector, Input, NgModule, NgModuleRef, NgZone, Output, Pipe, PipeTransform, Provider, QueryList, Renderer2, SimpleChanges, TemplateRef, ViewChild, ViewChildren, ViewContainerRef, destroyPlatform, ɵivyEnabled as ivyEnabled} from '@angular/core'; import {TestBed, fakeAsync, inject, tick} from '@angular/core/testing'; -import {BrowserModule, By, DOCUMENT} from '@angular/platform-browser'; +import {BrowserModule, By} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {expect} from '@angular/platform-browser/testing/src/matchers'; -import {fixmeIvy, modifiedInIvy, onlyInIvy} from '@angular/private/testing'; +import {modifiedInIvy, onlyInIvy} from '@angular/private/testing'; if (ivyEnabled) { describe('ivy', () => { declareTests(); }); diff --git a/packages/platform-browser-dynamic/testing/BUILD.bazel b/packages/platform-browser-dynamic/testing/BUILD.bazel index d3afe37233..78c1415404 100644 --- a/packages/platform-browser-dynamic/testing/BUILD.bazel +++ b/packages/platform-browser-dynamic/testing/BUILD.bazel @@ -8,6 +8,7 @@ ng_module( name = "testing", srcs = glob(["**/*.ts"]), deps = [ + "//packages/common", "//packages/compiler", "//packages/compiler/testing", "//packages/core", diff --git a/packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts b/packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts index 12eea18d45..c22a2abf2f 100644 --- a/packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts +++ b/packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts @@ -6,9 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable} from '@angular/core'; import {TestComponentRenderer} from '@angular/core/testing'; -import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {ɵgetDOM as getDOM} from '@angular/platform-browser'; /** * A DOM based implementation of the TestComponentRenderer. diff --git a/packages/platform-browser/animations/src/animation_builder.ts b/packages/platform-browser/animations/src/animation_builder.ts index f0022d711d..2028af8bbb 100644 --- a/packages/platform-browser/animations/src/animation_builder.ts +++ b/packages/platform-browser/animations/src/animation_builder.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ import {AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, sequence} from '@angular/animations'; +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, RendererFactory2, RendererType2, ViewEncapsulation} from '@angular/core'; -import {DOCUMENT} from '@angular/platform-browser'; import {AnimationRenderer} from './animation_renderer'; diff --git a/packages/platform-browser/src/browser.ts b/packages/platform-browser/src/browser.ts index 87b879e4a9..6dca490236 100644 --- a/packages/platform-browser/src/browser.ts +++ b/packages/platform-browser/src/browser.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {CommonModule, PlatformLocation, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common'; +import {CommonModule, DOCUMENT, PlatformLocation, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common'; import {APP_ID, ApplicationModule, ErrorHandler, Inject, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, RendererFactory2, Sanitizer, SkipSelf, StaticProvider, Testability, createPlatformFactory, platformCore, ɵAPP_ROOT as APP_ROOT, ɵConsole as Console} from '@angular/core'; import {BrowserDomAdapter} from './browser/browser_adapter'; @@ -15,7 +15,6 @@ import {SERVER_TRANSITION_PROVIDERS, TRANSITION_ID} from './browser/server-trans import {BrowserGetTestability} from './browser/testability'; import {ELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe'; import {DomRendererFactory2} from './dom/dom_renderer'; -import {DOCUMENT} from './dom/dom_tokens'; import {DomEventsPlugin} from './dom/events/dom_events'; import {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager'; import {HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerGesturesPlugin} from './dom/events/hammer_gestures'; diff --git a/packages/platform-browser/src/browser/location/browser_platform_location.ts b/packages/platform-browser/src/browser/location/browser_platform_location.ts index a9708b16b0..274df1aa88 100644 --- a/packages/platform-browser/src/browser/location/browser_platform_location.ts +++ b/packages/platform-browser/src/browser/location/browser_platform_location.ts @@ -6,11 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ -import {LocationChangeListener, PlatformLocation} from '@angular/common'; +import {DOCUMENT, LocationChangeListener, PlatformLocation} from '@angular/common'; import {Inject, Injectable} from '@angular/core'; import {getDOM} from '../../dom/dom_adapter'; -import {DOCUMENT} from '../../dom/dom_tokens'; import {supportsState} from './history'; diff --git a/packages/platform-browser/src/browser/meta.ts b/packages/platform-browser/src/browser/meta.ts index b95ee846f7..2b8b30d041 100644 --- a/packages/platform-browser/src/browser/meta.ts +++ b/packages/platform-browser/src/browser/meta.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, inject} from '@angular/core'; import {DomAdapter, getDOM} from '../dom/dom_adapter'; -import {DOCUMENT} from '../dom/dom_tokens'; diff --git a/packages/platform-browser/src/browser/server-transition.ts b/packages/platform-browser/src/browser/server-transition.ts index fde6a705f7..cba20616ed 100644 --- a/packages/platform-browser/src/browser/server-transition.ts +++ b/packages/platform-browser/src/browser/server-transition.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {APP_INITIALIZER, ApplicationInitStatus, Inject, InjectionToken, Injector, StaticProvider} from '@angular/core'; import {getDOM} from '../dom/dom_adapter'; -import {DOCUMENT} from '../dom/dom_tokens'; /** * An id that identifies a particular application being bootstrapped, that should diff --git a/packages/platform-browser/src/browser/title.ts b/packages/platform-browser/src/browser/title.ts index 297aa33438..83a2bb2c2f 100644 --- a/packages/platform-browser/src/browser/title.ts +++ b/packages/platform-browser/src/browser/title.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, inject} from '@angular/core'; import {getDOM} from '../dom/dom_adapter'; -import {DOCUMENT} from '../dom/dom_tokens'; /** * Factory to create Title service. diff --git a/packages/platform-browser/src/browser/transfer_state.ts b/packages/platform-browser/src/browser/transfer_state.ts index 8b10dad22a..a9bf935df5 100644 --- a/packages/platform-browser/src/browser/transfer_state.ts +++ b/packages/platform-browser/src/browser/transfer_state.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {APP_ID, Injectable, NgModule} from '@angular/core'; -import {DOCUMENT} from '../dom/dom_tokens'; export function escapeHtml(text: string): string { const escapedText: {[k: string]: string} = { diff --git a/packages/platform-browser/src/dom/events/dom_events.ts b/packages/platform-browser/src/dom/events/dom_events.ts index 4e1895adba..9684bcd252 100644 --- a/packages/platform-browser/src/dom/events/dom_events.ts +++ b/packages/platform-browser/src/dom/events/dom_events.ts @@ -6,12 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {isPlatformServer} from '@angular/common'; +import {DOCUMENT, isPlatformServer} from '@angular/common'; import {Inject, Injectable, NgZone, Optional, PLATFORM_ID} from '@angular/core'; - -import {DOCUMENT} from '../dom_tokens'; - import {EventManagerPlugin} from './event_manager'; /** diff --git a/packages/platform-browser/src/dom/events/hammer_gestures.ts b/packages/platform-browser/src/dom/events/hammer_gestures.ts index 9781bca718..a1be88cc05 100644 --- a/packages/platform-browser/src/dom/events/hammer_gestures.ts +++ b/packages/platform-browser/src/dom/events/hammer_gestures.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, InjectionToken, Optional, ɵConsole as Console} from '@angular/core'; -import {DOCUMENT} from '../dom_tokens'; - import {EventManagerPlugin} from './event_manager'; /** diff --git a/packages/platform-browser/src/dom/events/key_events.ts b/packages/platform-browser/src/dom/events/key_events.ts index 37bdd4b2bc..b51a3368c1 100644 --- a/packages/platform-browser/src/dom/events/key_events.ts +++ b/packages/platform-browser/src/dom/events/key_events.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, NgZone} from '@angular/core'; import {getDOM} from '../dom_adapter'; -import {DOCUMENT} from '../dom_tokens'; import {EventManagerPlugin} from './event_manager'; diff --git a/packages/platform-browser/src/dom/shared_styles_host.ts b/packages/platform-browser/src/dom/shared_styles_host.ts index 097e036fb8..4c5662e406 100644 --- a/packages/platform-browser/src/dom/shared_styles_host.ts +++ b/packages/platform-browser/src/dom/shared_styles_host.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, OnDestroy} from '@angular/core'; import {getDOM} from './dom_adapter'; -import {DOCUMENT} from './dom_tokens'; @Injectable() export class SharedStylesHost { diff --git a/packages/platform-browser/src/security/dom_sanitization_service.ts b/packages/platform-browser/src/security/dom_sanitization_service.ts index c0ac08fa8e..12a86bd118 100644 --- a/packages/platform-browser/src/security/dom_sanitization_service.ts +++ b/packages/platform-browser/src/security/dom_sanitization_service.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable, Sanitizer, SecurityContext, ɵ_sanitizeHtml as _sanitizeHtml, ɵ_sanitizeStyle as _sanitizeStyle, ɵ_sanitizeUrl as _sanitizeUrl} from '@angular/core'; -import {DOCUMENT} from '../dom/dom_tokens'; export {SecurityContext}; diff --git a/packages/platform-browser/test/browser/bootstrap_spec.ts b/packages/platform-browser/test/browser/bootstrap_spec.ts index 94d5c3fd3f..d1f938742c 100644 --- a/packages/platform-browser/test/browser/bootstrap_spec.ts +++ b/packages/platform-browser/test/browser/bootstrap_spec.ts @@ -6,17 +6,16 @@ * found in the LICENSE file at https://angular.io/license */ -import {isPlatformBrowser} from '@angular/common'; +import {DOCUMENT, isPlatformBrowser} from '@angular/common'; import {APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Compiler, Component, Directive, ErrorHandler, Inject, Input, LOCALE_ID, NgModule, OnDestroy, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, Provider, StaticProvider, Type, VERSION, createPlatformFactory} from '@angular/core'; import {ApplicationRef, destroyPlatform} from '@angular/core/src/application_ref'; import {Console} from '@angular/core/src/console'; import {ComponentRef} from '@angular/core/src/linker/component_factory'; import {Testability, TestabilityRegistry} from '@angular/core/src/testability/testability'; -import {AsyncTestCompleter, Log, afterEach, beforeEach, beforeEachProviders, describe, fit, inject, it} from '@angular/core/testing/src/testing_internal'; +import {AsyncTestCompleter, Log, afterEach, beforeEach, beforeEachProviders, describe, inject, it} from '@angular/core/testing/src/testing_internal'; import {BrowserModule} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens'; import {expect} from '@angular/platform-browser/testing/src/matchers'; import {ivyEnabled, modifiedInIvy, onlyInIvy} from '@angular/private/testing'; diff --git a/packages/platform-browser/test/browser/transfer_state_spec.ts b/packages/platform-browser/test/browser/transfer_state_spec.ts index d7dae0b4ec..a204a97204 100644 --- a/packages/platform-browser/test/browser/transfer_state_spec.ts +++ b/packages/platform-browser/test/browser/transfer_state_spec.ts @@ -6,11 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ - +import {DOCUMENT} from '@angular/common'; import {TestBed} from '@angular/core/testing'; import {BrowserModule, BrowserTransferStateModule, TransferState} from '@angular/platform-browser'; import {StateKey, escapeHtml, makeStateKey, unescapeHtml} from '@angular/platform-browser/src/browser/transfer_state'; -import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens'; (function() { function removeScriptTag(doc: Document, id: string) { diff --git a/packages/platform-server/src/location.ts b/packages/platform-server/src/location.ts index d7dbcb2df8..5f337110ee 100644 --- a/packages/platform-server/src/location.ts +++ b/packages/platform-server/src/location.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {LocationChangeEvent, LocationChangeListener, PlatformLocation} from '@angular/common'; +import {DOCUMENT, LocationChangeEvent, LocationChangeListener, PlatformLocation} from '@angular/common'; import {Inject, Injectable, Optional} from '@angular/core'; -import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {ɵgetDOM as getDOM} from '@angular/platform-browser'; import {Subject} from 'rxjs'; import * as url from 'url'; import {INITIAL_CONFIG, PlatformConfig} from './tokens'; diff --git a/packages/platform-server/src/platform_state.ts b/packages/platform-server/src/platform_state.ts index c29cb55ffb..73ecd298ec 100644 --- a/packages/platform-server/src/platform_state.ts +++ b/packages/platform-server/src/platform_state.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable} from '@angular/core'; -import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; import {serializeDocument} from './domino_adapter'; diff --git a/packages/platform-server/src/server.ts b/packages/platform-server/src/server.ts index bd3b6bd45e..a8a9cbed83 100644 --- a/packages/platform-server/src/server.ts +++ b/packages/platform-server/src/server.ts @@ -7,11 +7,11 @@ */ import {ɵAnimationEngine} from '@angular/animations/browser'; -import {PlatformLocation, ViewportScroller, ɵNullViewportScroller as NullViewportScroller, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common'; +import {DOCUMENT, PlatformLocation, ViewportScroller, ɵNullViewportScroller as NullViewportScroller, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common'; import {HttpClientModule} from '@angular/common/http'; -import {Injectable, InjectionToken, Injector, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, Provider, RendererFactory2, RootRenderer, StaticProvider, Testability, createPlatformFactory, isDevMode, platformCore, ɵALLOW_MULTIPLE_PLATFORMS as ALLOW_MULTIPLE_PLATFORMS} from '@angular/core'; +import {Injectable, InjectionToken, Injector, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, Provider, RendererFactory2, RootRenderer, StaticProvider, Testability, createPlatformFactory, platformCore, ɵALLOW_MULTIPLE_PLATFORMS as ALLOW_MULTIPLE_PLATFORMS} from '@angular/core'; import {HttpModule} from '@angular/http'; -import {BrowserModule, DOCUMENT, EVENT_MANAGER_PLUGINS, ɵSharedStylesHost as SharedStylesHost, ɵTRANSITION_ID, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {BrowserModule, EVENT_MANAGER_PLUGINS, ɵSharedStylesHost as SharedStylesHost, ɵgetDOM as getDOM} from '@angular/platform-browser'; import {ɵplatformCoreDynamic as platformCoreDynamic} from '@angular/platform-browser-dynamic'; import {NoopAnimationsModule, ɵAnimationRendererFactory} from '@angular/platform-browser/animations'; diff --git a/packages/platform-server/src/server_events.ts b/packages/platform-server/src/server_events.ts index 25598633a9..15afdcef8b 100644 --- a/packages/platform-server/src/server_events.ts +++ b/packages/platform-server/src/server_events.ts @@ -6,8 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {Inject, Injectable} from '@angular/core'; -import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {ɵgetDOM as getDOM} from '@angular/platform-browser'; @Injectable() export class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ { diff --git a/packages/platform-server/src/server_renderer.ts b/packages/platform-server/src/server_renderer.ts index f4901fd2d3..e2c2c69dad 100644 --- a/packages/platform-server/src/server_renderer.ts +++ b/packages/platform-server/src/server_renderer.ts @@ -6,9 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {DomElementSchemaRegistry} from '@angular/compiler'; -import {APP_ID, Inject, Injectable, NgZone, RenderComponentType, Renderer, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, RootRenderer, ViewEncapsulation, ɵstringify as stringify} from '@angular/core'; -import {DOCUMENT, EventManager, ɵNAMESPACE_URIS as NAMESPACE_URIS, ɵSharedStylesHost as SharedStylesHost, ɵflattenStyles as flattenStyles, ɵgetDOM as getDOM, ɵshimContentAttribute as shimContentAttribute, ɵshimHostAttribute as shimHostAttribute} from '@angular/platform-browser'; +import {Inject, Injectable, NgZone, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, ViewEncapsulation} from '@angular/core'; +import {EventManager, ɵNAMESPACE_URIS as NAMESPACE_URIS, ɵSharedStylesHost as SharedStylesHost, ɵflattenStyles as flattenStyles, ɵgetDOM as getDOM, ɵshimContentAttribute as shimContentAttribute, ɵshimHostAttribute as shimHostAttribute} from '@angular/platform-browser'; const EMPTY_ARRAY: any[] = []; diff --git a/packages/platform-server/src/styles_host.ts b/packages/platform-server/src/styles_host.ts index fa19f0faeb..2cec205732 100644 --- a/packages/platform-server/src/styles_host.ts +++ b/packages/platform-server/src/styles_host.ts @@ -6,8 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {ApplicationRef, Inject, Injectable, Optional} from '@angular/core'; -import {DOCUMENT, ɵDomAdapter as DomAdapter, ɵSharedStylesHost as SharedStylesHost, ɵTRANSITION_ID, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {DOCUMENT} from '@angular/common'; +import {Inject, Injectable, Optional} from '@angular/core'; +import {ɵSharedStylesHost as SharedStylesHost, ɵTRANSITION_ID, ɵgetDOM as getDOM} from '@angular/platform-browser'; @Injectable() export class ServerStylesHost extends SharedStylesHost { diff --git a/packages/platform-server/src/transfer_state.ts b/packages/platform-server/src/transfer_state.ts index a800efe2ad..eba3b60f2e 100644 --- a/packages/platform-server/src/transfer_state.ts +++ b/packages/platform-server/src/transfer_state.ts @@ -6,8 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ +import {DOCUMENT} from '@angular/common'; import {APP_ID, NgModule} from '@angular/core'; -import {DOCUMENT, TransferState, ɵescapeHtml as escapeHtml} from '@angular/platform-browser'; +import {TransferState, ɵescapeHtml as escapeHtml} from '@angular/platform-browser'; import {BEFORE_APP_SERIALIZED} from './tokens'; diff --git a/packages/platform-server/test/integration_spec.ts b/packages/platform-server/test/integration_spec.ts index 5c364efd85..e1831fcaa5 100644 --- a/packages/platform-server/test/integration_spec.ts +++ b/packages/platform-server/test/integration_spec.ts @@ -7,17 +7,17 @@ */ import {AnimationBuilder, animate, state, style, transition, trigger} from '@angular/animations'; -import {PlatformLocation, isPlatformServer} from '@angular/common'; +import {DOCUMENT, PlatformLocation, isPlatformServer} from '@angular/common'; import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; -import {ApplicationRef, CompilerFactory, Component, HostListener, Inject, Injectable, Input, NgModule, NgModuleRef, NgZone, PLATFORM_ID, PlatformRef, ViewEncapsulation, destroyPlatform, getPlatform} from '@angular/core'; +import {ApplicationRef, CompilerFactory, Component, HostListener, Inject, Injectable, Input, NgModule, NgZone, PLATFORM_ID, PlatformRef, ViewEncapsulation, destroyPlatform, getPlatform} from '@angular/core'; import {async, inject} from '@angular/core/testing'; import {Http, HttpModule, Response, ResponseOptions, XHRBackend} from '@angular/http'; import {MockBackend, MockConnection} from '@angular/http/testing'; -import {BrowserModule, DOCUMENT, Title, TransferState, makeStateKey} from '@angular/platform-browser'; +import {BrowserModule, Title, TransferState, makeStateKey} from '@angular/platform-browser'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState, ServerModule, ServerTransferStateModule, platformDynamicServer, renderModule, renderModuleFactory} from '@angular/platform-server'; -import {fixmeIvy, ivyEnabled, modifiedInIvy} from '@angular/private/testing'; +import {ivyEnabled, modifiedInIvy} from '@angular/private/testing'; import {Observable} from 'rxjs'; import {first} from 'rxjs/operators'; diff --git a/packages/platform-webworker/src/worker_app.ts b/packages/platform-webworker/src/worker_app.ts index bee58e6296..061ca060ee 100644 --- a/packages/platform-webworker/src/worker_app.ts +++ b/packages/platform-webworker/src/worker_app.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {CommonModule, ViewportScroller, ɵNullViewportScroller as NullViewportScroller, ɵPLATFORM_WORKER_APP_ID as PLATFORM_WORKER_APP_ID} from '@angular/common'; +import {CommonModule, DOCUMENT, ViewportScroller, ɵNullViewportScroller as NullViewportScroller, ɵPLATFORM_WORKER_APP_ID as PLATFORM_WORKER_APP_ID} from '@angular/common'; import {APP_INITIALIZER, ApplicationModule, ErrorHandler, NgModule, NgZone, PLATFORM_ID, PlatformRef, RendererFactory2, RootRenderer, StaticProvider, createPlatformFactory, platformCore, ɵAPP_ROOT as APP_ROOT} from '@angular/core'; -import {DOCUMENT, ɵBROWSER_SANITIZATION_PROVIDERS as BROWSER_SANITIZATION_PROVIDERS} from '@angular/platform-browser'; +import {ɵBROWSER_SANITIZATION_PROVIDERS as BROWSER_SANITIZATION_PROVIDERS} from '@angular/platform-browser'; import {ON_WEB_WORKER} from './web_workers/shared/api'; import {ClientMessageBrokerFactory} from './web_workers/shared/client_message_broker'; diff --git a/packages/platform-webworker/src/worker_render.ts b/packages/platform-webworker/src/worker_render.ts index e4d59fb966..f5b3ea5e27 100644 --- a/packages/platform-webworker/src/worker_render.ts +++ b/packages/platform-webworker/src/worker_render.ts @@ -6,9 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {CommonModule, ɵPLATFORM_WORKER_UI_ID as PLATFORM_WORKER_UI_ID} from '@angular/common'; -import {ErrorHandler, Injectable, InjectionToken, Injector, NgZone, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, RendererFactory2, RootRenderer, StaticProvider, Testability, createPlatformFactory, isDevMode, platformCore, ɵAPP_ID_RANDOM_PROVIDER as APP_ID_RANDOM_PROVIDER} from '@angular/core'; -import {DOCUMENT, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HammerGestureConfig, ɵBROWSER_SANITIZATION_PROVIDERS as BROWSER_SANITIZATION_PROVIDERS, ɵBrowserDomAdapter as BrowserDomAdapter, ɵBrowserGetTestability as BrowserGetTestability, ɵDomEventsPlugin as DomEventsPlugin, ɵDomRendererFactory2 as DomRendererFactory2, ɵDomSharedStylesHost as DomSharedStylesHost, ɵHammerGesturesPlugin as HammerGesturesPlugin, ɵKeyEventsPlugin as KeyEventsPlugin, ɵSharedStylesHost as SharedStylesHost, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {DOCUMENT, ɵPLATFORM_WORKER_UI_ID as PLATFORM_WORKER_UI_ID} from '@angular/common'; +import {ErrorHandler, Injectable, InjectionToken, Injector, NgZone, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, RendererFactory2, StaticProvider, Testability, createPlatformFactory, isDevMode, platformCore, ɵAPP_ID_RANDOM_PROVIDER as APP_ID_RANDOM_PROVIDER} from '@angular/core'; +import {EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HammerGestureConfig, ɵBROWSER_SANITIZATION_PROVIDERS as BROWSER_SANITIZATION_PROVIDERS, ɵBrowserDomAdapter as BrowserDomAdapter, ɵBrowserGetTestability as BrowserGetTestability, ɵDomEventsPlugin as DomEventsPlugin, ɵDomRendererFactory2 as DomRendererFactory2, ɵDomSharedStylesHost as DomSharedStylesHost, ɵHammerGesturesPlugin as HammerGesturesPlugin, ɵKeyEventsPlugin as KeyEventsPlugin, ɵSharedStylesHost as SharedStylesHost} from '@angular/platform-browser'; import {ON_WEB_WORKER} from './web_workers/shared/api'; import {ClientMessageBrokerFactory} from './web_workers/shared/client_message_broker'; diff --git a/packages/router/test/bootstrap.spec.ts b/packages/router/test/bootstrap.spec.ts index 634990a749..ea649d56a6 100644 --- a/packages/router/test/bootstrap.spec.ts +++ b/packages/router/test/bootstrap.spec.ts @@ -6,12 +6,12 @@ * found in the LICENSE file at https://angular.io/license */ -import {APP_BASE_HREF, Location, ViewportScroller} from '@angular/common'; +import {APP_BASE_HREF, DOCUMENT, Location} from '@angular/common'; import {ApplicationRef, CUSTOM_ELEMENTS_SCHEMA, Component, NgModule, destroyPlatform} from '@angular/core'; import {inject} from '@angular/core/testing'; -import {BrowserModule, DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; +import {BrowserModule, ɵgetDOM as getDOM} from '@angular/platform-browser'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -import {NavigationEnd, NavigationStart, Resolve, Router, RouterModule} from '@angular/router'; +import {NavigationEnd, Resolve, Router, RouterModule} from '@angular/router'; import {filter, first} from 'rxjs/operators'; describe('bootstrap', () => {