@grafana/react-detect
Detect React 19 breaking changes in Grafana plugins.
Usage
First make sure to build the frontend of your plugin so sourcemaps are present in the dist/ directory.
npm run build
Then run from your plugin root directory (where package.json exists):
npx @grafana/react-detect
Options
--pluginRoot: Pass the root directory of the plugin. Defaults to the current working directory.
--json: Output the results as json.
--skipBuildTooling: Skip webpack configuration checks (jsx-runtime externalization). Useful when build config is missing or not applicable.
--skipDependencies: Skip dependency tree analysis. Useful when lockfile is missing or for faster analysis of source code only.
关于 @grafana/react-detect 的常见问题
@grafana/react-detect 是什么?
Run various checks to detect if a Grafana plugin is compatible with React.
如何安装 @grafana/react-detect?
在项目目录运行 npm install @grafana/react-detect,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 react-detect,可以用 npx react-detect 直接运行。
@grafana/react-detect 支持 TypeScript 吗?
该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/grafana__react-detect 是否存在。
@grafana/react-detect 支持 ESM 还是 CommonJS?
以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。
@grafana/react-detect 需要什么版本的 Node.js?
package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。
@grafana/react-detect 可以商用吗?
@grafana/react-detect 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。
@grafana/react-detect 的下载量有多少?
根据 npm 官方下载统计,@grafana/react-detect 在 2026/10/17 – 2026/11/15 这 30 天内被下载 10,465 次,日均约 349 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。
@grafana/react-detect 还在维护吗?
最新版本 0.7.6 发布于 2026/11/02(14 天前);至今共发布 60 个版本,其中过去 12 个月发布了 60 个;首次发布于 2025/12/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。