From 395be480e733f10ca8072ce7a442a0cabd4a8617 Mon Sep 17 00:00:00 2001 From: Phillip Rak Date: Tue, 16 Sep 2025 08:38:11 -0700 Subject: [PATCH] Throttle `$plugin` deprecation warning Signed-off-by: Phillip Rak --- shell/core/plugins.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shell/core/plugins.js b/shell/core/plugins.js index 6ae382b9dc..cf623028d0 100644 --- a/shell/core/plugins.js +++ b/shell/core/plugins.js @@ -1,3 +1,4 @@ +import { throttle } from 'lodash'; import { initExtensionManager } from './extension-manager-impl'; export default function(context, inject) { @@ -17,10 +18,14 @@ export default function(context, inject) { * accessed */ const deprecationProxy = (target, message) => { + const logWarning = throttle(() => { + // eslint-disable-next-line no-console + console.warn(message); + }, 150); + const deprecationHandler = { get(target, prop) { - // eslint-disable-next-line no-console - console.warn(message); + logWarning(); return Reflect.get(target, prop); }