💡 Pinned frontend API version to canary

- Ghost themes are allowed to define the API version they want to use, but this concept has never really worked correctly
- We have a theory that it doesn't ever do quite what people want, and so always loading latest would not really break anything - this commit tests that theory
- We're pinning to canary, as we're aiming to get rid of the concept of versions altogether
- I could have done return config.get('api:versions:default');, but this actually returns v4 (although the same as canary, conceptually different)
  and it also seemed like an unnecessary level of indirection. This change should be easy to understand and to revert if we are wrong
This commit is contained in:
Hannah Wolfe 2022-02-17 17:51:11 +00:00
parent 06a4dd7456
commit d1e5ccae14
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037

View File

@ -12,7 +12,6 @@
const debug = require('@tryghost/debug')('bridge');
const errors = require('@tryghost/errors');
const config = require('./shared/config');
const logging = require('@tryghost/logging');
const tpl = require('@tryghost/tpl');
const themeEngine = require('./frontend/services/theme-engine');
@ -83,11 +82,8 @@ class Bridge {
}
getFrontendApiVersion() {
if (this.getActiveTheme()) {
return this.getActiveTheme().engine('ghost-api');
} else {
return config.get('api:versions:default');
}
// @NOTE: we've pinned the frontend to canary in a step towards removing API versions
return 'canary';
}
getCardAssetConfig() {