optimizer: Do not append rtv/{rtv}/ to ampUrlPrefix#517
optimizer: Do not append rtv/{rtv}/ to ampUrlPrefix#517sebastianbenz merged 3 commits intoampproject:masterfrom mattwomple:patch-1
Conversation
|
Hm. This is confusing indeed. I'd prefer to not introduce a third parameter though. My suggestion would be: don't add the runtime version if a prefix is given. If someone wants to self-host a versioned runtime, they can append the version string to the prefix. Wdyt? |
This would absolutely be my preference as well. It is a breaking change, though. Anyone who has optimizer implemented using |
|
Yeah. I was thinking about the same. The transformer is marked as experimental since the 1.0 release so API changes are expected. I'm also not aware of anyone combining rtv + self-hosting. So I'd be OK with this change. |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
BREAKING CHANGE
When both ampUrlPrefix and ampRuntimeVersion are specified, do not
append rtv/{rtv}/ to the prefix. If version information is expected in
the URL, it can be included in ampUrlPrefix.
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
|
Sorry for the force pushes. I accidentally committed changes using a different GitHub account. |
|
Tests have been updated. This is ready for review. |
sebastianbenz
left a comment
There was a problem hiding this comment.
One nit. Otherwise LGTM
|
Why not ask callers to omit |
Setting |
|
Right, I was wondering specifically about the interaction between the two options.
Instead of making (3) behave like (2), why not ask callers to just do (2)? |
How would optimizer know which runtime version should be used for performing its optimizations? It is not safe to assume "latest RTV available on cdn.ampproject.org". Specifying both |
|
Oh, I thought that cache transforms are not pegged to RTV. E.g. if they were, it would make AMP rollbacks very tricky. /cc @ampproject/wg-caching |
|
RTV is only relevant for v0.css. The AMP runtime will download the latest v0.css in case of a version mismatch. |
|
...it does? 😛 I know runtime does this for JS (v0 vs. extension RTV mismatch) but I don't think we do this for CSS which is bundled directly in the JS. |
|
😀 |
…ct#517)" This reverts commit 9e7533c. When self-hosting, follow the same URL structure in use by cdn.ampproject.org, specifically: - Non versioned URLs: https://example.com/runtime/ - Versioned URLs: https://example.com/runtime/rtv/{rtv}/ - Runtime metadata: https://example.com/rtv/metadata
BREAKING CHANGE
When both
ampUrlPrefixandampRuntimeVersionare specified, do notappend
rtv/{rtv}/to the prefix. If version information is expected inthe URL, it can be included in
ampUrlPrefix.