omniJS - 'Write once' goal - divergent selection API on iOS & macOS?

In relation to the appealing goal of writing code once and using it on both platforms, I notice from the docs and the console that there seems to be some divergence in the selection api between the iOS and the macOS builds.

Experimenting with building an object browser as an aid to learning and scripting, I found that the prototype of window.selection is Selection on macOS but ActionSelection on iOS.

The latter, which has fewer properties than the former, doesn’t appear in the macOS documentation.

Are the two builds just a little out of step with each other, or does this look like an area in which the two platforms will continue to behave a little differently and require different code ?

Constrasting console inspections of the type of window.selection below:

macOS: Selection -> [canvas, graphics, solids, lines, document, view]

iOS: ActionSelection -> [document, view]

Could this, in particular, be relevant to a bug in which plugin code which works on macOS fails on iOS, passing the wrong selection reference (selection.canvas reference not updated) to plugin actions ?

See:

https://discourse-test.omnigroup.com/t/omnijs-ios-code-vs-macos-code-narrowing-the-two-version-gap/32716/3?u=draft8

The APIs are, effectively, identical. On iOS there is an extra prototype for ActionSelection, but it inherits from Selection, so the other property names (canvas, graphics, solids, etc) are still available. It looks like the difference was just an oversight in construction, but I’ll look into it a bit more.

1 Like