Dove posso trovare quali versioni di Discourse supportano quale versione della API dei plugin? Attualmente sto usando pluginapi v 0.8 perché l’ho trovata nella guida ai temi di Discourse. Tuttavia, non sono riuscito a individuare le versioni della API dei plugin e il loro collegamento con le versioni di Discourse.
keegan
(Keegan George)
18 Settembre 2021, 4:23pm
2
@Usman_Shahid
Non sono sicuro che sia il modo migliore, ma forse puoi esaminare il file plugin-api.js (riga 89) dove è indicato il numero di versione:
const PLUGIN_API_VERSION = "0.12.3"
e confrontare quel numero tra diversi commit di Discourse?
bitmage
(Brandon Mason)
13 Giugno 2024, 12:56am
4
Sembra che il file corrente per la versione su cui mi trovo (3.2.0) sia qui:
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;
Questo è un modo davvero oscuro per trovare la versione dell’API che dovremmo usare.
La mia esperienza finora, se sbagli, è che lo script non viene caricato silenziosamente.