어떤 Discourse 버전이 어떤 플러그인 API 버전을 지원하는지 어디서 확인할 수 있나요? 현재는 Discourse 테마 가이드에서 찾은 pluginapi v 0.8을 사용하고 있습니다. 하지만 플러그인 API 버전과 Discourse 버전 간의 연결 관계를 찾지 못했습니다.
keegan
(Keegan George)
9월 18, 2021, 4:23오후
2
@Usman_Shahid
이것이 최선의 방법인지는 확신할 수 없지만, 버전 번호가 나열된 plugin-api.js 파일(89행)을 확인해 보시면 어떨까요:
const PLUGIN_API_VERSION = “0.12.3”
그리고 이 번호를 Discourse의 다른 커밋들과 비교해 보시는 건 어떨까요?
bitmage
(Brandon Mason)
6월 13, 2024, 12:56오전
4
제가 현재 사용 중인 버전(3.2.0)에 해당하는 파일은 여기 있는 것 같습니다:
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;
사용해야 할 API 버전을 찾는 것이 정말로 난해한 방식입니다.
지금까지의 경험상, 이 값을 잘못 지정하면 스크립트가 조용히 로드되지 않는 문제가 발생합니다.