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

Story supports-landscape attribute. #19849

Merged
merged 1 commit into from Dec 14, 2018

Conversation

gmajoulet
Copy link
Contributor

@gmajoulet gmajoulet commented Dec 12, 2018

Story supports-landscape attribute opt in and validation.
Even though the supports-portrait attribute doesn't do anything since we don't want publishers to be able to disallow portrait for now, I added it for consistency.

#19270

if (uiState !== UIType.MOBILE ||
this.getSupportedOrientations_()
.includes(ScreenOrientations.LANDSCAPE)) {
if (uiState !== UIType.MOBILE || this.isLandscapeSupported_()) {
this.storeService_.dispatch(Action.TOGGLE_LANDSCAPE, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment / todo here please? It's still a bit confusing for me to read 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.

Done

value: ""
}
attrs: {
name: "supports-portrait"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should hold off on adding this to the validation. I think it's better to add it when (if) we add validation tests & logic on the same PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think it will give us more flexibility down the line to add this to validation only when we need it

Copy link
Contributor

Choose a reason for hiding this comment

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

Validator team prefers to make things more permissive over time and not more restrictive. So I agree with holding off on adding something that is unsupported if it only gets removed later.

Copy link
Contributor

@newmuis newmuis left a comment

Choose a reason for hiding this comment

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

I'm not sure it's safe to make code changes and validation changes in the same PR, since they can roll out separately. We wouldn't want a situation where the validation changes go live before the code changes, and then the feature doesn't work as expected.

/cc @Gregable to make sure that I'm not just spewing nonsense

value: ""
}
attrs: {
name: "supports-portrait"
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I think it will give us more flexibility down the line to add this to validation only when we need it

@honeybadgerdontcare
Copy link
Contributor

@newmuis It's not nonsense but we haven't paid much attention to it as an issue to be concerned with. Typically most code features are behind experimental to start, not sure if that's the case here. That means validation can go in but the feature is documented as experimental. Does that only work at the component level or can it work for parts of the component?

@gmajoulet gmajoulet force-pushed the supports_landscape branch 2 times, most recently from 2901e95 to 1aa9859 Compare December 13, 2018 18:52
@gmajoulet
Copy link
Contributor Author

I created #19872 for the validation rules.

PTAL

@gmajoulet gmajoulet force-pushed the supports_landscape branch 2 times, most recently from f7e7d20 to 3f01849 Compare December 13, 2018 21:54
@gmajoulet gmajoulet merged commit dad1e44 into ampproject:master Dec 14, 2018
cathyxz pushed a commit to cathyxz/amphtml that referenced this pull request Dec 17, 2018
bramanudom pushed a commit to bramanudom/amphtml that referenced this pull request Dec 19, 2018
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
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

5 participants