Conversation
✅ Deploy Preview for openrefine-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@Abbe98, @sunilnatraj, since both of you have worked on extensions, would you mind reading over this new bit of Butterfly documentation? I'd be interested in hearing if you find it useful, and/or if anything else would be useful to include here. |
tfmorris
left a comment
There was a problem hiding this comment.
I just discovered these six month old comments from a review that I never submitted. Sorry!
The comment about "non-obvious conceptual stuff" probably needs expansion/explanation, but I'm going to submit this without further edits so it doesn't get pushed down on the stack again.
|
|
||
| Butterfly organizes back-end functionality using a collection of modules. The only module exposed by OpenRefine is the `core` module, which provides extension points for other modules to hook into. | ||
|
|
||
| Each module uses a JavaScript file named `controller.js` to connect different parts of the backend. Butterfly uses a JavaScript interpreter to run this and other provided JavaScript files to configure the back-end. Extensions rely on `controller.js`, and specifically an `init` method within that file, to leverage the aforementioned extension points. |
There was a problem hiding this comment.
Probably worth explaining how the Javascript/Java "glue" works here (or at least point to the extension docs).
More generally some of the non-obvious conceptual stuff should receive a significant portion of the attention.
|
|
||
| Each module uses a JavaScript file named `controller.js` to connect different parts of the backend. Butterfly uses a JavaScript interpreter to run this and other provided JavaScript files to configure the back-end. Extensions rely on `controller.js`, and specifically an `init` method within that file, to leverage the aforementioned extension points. | ||
|
|
||
| While Butterfly does allow for modules to manage their own API endpoints, extension modules typically register their endpoints through the form of commands. HTTP requests for those commands are then dispatched by the `core` module. |
There was a problem hiding this comment.
True for HTTP commands, but there are many other extension registries for importers, exporters, GREL functions, etc.
Co-authored-by: Tom Morris <tfmorris@gmail.com>
✅ Deploy Preview for openrefine-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
As I learn more about OpenRefine's codebase, I figured I could contribute a little bit of what I've learned about Butterfly to the documentation. I've been trying to figure out an appropriate scope for an initial section on Butterfly (e.g. is it worthwhile to go into how request routing works?) but in the end decided to provide a small starting point and get feedback from others on where additional documentation might be helpful.