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

AMP Sidebar V1: Skeleton'd the files for the feature #9784

Merged
merged 11 commits into from Jun 8, 2017

Conversation

torch2424
Copy link
Contributor

  • Added required files
  • Added gulp file rules for the new version, and alias for v0.1

This skeeletons all of the required files for amp-sidebar v1
Now the gulp file will build and look for v1.0 of sidebar
@torch2424
Copy link
Contributor Author

cc @camelburrito

@honeybadgerdontcare
Copy link
Contributor

@torch2424 may want to update the copyright dates on the files to 2017

Also, tested to ensure that the extension could be loaded and registered
successfully
@torch2424
Copy link
Contributor Author

@honeybadgerdontcare Oh yes of course, my apologies.

@@ -203,7 +203,9 @@ function getGraph(entryModule) {
*/
function getEntryModule(extensionFolder) {
// TODO (@zhouyx, #9642): Remove the special check and handle more than just 0.1
if (extensionFolder == 'extensions/amp-sticky-ad') {
if (extensionFolder == 'extensions/amp-sticky-ad' ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't do this for amp-sidebar. amp-sticky-ad is OK because 0.1 is fully deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh that makes sense! Thank you!

gulpfile.js Outdated
@@ -138,6 +138,8 @@ declareExtension('amp-viewer-integration', '0.1', {
declareExtension('amp-video', '0.1', false);
declareExtension('amp-youtube', '0.1', false);
declareExtensionVersionAlias(
'amp-sidebar', '0.1', /* lastestVersion */ '1.0', /* hasCss */ true);
Copy link
Contributor

@zhouyx zhouyx Jun 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not ok. It basic copy minimized 1.0 script to 0.1 version. Should only be added after 0.1 version is fully deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay awesome, I know things looked kinda fishy in that function, thank you!

Was my error in not realizing alias'ing was done for deprecated
extensions
Copy link
Contributor

@zhouyx zhouyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more requests.
Regarding the dep-check.js check, since you revert the change, dep-check for side-bar 1.0 does not exist. I am OK with it now since there's no actual implementation there, also #9730 will eventually fix the issue.
Another thing is I realize declareExtensionVersionAlias can be very dangerous to use. It will break an extension version, so it would be great if you can add a comment in this PR.

}
}

AMP.registerElement('amp-sidebar', AmpSidebar, CSS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I saw that in AMP sticky ad, and removed it as I didn't know if it was necessary, thank you!

@zhouyx
Copy link
Contributor

zhouyx commented Jun 8, 2017

LGTM

@@ -168,6 +168,10 @@ function declareExtension(name, version, hasCssOrOptions, opt_noTypeCheck,
}

/**
* This function is used for declaring deprecated extensions. It simply places the current
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1!

gulpfile.js Outdated
* This function is used for declaring deprecated extensions. It simply places the current
* version code in place of the latest versions.
* This has the ability to break an extension verison, so please be sure that this is
* the correct to use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "the correct one to use"?

@@ -168,6 +168,10 @@ function declareExtension(name, version, hasCssOrOptions, opt_noTypeCheck,
}

/**
* This function is used for declaring deprecated extensions. It simply places the current
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1!

Needed a different way of building the window since we are now
introducing versioning to amp-sidebar
@camelburrito camelburrito merged commit 80c5355 into ampproject:master Jun 8, 2017
@torch2424 torch2424 deleted the sidebar-v1-skeleton branch June 8, 2017 21:02
@torch2424 torch2424 added this to PRs in AMP Sidebar 1.0 Jun 23, 2017
@Gregable
Copy link
Member

These validator changes should be live everywhere within an hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

8 participants