Skip to content

Commit

Permalink
Make sure polyfills.js is imported before anything else (#13277)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored Feb 6, 2018
1 parent d8df163 commit 686abe4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
5 changes: 4 additions & 1 deletion 3p/ampcontext-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import './polyfills';

// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {AmpContext} from './ampcontext.js';
import {initLogConstructor, setReportError} from '../src/log';

Expand Down
5 changes: 4 additions & 1 deletion 3p/iframe-transport-client-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import './polyfills';

// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {IframeTransportClient} from './iframe-transport-client.js';
import {initLogConstructor, setReportError} from '../src/log';

Expand Down
4 changes: 3 additions & 1 deletion 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
* https://3p.ampproject.net/$version/f.js
*/

import './polyfills';
// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {AmpEvents} from '../src/amp-events';
import {
IntegrationAmpContext,
Expand Down
1 change: 1 addition & 0 deletions build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ const forbiddenTerms = {
message: 'Use a line-level "no-unused-vars" rule instead.',
whitelist: [
'viewer-api/swipe-api.js',
'dist.3p/current/integration.js',
],
},
};
Expand Down
4 changes: 3 additions & 1 deletion src/amp-shadow.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* multiple AMP Docs in Shadow DOM.
*/

import './polyfills';
// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {Services} from './services';
import {
adoptShadowMode,
Expand Down
4 changes: 3 additions & 1 deletion src/amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
* The entry point for AMP Runtime (v0.js) when AMP Runtime = AMP Doc.
*/

import './polyfills';
// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {Services} from './services';
import {adopt, installAmpdocServices, installBuiltins, installRuntimeServices} from './runtime';
import {cssText} from '../build/css';
Expand Down
5 changes: 3 additions & 2 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
* Invariant: Service getters never return null for registered services.
*/

// Requires polyfills in immediate side effect.
import './polyfills';
// src/polyfills.js must be the first import.
import './polyfills'; // eslint-disable-line sort-imports-es6-autofix/sort-imports-es6

import {dev} from './log';
import {toWin} from './types';

Expand Down

0 comments on commit 686abe4

Please sign in to comment.