Skip to content

AIP-68 | Develop new React plugins #42702

@bbovenzi

Description

@bbovenzi

In an Airflow plugin appbuilder_views will be deprecated. They need to be replaced with react_views.

Fields to include when registering react_views

name: string, // plugin name

title: string, // display name to show on buttons

icon: string, // (optional) path to an icon file to display next to the title

url_route: string, (optional) what to display in the url route, defaults to the plugin name

src: string, // path to the javascript bundle file where the react component lives

location: enum[] // where in the UI the component can live, it can live in multiple places

  • "nav" add as a top-level nav button
  • "dag" add as a tab in the DAG details view
  • "dag_run" add as a tab in the DAG details view but only for dag runs
  • "task" add as a tab in the DAG details view but only for that task across runs
  • "task_instance" for a specific task instance
  • "dashboard" add a panel on the dashboard homepage
  • "asset" add to Asset details page
  • "dag_overview" add to dag overview page
  • "task_overview" add to task overview page
  • "task_logs" add to task logs page
  • "base" add to the BaseLayout component so that it can appear on any/all pages

The plugins manager then needs to add the icon and component static files to be hosted by FastAPI.
We can dynamically lazy load the components with lazy(() => import(/* @vite-ignore */ plugin.src)

Other issues:

  • Rename appbuilder_menu_items to menu_items and send the array to the UI to render in the main nav page AIP-68 | Migrate plugin menu_items to FastAPI and new UI #42706
  • Add support for plugins that are simply urls to render inside of an iframe, saving developers the hassle of building a custom react component just to render a 3rd part website anyway AIP-68 Add iframe_views plugin #42708
  • Add a CLI command to build all the boilerplate code for a react component project so plugin developers don't need to worry about project setup
  • Develop an API for what props a react plugin component can expect from the UI depending on its location.

Other questions:

  • Should we still have a webserver run when the FAB provider exists in order to host legacy plugins and render them as iframes?

Metadata

Metadata

Assignees

Labels

AIP-68Extended Plugin Interface for React Viewsarea:UIRelated to UI/UX. For Frontend Developers.kind:metaHigh-level information important to the community

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions