{"record":{"id":"5e8c2e77d4c47db7","repo":"flarum/framework","slug":"calling-tooltip-is-now-deprecated-please-use-the-tooltip","errorCode":null,"errorMessage":"Calling `$.tooltip` is now deprecated. Please use the `<Tooltip>` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\\n\\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case","messagePattern":"Calling `\\$\\.tooltip` is now deprecated\\. Please use the `<Tooltip>` component exposed by flarum/core instead\\. `\\$\\.tooltip` may be removed in a future version of Flarum\\.\\\\n\\\\nIf this component doesn't meet your requirements, please open an issue: https://github\\.com/flarum/core/issues/new\\?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report\\.md&title=Tooltip%20component%20unsuitable%20for%20use%20case","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"framework/core/js/src/common/index.ts","lineNumber":36,"sourceCode":"import './registry';\n\nimport patchMithril from './utils/patchMithril';\n\npatchMithril(window);\n\nimport app from './app';\n\nexport { app };\n\nconst tooltipGen = $.fn.tooltip;\n\n// Remove in a future version of Flarum.\n// @ts-ignore\n$.fn.tooltip = function (options, caller) {\n  // Show a warning when `$.tooltip` is used outside of the Tooltip component.\n  // This functionality is deprecated and should not be used.\n  if (!['DANGEROUS_tooltip_jquery_fn_deprecation_exempt'].includes(caller)) {\n    console.warn(\n      \"Calling `$.tooltip` is now deprecated. Please use the `<Tooltip>` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\\n\\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case\"\n    );\n  }\n\n  tooltipGen.bind(this)(options);\n};\n","sourceCodeStart":18,"sourceCodeEnd":43,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/js/src/common/index.ts#L18-L43","documentation":"flarum/core monkey-patches $.fn.tooltip to keep backward compatibility, but emits a console.warn whenever it is called without the DANGEROUS_tooltip_jquery_fn_deprecation_exempt caller marker. This tells extension authors that the jQuery tooltip API is deprecated and will be removed; they should migrate to the <Tooltip> component shipped in flarum/core.","triggerScenarios":"Calling `$(el).tooltip(options)` (or mithril code invoking the jQuery plugin) from extension code without passing the exempt caller name 'DANGEROUS_tooltip_jquery_fn_deprecation_exempt'.","commonSituations":"Old extensions written before the Tooltip component existed still calling $.tooltip; copy-pasted jQuery tooltip snippets; upgrading flarum/core surfaces warnings from unmaintained extensions.","solutions":["Replace the $.fn.tooltip usage with the <Tooltip> component from flarum/core.","If a temporary exemption is truly required, pass caller='DANGEROUS_tooltip_jquery_fn_deprecation_exempt' (discouraged; still slated for removal).","Update the affected extension to a version that uses the Tooltip component.","File an issue with flarum/core if the Tooltip component cannot cover your use case (link in the warning).","Suppress until migration only in non-debug environments — the warning ships regardless of debug mode here."],"exampleFix":"// before\nthis.$('.help').tooltip({ title: 'Help' });\n// after\nimport Tooltip from 'flarum/common/components/Tooltip';\n<Tooltip text=\"Help\">{this.helpIcon}</Tooltip>","handlingStrategy":"type-guard","validationCode":"const usesJqueryTooltip = document.querySelectorAll('[data-tooltip], .tooltip').length > 0 || /\\$\\(.*\\)\\.tooltip\\(/.test(extSrc);\nif (usesJqueryTooltip) migrateToTooltipComponent(extSrc);","typeGuard":"function isExemptTooltipCaller(caller) {\n  return typeof caller === 'string' && caller === 'DANGEROUS_tooltip_jquery_fn_deprecation_exempt';\n}","tryCatchPattern":"// The warning is a console.warn, not an exception; intercept during migration:\nconst origWarn = console.warn;\nconsole.warn = (...args) => {\n  if (String(args[0]).includes('$.tooltip` is now deprecated')) return;\n  origWarn(...args);\n};","preventionTips":["Prefer the <Tooltip> component over $.fn.tooltip in all new code.","Search extension sources for `.tooltip(` when upgrading flarum/core.","Keep extensions updated to releases using the Tooltip component.","Grep your bundle for 'DANGEROUS_tooltip_jquery_fn_deprecation_exempt' to find temporary exemptions.","Track flarum/core changelogs for the removal of the jQuery tooltip shim."],"tags":["deprecation","jquery","tooltip","frontend"],"backgroundTag":"deprecated-api-usage","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}