Skip to content

Conversation

newmuis
Copy link
Contributor

@newmuis newmuis commented Apr 4, 2018

This is a first step towards fixing #14357. We move amp-story from 0.1 => 1.0, aliasing 0.1 as 1.0. As a separate PR, we will copy 1.0 back to 0.1 to freeze it; this extra step is necessary to retain history properly.

@honeybadgerdontcare
Copy link
Contributor

@newmuis You mention aliasing 0.1 as 1.0 but then mention copying 1.0 back to 0.1. Will it not remain an alias at that point (e.g. both 0.1 and 1.0 serve the same code)?

beforeEach(() => {
win = env.win;
element = win.document.createElement('amp-story');
// element.getAmpDoc = () => env.ampdoc;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@choumx @erwinmombay mocking this all seems to work, but seems odd to have to do

@newmuis
Copy link
Contributor Author

newmuis commented Apr 4, 2018

@honeybadgerdontcare we will remove the alias and continue development on 1.0 and not 0.1, so they will diverge over time.

@gmajoulet
Copy link
Contributor

The tests are failing because they keep loading the 0.1 version of the amp-story extension.

As per https://github.com/ampproject/amphtml/blob/master/testing/describes.js#L692, unless you provide a specific extension version, it always use 0.1.

To fix the tests, we need to change extensions: ['amp-story'] to extensions: ['amp-story:1.0'] in test-amp-story.js.

describes.realWin('amp-story', {
  amp: {
    runtimeOn: true,
    extensions: ['amp-story'],
  },
}, env => {});

with

describes.realWin('amp-story', {
  amp: {
    runtimeOn: true,
    extensions: ['amp-story:1.0'],
  },
}, env => {});

@newmuis
Copy link
Contributor Author

newmuis commented Apr 10, 2018

Thanks @gmajoulet for tracking this down!

@@ -0,0 +1,453 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this file (+ its CSS and test files) got deleted, should we remove them from this migration?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we also have references to the 0.1 version is this new https://github.com/ampproject/amphtml/blob/master/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads.js file

@newmuis
Copy link
Contributor Author

newmuis commented Apr 12, 2018

@honeybadgerdontcare can you verify the validator changes?

@honeybadgerdontcare
Copy link
Contributor

@newmuis github is saying theres conflicts for the test validator files, can you fix?

the protoascii change looks fine. if/when 1.0 starts to drift from 0.1 we may need to be thoughtful on how to split up the extension script for 0.1 and 1.0 as I imagine 1.0 usage attributes may change and we'll want that tag usage to rely on 1.0 extension and not 0.1 extension.

@newmuis
Copy link
Contributor Author

newmuis commented Apr 12, 2018

Resolved the validation merge conflicts. Any other feedback @honeybadgerdontcare or @choumx?

<script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
<script async custom-element="amp-audio" src="https://cdn.ampproject.org/v0/amp-audio-0.1.js"></script>
<script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-0.1.js"></script>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

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

is it intentional to remove amp-analytics here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, amp-analytics is unused in this example.

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

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

validator changes look good

@newmuis newmuis merged commit 448df6f into ampproject:master Apr 14, 2018
glevitzky pushed a commit that referenced this pull request Apr 27, 2018
* Fork to 1.0

* Migrate request service and change examples

* Update AMP.registerElement calls to be in AMP.extension callback.

* Add back 0.1 version to validator

* Update test-amp-story to use 1.0

* Update origin whitelist and amp-story-cta-layer tests to use 1.0 of the amp-story extension.

* Update amp-story-auto-ads's amp-story deps to 1.0

* Update missing 0.1 => 1.0 renames

* Change forbidden dep whitelist to use amp-story 1.0.

* Move added files

* Update test-full-bleed-animations to use 1.0

* Update validator out file error file paths to 1.0
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.

4 participants