Bumps the ui-plugin-template-package-updates group with 8 updates in the /dev/react-plugin-tools/react_plugin_template directory: | Package | From | To | | --- | --- | --- | | [react](https://github.com/react/react/tree/HEAD/packages/react) | `19.3.0` | `19.3.1` | | [react-dom](https://github.com/react/react/tree/HEAD/packages/react-dom) | `19.3.0` | `19.3.1` | | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.71.1` | `8.71.2` | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.71.1` | `8.71.2` | | [@typescript-eslint/utils](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/utils) | `8.71.1` | `8.71.2` | | [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) | `5.5.6` | `5.5.7` | | [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.71.1` | `8.71.2` | | [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `4.1.11` | `4.1.12` | Updates `react` from 19.3.0 to 19.3.1 - [Release notes](https://github.com/react/react/releases) - [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/react/react/commits/v19.3.1/packages/react) Updates `react-dom` from 19.3.0 to 19.3.1 - [Release notes](https://github.com/react/react/releases) - [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/react/react/commits/v19.3.1/packages/react-dom) Updates `@typescript-eslint/eslint-plugin` from 8.71.1 to 8.71.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.71.2/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.71.1 to 8.71.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.71.2/packages/parser) Updates `@typescript-eslint/utils` from 8.71.1 to 8.71.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/utils/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.71.2/packages/utils) Updates `eslint-plugin-prettier` from 5.5.6 to 5.5.7 - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.6...v5.5.7) Updates `typescript-eslint` from 8.71.1 to 8.71.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.71.2/packages/typescript-eslint) Updates `vitest` from 4.1.11 to 4.1.12 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.12/packages/vitest) --- updated-dependencies: - dependency-name: react dependency-version: 19.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: react-dom dependency-version: 19.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.71.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: "@typescript-eslint/parser" dependency-version: 8.71.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: "@typescript-eslint/utils" dependency-version: 8.71.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: eslint-plugin-prettier dependency-version: 5.5.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: typescript-eslint dependency-version: 8.71.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates - dependency-name: vitest dependency-version: 4.1.12 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: ui-plugin-template-package-updates ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Table of Contents generated with DocToc
{{PROJECT_NAME}}
This is a React plugin template for Apache Airflow that builds as a library component.
Development
This template is configured to build your React component as a library that can be consumed by other applications.
Available Scripts
pnpm dev- Start development server with hot reloadpnpm build- Build the library for productionpnpm build:types- Generate TypeScript declaration files onlypnpm build:lib- Build the JavaScript library onlypnpm test- Run testspnpm lint- Check code qualitypnpm format- Format code
Library Output
When you run pnpm build, the template generates:
dist/main.js- ES module JavaScript librarydist/main.d.ts- TypeScript declaration file- Source maps for debugging
Usage as a Library
After building, other applications can import your component:
import { PluginComponent } from 'your-plugin-name';
// Use in your React app
<PluginComponent />
Development Mode
For development and testing, use pnpm dev which will:
- Start a development server on port 5173
- Load the component using
src/dev.tsxentry point - Enable hot module replacement
- Chakra Theme provided for local development is the default one, but in production when the plugin is loaded into the Airflow Core UI, it will inherit the main application theme for a consistent look and feel.
Library Configuration
The template is configured with:
- Vite for fast building and development
- TypeScript with declaration file generation
- CSS injection - styles are automatically injected into the JavaScript bundle
- External dependencies - React and other common libraries are marked as external to reduce bundle size
Upgrading dependencies
Be mindful when upgrading dependencies that are marked as external in vite.config.ts, those are shared dependencies with the host application
(Airflow UI) and should remain in a compatible version range to avoid issues.
Customization
- Component Props: Update the
PluginComponentPropsinterface insrc/main.tsx - External Dependencies: Modify the
externalarray invite.config.ts - Build Output: Adjust library configuration in
vite.config.ts
Package Configuration
The package.json is configured with:
mainandmodulepointing to the built librarytypespointing to generated declaration filesexportsfor modern import/export supportfilesarray specifying what gets published
This ensures your plugin can be consumed as both a CommonJS and ES module with full TypeScript support.
Best Practices
- Keep React External: Always mark React ecosystem as external to avoid conflicts
- Global Naming: Use standardized global name (
AirflowPlugin) for consistency - Error Handling: Implement proper error boundaries and fallbacks
- TypeScript: Use proper typing for plugin props and exports
- Bundle Size: Monitor bundle size and externalize large dependencies if needed
Troubleshooting
Common Issues
"Failed to resolve module specifier 'react'"
- Ensure React is marked as external in
vite.config.ts - Verify host application exposes React globally
"Cannot read properties of null (reading 'useState')"
- React instance mismatch - check external configuration
- Verify global React is properly set in host application
"Objects are not valid as a React child"
- Ensure you're returning component functions, not JSX elements
- Check that lazy loading returns proper component structure
MIME type issues
- Ensure
.jsand.cjsfiles are served with correct MIME type
For more help, check the main project documentation.
Deployment to Airflow Plugins
Once the development is complete, you can build the library using pnpm build and then host the content of the dist folder. You can do that on your own infrastructure or within airflow
by adding static file serving to your api server via registering a plugin fastapi_apps. You can take a look at the Airflow documentation for more information on how to do that.