Skip to content

Commit

Permalink
🏗Multi-doc manager refactor (#25629)
Browse files Browse the repository at this point in the history
* Separates multidoc-manager from the runtime

* Export installAmpdocServices

* Implements dynamic adoption of shadow mode

* Type check

* Fix type checking

* Revert dynamic adoption

* Export css dependency from multidoc-manager

* Removed dynamic asdoption of shadow mode

* Excludes inabox and video-iframe-integration from requiring Multidoc dependencies

* Type check fix
  • Loading branch information
wassgha authored Dec 10, 2019
1 parent 771fe52 commit afb060c
Show file tree
Hide file tree
Showing 6 changed files with 639 additions and 572 deletions.
2 changes: 1 addition & 1 deletion build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ const forbiddenTerms = {
'overrideVisibilityState': {
message: 'overrideVisibilityState is a restricted API.',
whitelist: [
'src/runtime.js',
'src/multidoc-manager.js',
'src/service/ampdoc-impl.js',
'src/service/viewer-impl.js',
],
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-next-page/0.1/next-page-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import {CSS} from '../../../build/amp-next-page-0.1.css';
import {MultidocManager} from '../../../src/runtime';
import {MultidocManager} from '../../../src/multidoc-manager';
import {PositionObserverFidelity} from '../../../src/service/position-observer/position-observer-worker';
import {Services} from '../../../src/services';
import {VisibilityState} from '../../../src/visibility-state';
Expand Down
4 changes: 2 additions & 2 deletions src/amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {Services} from './services';
import {adopt} from './runtime';
import {adoptWithMultidocDeps} from './runtime';
import {cssText as ampDocCss} from '../build/ampdoc.css';
import {cssText as ampSharedCss} from '../build/ampshared.css';
import {fontStylesheetTimeout} from './font-stylesheet-timeout';
Expand Down Expand Up @@ -115,7 +115,7 @@ if (shouldMainBootstrapRun) {
maybeTrackImpression(self);
});
startupChunk(self.document, function adoptWindow() {
adopt(self);
adoptWithMultidocDeps(self);
});
startupChunk(self.document, function builtins() {
// Builtins.
Expand Down
Loading

0 comments on commit afb060c

Please sign in to comment.