Plugins conflict

134 views
Skip to first unread message

Seb Seb

unread,
Feb 20, 2024, 11:26:19 AM2/20/24
to Blockly
Hello,
when installing several plugins in my application, unless I've made some declaration errors, I've noticed that there are conflicts due to function names.
First of all the backpack and block-shareable-procedures, I get the message :
Error: Extension "procedure_def_mutator" is already registered.
    register$$module$build$src$core$extensions blockly_compressed.js:322
    registerMutator$$module$build$src$core$extensions blockly_compressed.js:324
    <anonymous> index.js:2
    <anonymous> index.js:2
    <anonymous> index.js:2
    <anonymous> index.js:2
    <anonymous> index.js:2
    node_modules bundle.js:28
    __webpack_require__ bundle.js:7651
    fn bundle.js:7873
    <anonymous> index.ts:3259
    ts bundle.js:7465
    __webpack_require__ bundle.js:7651
    <anonymous> bundle.js:8817
    <anonymous> bundle.js:8819

Then with the @mit-app-inventor/blockly-plugin-workspace-multiselect plugin which has the same 'copy' function name as the keyboard navigation plugin.

Can anyone confirm these conflicts?
Thank you in advance for any possible solutions.

Songlin Jiang

unread,
Feb 21, 2024, 10:51:50 AM2/21/24
to Blockly
Hi,

Thank you for your report. "@mit-app-inventor/blockly-plugin-workspace-multiselect" plugin needs to do some customization to the keyboard shortcut/context menu so that we can support multi-block copy and paste, so those are necessary.

I'm not familiar with the keyboard navigation plugin, so I haven't tested it extensively for integration. As a workaround for integrating with the keyboard navigation plugin, I find that if you initialize the keyboard navigation plugin after the multi-select plugin, then it doesn't trigger any error. If you find further issues at runtime, I guess you can temporarily unregister the multi-select plugin when keyboard navigation is activated. Let me know if you find anything that can be fixed at "@mit-app-inventor/blockly-plugin-workspace-multiselect" by raising an issue at https://github.com/mit-cml/workspace-multiselect/issues.

Seb Seb

unread,
Feb 25, 2024, 6:40:52 PM2/25/24
to Blockly
Thanks,
but even if I initialize the keyboard navigation plugin after the multi-select plugin, I have an error : if I select (keyboard shortcut or icon lick on workspace) it works and when I release by clicking group icon on workspace, there's a message error

Maribeth Moffatt

unread,
Feb 29, 2024, 12:59:36 PM2/29/24
to Blockly
Hi,

It is unfortunately expected that some plugins are not compatible with all others. In some cases this may be because two plugins install their own version of a Blockly class. In cases like that you'd have to create your own subclass that implements the pieces you need from both plugins. For the case where the "copy" shortcut is registered in both, that is similar. You would need to implement your own version of the shortcut that has the functionality from both plugins. In cases like these where two plugins implement the same functionality in different ways, there's just not a good way to make that work automatically as plugins don't know what other plugins are installed. But you should be able to resolve that by writing a custom one.

For the first case you mention, where it seems like `backpack` and `shareable-procedures` are incompatible, I don't think that should be possible. The backpack plugin does not deal with block definitions or mutators at all. Is it possible that you also have the `blocks-plus-minus` installed? That plugin is not compatible with the shareable procedures, because they both define their own procedure blocks that don't have the same functionality. One is based on the old style of procedures that are still in core, which do not use backing data models. It adds plus/minus buttons to deal with adding more parameters, instead of the standard mutator UI. Meanwhile the shareable-procedures plugin is a different kind of procedure block that uses backing data models so you can reference procedures whose blocks don't exist on the workspace. There are a couple options for dealing with this conflict:
- Use the plus/minus blocks for list, if, etc. but not for procedures. Unfortunately right now it is not possible to only install certain blocks from the plugin, since it installs them all as soon as you load the plugin. We have an issue open to fix that if you'd be interested in contributing. Otherwise, you could load this plugin first, then unregister the conflicting mutator. Then use the shareable-procedures plugin to uninstall the old procedures block definition and just use the standard shareable-procedures blocks.
- Implement shareable-procedures blocks with the plus/minus UI. You would need to create custom procedure blocks in order to do this, and use the ideas in the plus-minus plugin for designing the UI instead of the standard mutator UI. We have a guide on how to create custom procedure blocks.

I hope that helps!
Maribeth
Reply all
Reply to author
Forward
0 new messages