Wednesday, November 13, 2024
2 changes · 18.0
Code cleanup and technical improvements
The HTML editor’s internal plugin architecture was reorganized to make commands, dependencies, and extension points more consistent. This should make future editor changes easier to build and maintain, with little direct impact on everyday users.
Original PR description
### API Changes 1. **Dependencies** - Replaced `shared.method_name` with `dependencies.pluginName.methodName` - Plugin `name` property renamed `id` to avoid clashing with the global `name` property…
### API Changes
1. **Dependencies**
- Replaced `shared.method_name` with `dependencies.pluginName.methodName`
- Plugin `name` property renamed `id` to avoid clashing with the global `name` property on classes. Values changed to camelCase.
2. **Commands**
- Introduced "user commands" as a unified interface for commands that can be triggered by users (e.g. from the toolbar, powerbox and powerbuttons)
- Standardized api for toolbar items, powerbox items, shortcuts, and power buttons
- Removed `Plugin.dispatch` and `Plugin.handleCommand` methods
- Introduced `dispatchTo` for event handling and `delegateTo` for overrides
3. **Resource Categorization**
- handlers: functions that are called in response to an event (e.g. selectionchange_handlers)
- overrides: functions that replace a default behavior (e.g. paste_text_overrides)
- predicates: functions that test a condition, returning boolean (e.g. unremovable_node_predicates)
- providers: functions that supply data on demand (e.g. collaboration_peer_metadata_providers)
- processors: composable functions that transform data (e.g. history_step_processors)
- data (no suffix): not functions (e.g. system_classes)
task-4266746
Enterprise: https://github.com/odoo/enterprise/pull/73500This refactor updates the internal editor plugin system used by Knowledge, Appointments, and Studio so shared tools follow a clearer and more consistent API. It should make future editor improvements easier to build and maintain, with limited direct impact for end users.
Original PR description
### API Changes 1. **Dependencies** - Replaced `shared.method_name` with `dependencies.pluginName.methodName` - Plugin `name` property renamed `id` to avoid clashing with the global `name` property…
### API Changes
1. **Dependencies**
- Replaced `shared.method_name` with `dependencies.pluginName.methodName`
- Plugin `name` property renamed `id` to avoid clashing with the global `name` property on classes. Values changed to camelCase.
2. **Commands**
- Introduced "user commands" as a unified interface for commands that can be triggered by users (e.g. from the toolbar, powerbox and powerbuttons)
- Standardized api for toolbar items, powerbox items, shortcuts, and power buttons
- Removed `Plugin.dispatch` and `Plugin.handleCommand` methods
- Introduced `dispatchTo` for event handling and `delegateTo` for overrides
3. **Resource Categorization**
- handlers: functions that are called in response to an event (e.g. selectionchange_handlers)
- overrides: functions that replace a default behavior (e.g. paste_text_overrides)
- predicates: functions that test a condition, returning boolean (e.g. unremovable_node_predicates)
- providers: functions that supply data on demand (e.g. collaboration_peer_metadata_providers)
- processors: composable functions that transform data (e.g. history_step_processors)
- data (no suffix): not functions (e.g. system_classes)
task-4266746
Community: https://github.com/odoo/odoo/pull/186637