Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure polyfills.js is imported before anything else #13277

Merged
merged 1 commit into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -619,6 +619,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