Skip to content

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Oct 1, 2025

Bumps @grafana/create-plugin configuration from 5.25.8 to 5.26.9.

Notes for reviewer:
This is an auto-generated PR which ran @grafana/create-plugin update.
Please consult the create-plugin CHANGELOG.md to understand what may have changed.
Please review the changes thoroughly before merging.

Summary by CodeRabbit

  • Chores
    • Updated Grafana dependencies and tooling to 12.2.0 for improved compatibility.
    • Bumped Go toolchain and plugin SDK, plus broad dependency refresh for stability and security.
    • Streamlined build configuration and externals handling to reduce bundle size and improve reliability.
  • Tests
    • Test script now watches and runs only changed tests for faster feedback.
  • Notes
    • No user-facing feature changes; behavior remains the same.

Copy link

changeset-bot bot commented Oct 1, 2025

⚠️ No Changeset found

Latest commit: 2ac896b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

The PR updates configuration and dependencies, introduces a shared Webpack externals module, switches Webpack to use it, adds a root .cprc.json, updates Docker compose defaults, upgrades Go and JS deps, and removes the entire Rspack-based build setup including plugins and utilities.

Changes

Cohort / File(s) Summary
Config version bump
'.config/.cprc.json'
Version updated from 5.25.8 to 5.26.9.
Root configuration flags
.cprc.json
New file with flags: bundleGrafanaUI=false, useReactRouterV6=true, useExperimentalRspack=false.
Webpack bundling/externals
.config/bundler/externals.ts, .config/webpack/webpack.config.ts
Adds a dedicated externals config (direct, regex, and function-based legacy grafana/ prefix handling). Webpack config imports and uses it; adds pluginVersion to banners and replacements; minor formatting and template updates.
Rspack removal
.config/rspack/BuildModeRspackPlugin.ts, .config/rspack/constants.ts, .config/rspack/liveReloadPlugin.js, .config/rspack/rspack.config.ts, .config/rspack/utils.ts
Deletes Rspack configuration, custom plugins (BuildMode, LiveReload), constants, and utilities (isWSL, getPackageJson, getPluginJson, getCPConfigVersion, hasReadme, getEntries). Removes exported entities.
Docker compose defaults
.config/docker-compose-base.yaml
Updates Grafana image arg to 12.2.0, switches security option quotes, removes GF_DEFAULT_APP_MODE env var.
Go dependencies
go.mod
Upgrades Go to 1.24.6 with toolchain 1.24.7; bumps grafana-plugin-sdk-go to v0.279.0; broad indirect dependency updates (Arrow, gRPC, OTEL, Prometheus, golang.org/x/*, etc.).
JS dependencies and scripts
package.json
Updates Grafana packages to 12.2.0, adds @grafana/i18n, bumps ESLint config, changes test script to "jest --watch --onlyChanged".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant WP as Webpack
  participant Ex as externals.ts
  participant Mod as Module Request
  participant CB as Externals Callback

  Note over WP,Ex: External resolution during bundling

  WP->>Ex: Resolve externals for Mod
  alt Matches direct list or regex (@grafana/*, react, rxjs, etc.)
    Ex-->>WP: Mark as external (no bundling)
  else Function-based handler (legacy SDK)
    Ex->>CB: if request startsWith "grafana/"
    alt Legacy prefix matched
      CB-->>Ex: Return stripped name (e.g., "grafana/x" -> "x")
      Ex-->>WP: Mark stripped module as external
    else No match
      CB-->>Ex: No external
      Ex-->>WP: Proceed with normal bundling
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my ears at builds anew,
Externals hop, Rspack bids adieu.
Webpack’s trail is crisp and clean,
Versions sprout like springtime green.
Go paths stretch, dependencies bloom—
Carrot banners waft perfume. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately describes the primary change of bumping the @grafana/create-plugin configuration to version 5.26.9, matching the automated updates in the PR without including unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-grafana-create-plugin-5.26.9

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9e9a99 and 2ac896b.

⛔ Files ignored due to path filters (3)
  • .yarn/install-state.gz is excluded by !**/.yarn/**, !**/*.gz
  • go.sum is excluded by !**/*.sum
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • .config/.cprc.json (1 hunks)
  • .config/bundler/externals.ts (1 hunks)
  • .config/docker-compose-base.yaml (1 hunks)
  • .config/rspack/BuildModeRspackPlugin.ts (0 hunks)
  • .config/rspack/constants.ts (0 hunks)
  • .config/rspack/liveReloadPlugin.js (0 hunks)
  • .config/rspack/rspack.config.ts (0 hunks)
  • .config/rspack/utils.ts (0 hunks)
  • .config/webpack/webpack.config.ts (6 hunks)
  • .cprc.json (1 hunks)
  • go.mod (3 hunks)
  • package.json (3 hunks)
💤 Files with no reviewable changes (5)
  • .config/rspack/liveReloadPlugin.js
  • .config/rspack/constants.ts
  • .config/rspack/BuildModeRspackPlugin.ts
  • .config/rspack/utils.ts
  • .config/rspack/rspack.config.ts
🔇 Additional comments (19)
.config/.cprc.json (1)

2-2: LGTM! Version bump aligns with PR objectives.

The version update from 5.25.8 to 5.26.9 is consistent with the PR title and objectives.

.cprc.json (1)

1-7: LGTM! Feature flags align with PR changes.

The configuration correctly sets:

  • bundleGrafanaUI: false - aligns with the new externals configuration that externalizes Grafana UI packages.
  • useReactRouterV6: true - enables React Router v6.
  • useExperimentalRspack: false - consistent with the removal of Rspack configuration files mentioned in the PR summary.
.config/docker-compose-base.yaml (2)

10-10: LGTM! Grafana version bump aligns with package.json.

The Grafana version update to 12.2.0 is consistent with the dependency upgrades in package.json.


17-18: Cosmetic quote style change.

The change from double quotes to single quotes for security options is purely stylistic and does not affect functionality.

package.json (3)

38-38: LGTM! Enhanced test script for better DX.

The addition of --watch --onlyChanged improves the developer experience by enabling watch mode and running tests only for changed files.


47-47: LGTM! ESLint config minor version bump.

The update from ^8.0.0 to ^8.2.0 is a minor version bump that should be backward compatible.


98-102: LGTM! Grafana dependencies upgraded consistently.

All Grafana dependencies are upgraded to 12.2.0, and the new @grafana/i18n package is added for internationalization support. This aligns with the Docker compose Grafana version bump to 12.2.0.

.config/webpack/webpack.config.ts (7)

22-22: LGTM! Externals refactored to separate module.

Importing externals from a dedicated module improves maintainability and aligns with the new centralized externals configuration in .config/bundler/externals.ts.


26-26: LGTM! Plugin version extracted for reuse.

Extracting pluginVersion from package.json enables consistent version embedding in banners and replacements.


59-59: LGTM! Using imported externals configuration.

The configuration now uses the imported externals variable, replacing the previous hard-coded array.


136-137: Note: Console methods dropped in production.

The TerserPlugin configuration drops console.log and console.info in production builds. Ensure this aligns with your logging strategy.


163-164: LGTM! Enhanced banner with plugin identification.

The banner now includes both the plugin ID and version, improving traceability in production builds.


194-194: LGTM! Using pluginVersion for replacements.

The replacement now uses the extracted pluginVersion constant for consistency.


210-226: LGTM! Improved conditional plugin formatting.

The conditional inclusion of development plugins is reformatted for better readability.

.config/bundler/externals.ts (5)

1-7: LGTM! Proper typing for externals configuration.

The type definition using Configuration['externals'] ensures type safety for the externals export.


8-26: LGTM! Comprehensive static externals list.

The static externals list covers common dependencies for Grafana plugins, including UI libraries (React, Redux), utility libraries (lodash, moment), and visualization libraries (d3).


27-29: LGTM! Regex patterns for Grafana packages.

The regex patterns ensure that all imports from @grafana/ui, @grafana/runtime, and @grafana/data are treated as externals, which is correct for Grafana plugins that rely on the host Grafana instance to provide these packages.


32-42: LGTM! Legacy SDK prefix stripping handler.

The function-based external handler correctly:

  • Checks if the request starts with the grafana/ prefix.
  • Strips the prefix and returns the remainder as an external module.
  • Calls the callback without a result if the prefix is not present, allowing other externals rules to process the request.

This ensures backward compatibility with legacy Grafana SDK imports.


5-43: No @grafana/i18n imports found—no externals update needed
Search across .ts/.tsx/.js/.jsx returned no references to @grafana/i18n, so the externals list requires no changes.


Comment @coderabbitai help to get the list of available commands and usage tips.

@HadesArchitect
Copy link
Owner

@coderabbitai review

Copy link

coderabbitai bot commented Oct 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant