pojala/electrino

Adding support for Objective-C modules

ninjaprawn opened this issue · 4 comments

When writing #5, I thought of an idea of having Objective-C modules, which would allow developers to create modules written in JS (like the default ones), so they can use the Obj-C APIs without needing to expose each API into JS.

After pursuing this idea (I converted the current default modules except for the electrino module), a new folder exists known as modules. Developers would be allowed to drag and drop external modules which are automatically exposed to JS.

This also allows developers to pick and choose specific modules they want, allowing for smaller binary sizes.

I have left just the electrino module within the application. It would most likely be common sense to leave some modules within the application (like console).

Feel free to leave your opinions below :)

tbodt commented

I think it would be a good idea to move as far away from Objective-C/Foundation/Cocoa as possible (see #4). It's likely that to port this thing to other operating systems, most/all of the Objective-C code will have to be ripped out or rewritten in some other language, so let's not write any more of that.

The folder structure within the app with Obj-C modules:
Folder Structure

@tbodt Hm. I understand this. I guess I'll wait until someone figures out a solution to this. I feel that it will be difficult to implement a universal solution, but who knows what will happen!

Really cool idea. My personal feeling is that it's perfectly ok to do this kind of features in a macOS-specific way because I'd like Electrino apps to always be good citizens of the target platform, rather than an "inner platform" in themselves.