I2D: Remove "prerenderSize" viewer param
There should only be two usages of prerenderSize -- 0 and 1. However, 0 doesn't work:
https://github.com/ampproject/amphtml/blob/eb3d5f37815f6e5efa5c9b63ca0128cfcc4404fa/src/service/viewer-impl.js#L150-L152
Bug: 0 || 1 == 1
Tried looking for usages of prerenderSize=0 internally and couldn't find any however, so possibly zero impact.
If so, I'd like to remove this param outright. This would simplify IntersectionObserver implementation since rootMargin is not configurable.
- Add a
dev().expectedError()to find usage ofprerenderSizevalues other than 1. - If negligible, remove code related to
prerenderSize.
/cc @ampproject/wg-runtime
/cc @dvoytenko @ampproject/wg-viewers
To my knowledge only the values of 0 and 1 were intended to be supported. Before removing 0, however, we should see if some viewers are at least attempting to use it. The result of setting this parameter is not observable to them (it's only CPU/bandwidth savings), so they'd not know it's been broken. But the intention matters here.
Agreed. Does step (1) above sound reasonable?
Add a dev().expectedError() to find usage of prerenderSize values other than 1.
I believe Google Viewer only ever set 1.
IMHO, we should just go with 0 and 1. We are fully in our power to restrict prerenderSize any way we see fit.