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

📖 Fix experiment-related sample code in documentation #21031

Merged
merged 5 commits into from Feb 25, 2019

Conversation

caroqliu
Copy link
Contributor

@caroqliu caroqliu commented Feb 22, 2019

building-an-amp-extension.md provides experiment-related code snippets that cause Travis checks to fail.

  • Replace forbidden this.getWin() with this.win and incorrect user.warn() with userAssert()
  • Update imports in sample code
  • Replaces EXPERIMENT in calls to isExperimentOn() with its string literal equivalent (a required change due to check failures)

contributing/building-an-amp-extension.md Outdated Show resolved Hide resolved
contributing/building-an-amp-extension.md Outdated Show resolved Hide resolved
contributing/building-an-amp-extension.md Outdated Show resolved Hide resolved
Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

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

RE: the other PR, I think it should be userAssert, like in other live extensions with experiments enabled.

buildCallback() {
userAssert(isExperimentOn(this.win, 'amp-viz-vega'),
'Experiment amp-viz-vega disabled');

I'm not sure why the generator and documentation say that a warn is sufficient.

Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

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

LGTM!

@cvializ cvializ merged commit a691335 into ampproject:master Feb 25, 2019
@caroqliu caroqliu deleted the experiment-documentation branch February 25, 2019 21:43
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
* Replace user.warn() with userAssert in accordance with gulp test checks

* Replace userAssert() with correct usage of user().warn() to make update more similar to the original spirit of the example

* Move comment to new line

* manual lint

* Replace user().warn() with userAssert
bramanudom pushed a commit to bramanudom/amphtml that referenced this pull request Mar 22, 2019
* Replace user.warn() with userAssert in accordance with gulp test checks

* Replace userAssert() with correct usage of user().warn() to make update more similar to the original spirit of the example

* Move comment to new line

* manual lint

* Replace user().warn() with userAssert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants