Skip to content

Commit

Permalink
Merge branch 'master' into amp-next-page-v2-infinite-loading
Browse files Browse the repository at this point in the history
  • Loading branch information
wassgha authored Jan 21, 2020
2 parents 6fb9245 + fc18cff commit a64afba
Show file tree
Hide file tree
Showing 125 changed files with 2,278 additions and 1,248 deletions.
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/release-tracking-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ assignees: ''
<!--
Note to onduty:
Use this issue to track a release from the initial canary release build through
production. The community uses this issue to keep track of what is going on
Use this issue to track a release from the initial experimental/beta release build through
promotion to stable and LTS. The community uses this issue to keep track of what is going on
with the release so please keep this issue up to date:
- As you reach each stage of the release, check the appropriate checkbox and replace <CL submit time> with the "Submitted" text from the corresponding CL, e.g. "2:49 PM, Jul 25, 2018 UTC-4".
Expand All @@ -23,30 +23,30 @@ with the release so please keep this issue up to date:
release number to the GitHub tag page the first time a given release number
appears in the checkboxes.
- Add any updates that may be of interest to the community (such as delays) as
comments on this issue, including after the release is pushed to production.
comments on this issue, including after the release is promoted to Stable (and, in some cases, LTS).
- Keep the title of the issue updated to reflect whether this issue is tracking
the Canary or the build in Production.
the Experimental/Beta builds or the build in Stable.
Note: remove the backticks (``) from the link.
-->

- [x] Release `[<RELEASE_NUMBER>](https://github.com/ampproject/amphtml/releases/tag/<RELEASE_NUMBER>)` is cut as a new canary release
- [ ] Release <RELEASE_NUMBER> pushed to dev channel (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> pushed to 1% (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> pushed to production (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> promoted to Experimental and Beta (opt-in) channels (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> promoted to Experimental and Beta (1% traffic) channels (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> promoted to Stable channel (<CL submit time>)

<!--
If this release will become the next LTS release, add/update the checkboxes above as needed e.g.
- [x] Release <RELEASE_NUMBER> will be the next LTS
- [ ] Release <RELEASE_NUMBER> pushed to LTS (<CL submit time>)
- [ ] Release <RELEASE_NUMBER> promoted to LTS (<CL submit time>)
If you perform cherry picks, add/update the checkboxes above as needed e.g.
- [ ] Release `[<CHERRY_PICK_RELEASE_NUMBER>](...)` created with cherry picks
- [ ] Release <CHERRY_PICK_RELEASE_NUMBER> pushed to Dev Channel
- [ ] Release <CHERRY_PICK_RELEASE_NUMBER> promoted to Experimental and Beta channels
-->

See the [release documentation](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md) for more information on the release process, including how to test changes in the Dev Channel.
See the [release documentation](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md) for more information on the release process, including how to test changes in the Experimental channel.

If you find a bug in this build, please file an [issue](https://github.com/ampproject/amphtml/issues/new). If you believe the bug should be fixed in this build, follow the instructions in the [cherry picks documentation](https://go.amp.dev/cherry-picks).
37 changes: 0 additions & 37 deletions .github/ISSUE_TEMPLATE/release_issue_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion 3p/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ Review the [ads/README](../ads/README.md) for further details on ad integration.
You should ensure there are integration tests for your extension. These should be added to the AMP
repo where it makes sense. In some cases this won't be possible because it relies on bringing up
third-party infrastructure. In these cases you should maintain testing for the extension on your
infrastructure against both production AMP and [canary](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md#amp-dev-channel).
infrastructure against both production AMP and [canary](https://github.com/ampproject/amphtml/blob/master/contributing/release-schedule.md#amp-experimental-and-beta-channels).
Upon any monitored failures, an escalation can be raised in [regular AMP communication channel](https://github.com/ampproject/amphtml/blob/master/CONTRIBUTING.md#discussion-channels).
2 changes: 0 additions & 2 deletions ads/google/a4a/line-delimited-response-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {tryParseJson} from '../../../src/json';
* @param {!Window} win
* @param {!Response} response
* @param {function(string, boolean)} lineCallback
* @private
*/
export function lineDelimitedStreamer(win, response, lineCallback) {
let line = '';
Expand Down Expand Up @@ -71,7 +70,6 @@ export function lineDelimitedStreamer(win, response, lineCallback) {
* Given each line, groups such that the first is JSON parsed and second
* html unescaped.
* @param {function(string, !Object<string, *>, boolean)} callback
* @private
* @return {function(string, boolean)}
*/
export function metaJsonCreativeGrouper(callback) {
Expand Down
15 changes: 0 additions & 15 deletions ads/yahoonativeads.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ export function yahoonativeads(global, data) {
global.publisherUrl = data.url;
global.amp = true;

global.context.observeIntersection(
entries => {
entries.forEach(entry => {
if (global.Native) {
global.Native.onViewChange({
intersectionRatio: entry.intersectionRatio,
});
}
});
},
{
threshold: [0, 0.5, 1],
}
);

loadScript(global, 'https://s.yimg.com/dy/ads/native.js', () =>
global.context.renderStart()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ module.exports = function(babel) {

/**
* @param {!NodePath} path
* @param {boolean} assertion
* @param {string|undefined} type
* @param {boolean} assertion
*/
function eliminate(path, assertion, type) {
function eliminate(path, type, assertion) {
const argument = path.get('arguments.0');
if (!argument) {
if (assertion) {
Expand Down Expand Up @@ -94,20 +94,16 @@ module.exports = function(babel) {
}
}

path.replaceWith(t.parenthesizedExpression(arg));

if (type) {
path.replaceWith(t.parenthesizedExpression(arg));
// If it starts with a capital, make the type non-nullable.
if (/^[A-Z]/.test(type)) {
type = '!' + type;
}
// Add a cast annotation to fix type.
path.addComment('leading', `* @type {${type}} `);
}

const {parenthesized} = path.node.extra || {};
if (parenthesized) {
path.replaceWith(t.parenthesizedExpression(path.node));
} else if (!assertion) {
path.replaceWith(t.parenthesizedExpression(arg));
}
}

Expand All @@ -117,7 +113,7 @@ module.exports = function(babel) {
const callee = path.get('callee');

if (callee.isIdentifier({name: 'devAssert'})) {
return eliminate(path, true, '');
return eliminate(path, '', /* assertion */ true);
}

const isMemberAndCallExpression =
Expand All @@ -144,7 +140,11 @@ module.exports = function(babel) {
}

const method = prop.node.name;
eliminate(path, method.startsWith('assert'), typeMap[method]);
eliminate(
path,
typeMap[method],
/* assertion */ method.startsWith('assert')
);
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
userAssert(1 + 1);
userAssert((2 + 2));
userAssert(dev().assert(2 + 2));
userAssert();
let result = userAssert(dev(), 'hello', 'world');
let result2 = userAssert();
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/
dev().assert(1 + 1);
dev().assert(dev().assert(2 + 2));
let result = dev().assert(dev(), 'hello', 'world');
let result = dev().assert(foo, 'hello', 'world');
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(1 + 1);
((2 + 2));
let result = (dev());
dev().assert(1 + 1);
dev().assert(dev().assert(2 + 2));
let result = dev().assert(foo, 'hello', 'world');
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/
devAssert(1 + 1);
devAssert(dev().assert(2 + 2));
let result = devAssert(dev(), 'hello', 'world');
let result = devAssert(foo, 'hello', 'world');
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(1 + 1);
((2 + 2));
let result = (dev());
devAssert(1 + 1);
devAssert(dev().assert(2 + 2));
let result = devAssert(foo, 'hello', 'world');
7 changes: 2 additions & 5 deletions build-system/compile/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,14 @@ function compile(
// it won't do strict type checking if its whitespace only.
compilerOptions.define.push('TYPECHECK_ONLY=true');
compilerOptions.jscomp_error.push(
'accessControls',
'conformanceViolations',
'checkTypes',
'const',
'constantProperty',
'globalThis'
);
compilerOptions.jscomp_off.push(
'accessControls',
'moduleLoad',
'unknownDefines'
);
compilerOptions.jscomp_off.push('moduleLoad', 'unknownDefines');
compilerOptions.conformance_configs =
'build-system/test-configs/conformance-config.textproto';
} else {
Expand Down
6 changes: 5 additions & 1 deletion build-system/externs/amp.extern.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,11 @@ let BindRescanOptionsDef;

/**
* Options bag used in Bind.setState().
* @typedef {{skipEval: (boolean|undefined), skipAmpState: (boolean|undefined)}}
* @typedef {{
* skipEval: (boolean|undefined),
* skipAmpState: (boolean|undefined),
* constrain: (Array<!Element>|undefined),
* }}
*/
let BindSetStateOptionsDef;

Expand Down
8 changes: 6 additions & 2 deletions build-system/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,11 @@ app.get(['/dist/v0/amp-*.js'], (req, res, next) => {
app.get('/test/manual/amp-video.amp.html', runVideoTestBench);

app.get(
['/examples/*.html', '/test/manual/*.html', '/test/fixtures/e2e/*/*.html'],
[
'/examples/(**/)?*.html',
'/test/manual/(**/)?*.html',
'/test/fixtures/e2e/(**/)?*.html',
],
(req, res, next) => {
const filePath = req.path;
const mode = SERVE_MODE;
Expand Down Expand Up @@ -975,7 +979,7 @@ app.get(

// Extract amp-consent for the given 'type' specified in URL query.
if (
req.path.indexOf('/examples/cmp-vendors.amp.html') == 0 &&
req.path.indexOf('/examples/amp-consent/cmp-vendors.amp.html') == 0 &&
req.query.type
) {
const consent = file.match(
Expand Down
15 changes: 12 additions & 3 deletions build-system/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const log = require('fancy-log');
const {
bootstrapThirdPartyFrames,
compileAllUnminifiedJs,
compileCoreRuntime,
printConfigHelp,
printNobuildHelp,
} = require('./helpers');
Expand All @@ -33,14 +34,16 @@ const {doServe} = require('./serve');
const {maybeUpdatePackages} = require('./update-packages');
const {parseExtensionFlags} = require('./extension-helpers');

const argv = require('minimist')(process.argv.slice(2));

/**
* Enables watching for file changes in css, extensions.
* @return {!Promise}
*/
async function watch() {
maybeUpdatePackages();
createCtrlcHandler('watch');
return performBuild(/* watch */ true);
await performBuild(/* watch */ true);
}

/**
Expand Down Expand Up @@ -88,8 +91,12 @@ async function performBuild(watch) {
printConfigHelp(watch ? 'gulp watch' : 'gulp build');
parseExtensionFlags();
await performPrerequisiteSteps(watch);
await compileAllUnminifiedJs(watch);
await buildExtensions({watch});
if (argv.core_runtime_only) {
await compileCoreRuntime(watch, /* minify */ false);
} else {
await compileAllUnminifiedJs(watch);
await buildExtensions({watch});
}
}

/**
Expand Down Expand Up @@ -122,6 +129,7 @@ build.flags = {
extensions: ' Builds only the listed extensions.',
extensions_from: ' Builds only the extensions from the listed AMP(s).',
noextensions: ' Builds with no extensions.',
core_runtime_only: ' Builds only the core runtime.',
coverage: ' Adds code coverage instrumentation to JS files using istanbul.',
};

Expand All @@ -132,6 +140,7 @@ watch.flags = {
extensions_from:
' Watches and builds only the extensions from the listed AMP(s).',
noextensions: ' Watches and builds with no extensions.',
core_runtime_only: ' Watches and builds only the core runtime.',
};

defaultTask.description =
Expand Down
23 changes: 15 additions & 8 deletions build-system/tasks/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const log = require('fancy-log');
const {
bootstrapThirdPartyFrames,
compileAllMinifiedJs,
compileCoreRuntime,
compileJs,
endBuildStep,
hostname,
Expand Down Expand Up @@ -112,11 +113,15 @@ async function dist() {

// Steps that use closure compiler. Small ones before large (parallel) ones.
await startNailgunServer(distNailgunPort, /* detached */ false);
await buildExperiments({minify: true, watch: false});
await buildLoginDone('0.1', {minify: true, watch: false});
await buildWebPushPublisherFiles({minify: true, watch: false});
await compileAllMinifiedJs();
await buildExtensions({minify: true, watch: false});
if (argv.core_runtime_only) {
await compileCoreRuntime(/* watch */ false, /* minify */ true);
} else {
await buildExperiments({minify: true, watch: false});
await buildLoginDone('0.1', {minify: true, watch: false});
await buildWebPushPublisherFiles({minify: true, watch: false});
await compileAllMinifiedJs();
await buildExtensions({minify: true, watch: false});
}
await stopNailgunServer(distNailgunPort);

if (argv.esm) {
Expand All @@ -127,9 +132,10 @@ async function dist() {
]);
}

await formatExtractedMessages();
await generateFileListing();

if (!argv.core_runtime_only) {
await formatExtractedMessages();
await generateFileListing();
}
return exitCtrlcHandler(handlerProcess);
}

Expand Down Expand Up @@ -434,6 +440,7 @@ dist.flags = {
extensions: ' Builds only the listed extensions.',
extensions_from: ' Builds only the extensions from the listed AMP(s).',
noextensions: ' Builds with no extensions.',
core_runtime_only: ' Builds only the core runtime.',
single_pass_dest:
' The directory closure compiler will write out to ' +
'with --single_pass mode. The default directory is `dist`',
Expand Down
Loading

0 comments on commit a64afba

Please sign in to comment.