This guide explains how to manage dependencies in your Superset extensions, including the difference between public APIs and internal code, and best practices for maintaining stable extensions.
Extensions run in the same context as Superset during runtime. This means extension developers can technically import any module from the Superset codebase, not just the public APIs. Understanding the distinction between public and internal code is critical for building maintainable extensions.
The core packages follow semantic versioning and provide stable, documented APIs:
| Package | Language | Description |
|---|---|---|
@apache-superset/core | JavaScript/TypeScript | Frontend APIs, UI components, hooks, and utilities |
apache-superset-core | Python | Backend APIs, models, DAOs, and utilities |
Benefits of using core packages:
Any code that is not exported through the core packages is considered internal. This includes:
superset-frontend/src/ modulessuperset/ Python modules (outside of superset_core):::warning Use at Your Own Risk Internal code can change at any time without notice. If you depend on internal modules, your extension may break when Superset is upgraded. There is no guarantee of backward compatibility for internal code. :::
Example of internal vs public imports:
// ✅ Public API - stable import { Button, sqlLab } from '@apache-superset/core'; // ❌ Internal code - may break without notice import { someInternalFunction } from 'src/explore/components/SomeComponent';
# ✅ Public API - stable from superset_core.common.models import Database from superset_core.common.daos import DatabaseDAO # ❌ Internal code - may break without notice from superset.views.core import SomeInternalClass
The core packages are still evolving. While we follow semantic versioning, the APIs may change as we add new extension points and refine existing ones based on community feedback.
What this means for extension developers:
While public APIs are always preferred, there are situations where using internal code may be reasonable:
In these cases, document your internal dependencies clearly and plan to migrate to public APIs when they become available.
An important architectural principle of the Superset extension system is that we do not provide abstractions on top of core dependencies like React (frontend) or SQLAlchemy (backend).
Abstracting libraries like React or SQLAlchemy would:
Extension developers should depend on and use core libraries directly:
Frontend (examples):
@apache-superset/core/components when available to preserve visual consistency)Backend (examples):
:::info Version Compatibility When Superset upgrades its core dependencies (e.g., a new major version of Ant Design or SQLAlchemy), extension developers should upgrade their extensions accordingly. This ensures compatibility and access to the latest features and security fixes. :::
Once the extensions API reaches v1, we will maintain a dedicated CHANGELOG.md file to track all changes to the public APIs. This will include:
Until then, monitor the Superset release notes and test your extensions with each new release.
@apache-superset/core or apache-superset-core before using internal code