Versions of modules (such as Layout.js)

Posted on
  • I'm having some confusion regarding the Layout library: I suspect the version of the code in the current emulator and my Bangle.js device does not match what I see in master on GitHub, and I'm not clear on how versioning works. The docs seem to say that the current version of modules are supposed to be automatically loaded from the app loader, but I seem to still have a version of Layout.js that is almost a year old despite having used my fork of the development app loader definitely much more recently than this.

    Then I happened to notice in the BangleApps repo that there is a Layout.js and a Layout.min.js file, and the latter is several months older than the former, the former containing the functionality I was looking for but in fact I'm guessing the older minified version is in fact the version that is actually getting deployed. I can confirm this by manually installing the non-minified version into the IDE emulator under a different name (different because apparently if I use “Layout” the built-in version still takes precedence), and I see that the specific behavior of the newer code then works.

    Assuming someone simply forgot to update the minified files when making changes, I was going to use EspruinoDocs/bin/minify.js to update the minified modules and PR the update, but I can't get the minifier to work for Layout.js (though I've successfully used it for other files). I get errors I don't really understand; I guess the script doesn't understand the result from the Closure compiler. I've attached the full output log of the minify script.

    If anyone could shed some light on how this works or let me know if I'm barking up the wrong tree somewhere that would be great.

    1 Attachment

  • Ahh, thanks - yes, it looks like a PR went in but they never updated the minified version :(I've just updated it.

    EspruinoDocs/bin/minify.js is definitely the right thing to do... Can you try pulling EspruinoDocs and trying again? I had avoided adding the closure compiler into the repo (in which case it uses the online version which I think may ignore some of the compiler flags we want) but I've just added it so now it'll run offline.

    What happened was the compiler ran but it added some polyfills (which we didn't want) which caused minify.js to fail. Should be ok now

  • Thanks! That seems to work. Darn, I had a back-of-the-mind thought about trying the offline compiler but really didn't expect it to change anything. Looks like I was wrong.

    Should we update dane_arwes.js as well? I'm not sure what uses that, but its corresponding dane_arwes.min.js also appears to have a mismatched commit/timestamp. This looks like the only other minified file in modules/ that I can see.

  • Ok, thanks - yes, doing dane_arwes might be a good idea. It's a 'general purpose UI' library that was made and used for only 2 apps, neither of which works with Bangle.js 2, so I don't think it's a big deal though

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Versions of modules (such as Layout.js)

Posted by Avatar for tev @tev