Where do I find which versions of discourse support which plugin api version. Currently I am using pluginapi v 0.8 because I found it in discourse theme guide. But I haven’t been able to locate plugin api versions and their link with discourse versions.
keegan
(Keegan George)
September 18, 2021, 4:23pm
2
@Usman_Shahid
Not sure if this is the best way, but perhaps you can look at the plugin-api.js file (line 89) where the version number is listed:
const PLUGIN_API_VERSION = “0.12.3”
and compare that number across different commits of Discourse?
Thank you that’s very helpful
bitmage
(Brandon Mason)
June 13, 2024, 12:56am
4
It looks like the current file for the version I’m on (3.2.0) is here:
replaceIcon,
} from "discourse-common/lib/icon-library";
import { CUSTOM_USER_SEARCH_OPTIONS } from "select-kit/components/user-chooser";
import { modifySelectKit } from "select-kit/mixins/plugin-api";
// If you add any methods to the API ensure you bump up the version number
// based on Semantic Versioning 2.0.0. Please update the changelog at
// docs/CHANGELOG-JAVASCRIPT-PLUGIN-API.md whenever you change the version
// using the format described at https://keepachangelog.com/en/1.0.0/.
export const PLUGIN_API_VERSION = "1.24.0";
// This helper prevents us from applying the same `modifyClass` over and over in test mode.
function canModify(klass, type, resolverName, changes) {
if (!changes.pluginId) {
// eslint-disable-next-line no-console
console.warn(
consolePrefix(),
"To prevent errors in tests, add a `pluginId` key to your `modifyClass` call. This will ensure the modification is only applied once."
);
return true;
This is a really obscure way of finding the API version that we’re supposed to be using.
My experience so far if you get it wrong is that the script silently fails to load.