-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add URLs for beta and experimental release channels (as was done for LTS) #27267
Description
This was originally raised in #24731 which allowed (and recommends) adding crossorigin=anonymous to all CDN scripts. This is important for a service worker to be able to cache resources. In fact, @jridgewell actually indicated this should be part of the boilerplate code going forward:
Turns out,
crossorigin=anonymousis a requirement for us to receive error reports from the runtime. We should begin the process to make this a mandatory part of the boilerplate (giving people enough time to migrate, of course).
One concern that @choumx raised about this was:
The one issue I can see is that dev channel won't work since cookies won't be sent in anonymous mode.
If crossorigin=anonymous then is standard, then the cookie-based opt-in to beta/experimental channel won't work anymore.
So this brought to mind the new LTS channel which has a dedicated LTS-specific base URL which is distinct from the stable channel. Should there actually be distinct channels for experimental and beta as well to avoid the required dependency on cookies to opt-in? I can imagine this would be useful for dev environments which publishers may want to always pin to experimental, and always pin a QA environment to beta, and then leave the prod environment pinned to stable or lts? For example:
| Channel | Runtime URL |
|---|---|
stable |
https://cdn.ampproject.org/v0.js |
lts |
https://cdn.ampproject.org/lts/v0.js |
beta ✨ |
https://cdn.ampproject.org/beta/v0.js |
experimental ✨ |
https://cdn.ampproject.org/experimental/v0.js |
Additional context here is the WordPress plugin. I'm working on a PR (ampproject/amp-wp#4390) to update to the latest AMP spec, which includes an LTS opt-in as well as adding crossdomain=anonymous to the script and link tags. Currently the LTS opt-in is a boolean. However, it could be an enum including stable, lts, beta, and experimental. This doesn't make sense at the moment because there are only base URLs for stable and lts. But if there were base URLs for the other channels, then it would make sense.
Related: