Implement permanent plugin architecture and update API#87
Merged
tristanpoland merged 4 commits intooverhaul/WGPUIfrom Feb 28, 2026
Merged
Implement permanent plugin architecture and update API#87tristanpoland merged 4 commits intooverhaul/WGPUIfrom
tristanpoland merged 4 commits intooverhaul/WGPUIfrom
Conversation
Add a comprehensive PLUGIN_ARCHITECTURE.md (v2.0) that documents the redesigned Pulsar plugin system: permanent library loading (never unload), shared Rust types, build-time compatibility checks, memory/Arc cycle guidance, cross-platform loading details, API surface, and migration steps. Also update .gitignore to ignore /.vscode/fastsearch.
Switch plugin system to a permanent-library model: plugins are loaded once and never unloaded. Add PermanentLibrary and related handling (crates/plugin_manager/src/permanent_library.rs) and stop exporting/using plugin destroy/unload symbols. Change the plugin API to return owned 'static references and Arcs across the boundary: PluginCreate now returns &'static mut dyn EditorPlugin, create_editor returns Arc<dyn PanelView>, and the export_plugin! macro leaks the boxed plugin and registers theme access via OnceLock. Remove the old EditorInstance trait and EditorLogger, simplify statusbar callback and function-pointer safety docs, and update many docs and version/ABI checks to reflect the permanent-load safety model. Update PluginManager to use PermanentLibrary, drop unsafe raw-pointer destroy logic, adjust loading/registration flows, and update logging. Overall this simplifies cross-DLL memory model (no dlclose/destroy), but requires plugins and engine to remain compatible and loaded for process lifetime.
Update call sites to match PluginManager API changes and temporarily disable the UI unload action. In ui_core: use pm.editor_registry().get_plugin_for_editor(...).cloned() and handle pm.create_editor returning just a panel (remove tuple pattern). In ui_plugin_manager: remove the unload_plugin helper and replace the unload button handler with a todo! that documents the need to implement plugin unloading in the PluginManager. These changes align the UI with the updated plugin API and avoid referencing removed return values/handlers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes significant improvements to the plugin API documentation and safety model, clarifies memory management practices, and simplifies several type definitions in the
crates/plugin_editor_api/src/lib.rsfile. The main focus is on ensuring ABI safety by never unloading plugin libraries, which enables safe sharing of function pointers, trait objects, andArc<T>across the plugin boundary. It also updates the plugin interface to reflect these guarantees and removes outdated cleanup logic.Plugin safety model and memory management [1] [2] [3]
Arc<T>, trait objects, and function pointers, and removes the need for weak reference workarounds. Detailed guidance on preventingArccycles is added. [1] [2] [3]API and trait changes [1] [2] [3]
EditorInstancetrait is removed; plugins now return anArc<dyn PanelView>directly, simplifying the interface and aligning with the new safety model. All documentation and examples are updated accordingly. [1] [2] [3]PluginCreate) is updated to return a'staticreference, and the destructor function is removed since plugins are never unloaded. The macro for exporting plugins is updated to reflect these changes.Version compatibility and type simplification [1] [2] [3]
Documentation improvements [1] [2] [3]
Minor code and formatting cleanups [1] [2] [3] [4] [5]
EditorLoggerand its usages) is removed. Minor formatting and documentation corrections are made throughout. [1] [2] [3] [4] [5]