You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The issue you're hitting is that when you upload via the IDE, the code is executed/interpreted as it is uploaded - the actual JS text never exists in Bangle.js's RAM in one big block.

    When you save to a file, Espruino has to load that whole file into RAM and execute from there.

    So if you have to split the file up to save it, you may well hit issues trying to load/execute it too :(

    You've got two main options I guess:

    • Split your app into multiple files - have one main one that loads, and then 'eval' extra files from Storage. Even better if you can do it as/when they're needed.
    • Minify your code and upload the minified version to a file. At some point the IDE will be modified to do it all for you, but right now it's a little more tricky (but a lot easier than what you had to do to upload the code!)

    I'm planning on adding the ability to execute JS code directly from external storage which would basically solve all your issues, but that's going to need a bunch of testing before I can put it live.

About

Avatar for Gordon @Gordon started