Closed jpg0 closed 4 years ago
Oh, and one other thing as mentioned elsewhere: this really shows that utils.js should be broken up into logical parts. It seems to cover a little bit of everything. For example one of the first things that I'd do is move getItem
, sendCommand
, postUpdate
to items.js (#266)
After looking at this, I have discovered that there is a problem:
scriptExtension.importPreset
isn't present in these contexts
PR as discussed in #267
This implements a CommonJS module system for loading libraries.
I do believe that pulling the loading engine up into OH code would be better, but agree that we should wait for JDK9/ES6 before we do this (although if it really drags on, I may do it). Either way, this PR means that all library code written now would be compatible with that future.