Col-E / Recaf

The modern Java bytecode editor
https://recaf.coley.software
MIT License
5.96k stars 462 forks source link

Intermediate API for plugins & hiding implementation detail behind a stable facade #675

Open Col-E opened 1 year ago

Col-E commented 1 year ago

Create an intermediary plugin API to allow "quickstarting" plugins. Currently the plugin module is just a plugin system, with no direct relations to Recaf's logic. If a user wanted to be able to do something like "Insert X into context menu for Classes" there should be an API of sorts to allow such things to handled internally. The user would create their MenuItem instance and pass it off to the API and the rest gets handled by us.

This will also drastically reduce the amount of developer error when making plugins our of incorrect assumptions about the internal work. Plus we can create the API as the "preferred" means of interacting with Recaf and then be free to make wild breaking changes to core so long as the API stays in-tact.

This may require a LOT of internal restructuring to implement properly, probably involving Dependency injection (JSR-330) or a more in-depth CDI setup.

Col-E commented 1 year ago

That internal restructuring is being done on https://github.com/Col-E/recaf-3x-rewrite-temp just for a clean git history, then will be squashed and grafted onto dev3

Col-E commented 1 year ago

The original issue content is made in the context of 3x. The large scale internal changes in 4x more easily facilitate this.