michael-s-molina opened a new pull request, #37499: URL: https://github.com/apache/superset/pull/37499
### SUMMARY This PR introduces a new extension contribution type that allows extensions to replace Superset's default Ace editor with custom editor implementations. Extensions can now register alternative editors (such as Monaco, CodeMirror, or SimpleMDE) for specific languages, enabling enhanced editing experiences across the application. **Key changes:** - **New `editors` contribution type**: Extensions can declare editor contributions in their manifest that specify which languages they support (sql, json, css, markdown, yaml) - **EditorHost component**: A new component that automatically resolves and renders the appropriate editor based on language - either an extension-provided editor or the default Ace editor - **Editors API**: New API functions (`registerEditorProvider`, `getEditorProvider`, `hasEditorProvider`) exposed via `@apache-superset/core` for extensions to register their editors - **AceEditorProvider**: The default Ace editor refactored into the new provider pattern, ensuring backward compatibility - **Updated editor locations**: All editor instances across Superset (SQL Lab, Dashboard Properties, CSS editors, Annotation Modal, etc.) now use the EditorHost component **Documentation:** - New [Editors Extension Point](docs/developer_portal/extensions/extension-points/editors.md) documentation with implementation guide - Updated [Contribution Types](docs/developer_portal/extensions/contribution-types.md) with editors section - Added [Editors Bundle](https://github.com/michael-s-molina/superset-extensions/tree/main/editors_bundle) example extension to the community registry ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF **After** - Extension providing alternative SQL editors (Monaco, CodeMirror, SimpleMDE): https://github.com/user-attachments/assets/210395ce-6ce8-4df4-a778-28ea6a257b3d ### TESTING INSTRUCTIONS 1. Start Superset with the dev server 2. Verify SQL Lab editor works normally with default Ace editor 3. Install the [Editors Bundle](https://github.com/michael-s-molina/superset-extensions/tree/main/editors_bundle) extension 4. Verify the editor switcher button appears in SQL Lab toolbar 5. Test switching between Ace, Monaco, CodeMirror, and SimpleMDE editors 6. Verify Dashboard Properties JSON/CSS editors work correctly 7. Verify Annotation Modal, Theme Modal, and CSS Template Modal editors work correctly ### ADDITIONAL INFORMATION - [x] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
