Skip to content

feat(dynamic plugins): migrate dynamic plugins to React#39586

Open
mcdogg17 wants to merge 9 commits into
apache:masterfrom
TechAudit-BI:feat/migrate-dynamic-plugins
Open

feat(dynamic plugins): migrate dynamic plugins to React#39586
mcdogg17 wants to merge 9 commits into
apache:masterfrom
TechAudit-BI:feat/migrate-dynamic-plugins

Conversation

@mcdogg17
Copy link
Copy Markdown
Contributor

SUMMARY

At the moment, when adding the plugin, it is not displayed in the list of available charts. This PR transfers the presentation of dynamic plugins from server-side rendering (SSR) to fully client-side rendering using React
The new implementation improves maintainability, performance, and consistency with the modern Superset interface stack.

Changes Included 🔧

  • Replaced the Flask view with a new React-based page ⚛️
  • Reused existing REST API endpoints 🔁
  • Maintained full feature parity with the previous implementation ✅
  • Updated routing and navigation accordingly 🧭

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before ---
image
image
image
After ---
image
image
image

TESTING INSTRUCTIONS

  1. Enable DYNAMIC_PLUGINS in feature flags.
  2. Run superset init
  3. Go to the settings on the menu and click Dynamic Plugins

ADDITIONAL INFORMATION

  • Has associated issue:
  • [х] Required feature flags:
  • [х] Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

* add superset api for dynamic plugins

* del view dynamic plugins

* fix general plugins url

* added new route

* refactor adding/editing

* fix translations

* fix key on key_id in schema

* fix key

* fix id in schemas plugins

* refactor key_id

* reorder id column

---------

Co-authored-by: aspectie <kovleshenko99@mail.ru>
@mcdogg17
Copy link
Copy Markdown
Contributor Author

@supersetbot orglabel

@dosubot dosubot Bot added change:frontend Requires changing the frontend plugins labels Apr 23, 2026
@github-actions github-actions Bot removed the plugins label Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 20.99448% with 143 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.52%. Comparing base (d62f154) to head (9fabd85).
⚠️ Report is 255 commits behind head on master.

Files with missing lines Patch % Lines
...perset-frontend/src/pages/DynamicPlugins/index.tsx 0.00% 74 Missing ⚠️
...src/features/dynamicPlugins/DynamicPluginModal.tsx 0.00% 68 Missing ⚠️
superset-frontend/src/views/routes.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39586      +/-   ##
==========================================
- Coverage   64.58%   64.52%   -0.07%     
==========================================
  Files        2564     2566       +2     
  Lines      133576   133754     +178     
  Branches    31033    31070      +37     
==========================================
+ Hits        86271    86300      +29     
- Misses      45813    45962     +149     
  Partials     1492     1492              
Flag Coverage Δ
hive 39.91% <97.29%> (+0.03%) ⬆️
javascript 66.41% <0.69%> (-0.13%) ⬇️
mysql 60.46% <100.00%> (+0.02%) ⬆️
postgres 60.54% <100.00%> (+0.02%) ⬆️
presto 41.69% <97.29%> (+0.03%) ⬆️
python 62.11% <100.00%> (+0.01%) ⬆️
sqlite 60.17% <100.00%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #717754

Actionable Suggestions - 2
  • superset-frontend/src/features/dynamicPlugins/DynamicPluginModal.tsx - 1
  • superset-frontend/src/pages/DynamicPlugins/index.tsx - 1
Additional Suggestions - 1
  • superset-frontend/src/pages/DynamicPlugins/index.tsx - 1
    • Potential incorrect field in key column · Line 123-123
      The 'Key' column cell displays original.key_id, but the accessor is 'key' and filters use 'key'. Verify if key_id or key should be displayed; if key is correct, update the cell to show original.key for consistency.
Review Details
  • Files reviewed - 7 · Commit Range: 1770cbc..1770cbc
    • superset-frontend/src/components/DynamicPlugins/index.tsx
    • superset-frontend/src/features/dynamicPlugins/DynamicPluginModal.tsx
    • superset-frontend/src/pages/DynamicPlugins/index.tsx
    • superset-frontend/src/views/routes.tsx
    • superset/initialization/__init__.py
    • superset/security/manager.py
    • superset/views/dynamic_plugins.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +112 to +116
if (!response) return;
addSuccessToast(t('Dynamic plugin created'));
if (onPluginAdd) onPluginAdd(response);
hide();
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type mismatch in callback

The onPluginAdd callback expects a DynamicPluginObject, but response is a number (the ID). Passing the wrong type can cause runtime errors or incorrect behavior in the parent component.

Code suggestion
Check the AI-generated fix before applying
Suggested change
if (!response) return;
addSuccessToast(t('Dynamic plugin created'));
if (onPluginAdd) onPluginAdd(response);
hide();
});
if (!response) return;
addSuccessToast(t('Dynamic plugin created'));
if (onPluginAdd) onPluginAdd({ id: response, ...rest, key: key_id });
hide();
});

Code Review Run #717754


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Comment on lines +269 to +288
{confirmDelete => (
<ListView<DynamicPluginObject>
className="dynamic-plugins-list-view"
columns={columns}
count={pluginsCount}
data={plugins}
fetchData={fetchData}
filters={filters}
initialSort={initialSort}
loading={loading}
pageSize={PAGE_SIZE}
bulkSelectEnabled={bulkSelectEnabled}
disableBulkSelect={toggleBulkSelect}
addDangerToast={addDangerToast}
addSuccessToast={addSuccessToast}
emptyState={emptyState}
refreshData={refreshData}
/>
)}
</ConfirmStatusChange>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing bulk delete functionality

The ConfirmStatusChange component provides a confirmDelete function to its children, but the ListView does not include bulkActions to utilize it for bulk delete operations. This prevents bulk deletion from working. Add bulkActions similar to other list views like ChartList, with an onSelect handler that calls confirmDelete.

Code Review Run #717754


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Apr 23, 2026

Code Review Agent Run #96c230

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: 1770cbc..9fabd85
    • superset/initialization/__init__.py
    • superset/security/manager.py
    • superset/views/dynamic_plugins.py
    • superset-frontend/src/features/dynamicPlugins/DynamicPluginModal.tsx
    • superset-frontend/src/pages/DynamicPlugins/index.tsx
    • superset-frontend/src/views/routes.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@mcdogg17
Copy link
Copy Markdown
Contributor Author

mcdogg17 commented May 4, 2026

@betodealmeida

Hey
where can I apply for a PR review?

@rusackas
Copy link
Copy Markdown
Member

I think this feature has been largely deprecated in favor of the Extensions effort, but... I suppose this couldn't hurt, if anyone's willing to test/review it. CC @michael-s-molina @villebro in case you know of anyone actively using this.

@mcdogg17
Copy link
Copy Markdown
Contributor Author

Hey, our team and our clients use this functionality very actively, so it would be very useful to us.

At the moment, Extensions do not allow you to connect additional visualizations. Accordingly, we cannot switch to them.

Please take this into consideration when reviewing this PR 😊

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

Labels

change:frontend Requires changing the frontend size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants