-
Hi,
thank you all for your replies. I'm still in the process of nailing it down...
First, @HughB, the source code link does indeed not work. It silently assumes that the app loader is built from the "master" branch - while I use master to follow the official repo and use a branch "dh" for my own app loader. I think, this is even suggested in the docs. If you manually exchange "tree/master/apps" with "tree/dh/apps", the source code is shown as expected.
As you all say the problem is not the code but the packaging, I replaces my whole elaborated software with a very simple app:
// Minimum test program E.showMessage("Hallo"); // end of file
…and indeed the behaviour is exactly the same: Works in emulator, works on manual upload, "var/EOF" error on upload from the loader. So, it seems very much that you are right and the probem is in the packaging. I'm still searching, however, what exactly is wrong and which stupid mistake I made…
Best regards,
Dirk -
-
Hi & happy new year everyone,
I am developing an app (a 15 puzzle). I made the first release on my personal copy of the app loader at
https://dirkhillbrecht.github.io/BangleApps/#
If you try to upload the "Garbled 15 puzzle" into a real Bangle 2 (newest v2.11 firmware), you get the error
Upload failed, Unexpected response Uncaught SyntaxError: Got var expected EOF
Uploading into the emulator through the app loader works. If you take the source code from
https://github.com/dirkhillbrecht/BangleApps/blob/dh/apps/p15prob/puzzle15.app.js
and upload it into a Bangle 2 via the Web IDE, it works, too - as long as you disable the variable name shortening in the minification settings.
I know that the source code is quite complex defining classes and having lots of source code comments, but that shouldn't be a problem, should it?
Can anyone explain what's going on here? If you want me to investigate further, please let me know where to start. I do not feel settled enough with the whole Espruino ecosystem to start narrowing down the problem source on my own.
Best regards,
Dirk -
-
I have this source code
class Field { constructor(index, buttonsPerLine) { console.log("Constructor called"); } } var f0=new Field(0,3);
When I upload it into the Bangle 2 emulator using the Web IDE, I get "Constructor called" on the console, as expected.
When I upload it with enabled Esprima minification, I get
Uncaught ReferenceError: "Field" is not defined
at line 1 col 61
...Constructor called')}}var f0=new Field(0,3)When I shrink the source code to simply
class Field { constructor(index, buttonsPerLine) { } } var f0=new Field(0,3);
I see the following error message on uploading the minified code:
Uncaught ReferenceError: "Field" is not defined
at line 1 col 28
class a{constructor(a,b){}}var f0=new Field(0,3)To me it seems that the Esprima minificator changes the name of the defined class from "Field" to "a" and then cannot find the class "Field" - which is not too surprising…
Is this expected behaviour? Am I doing something wrong? I'm quite new to Javascript programming but to me the code looks totally reasonable.
Any help appreciated!
Best regards,
Dirk -
Hi Andi,
thanks for your ideas. My extensions allow to have the seconds "always on", it can be configured just that way. My problem is that the Anton font is not scalable, so I'd need to add an additional "AntonSmall" font for your lowest example. I did not want to do that, so I decided to use the original large Anton font also for the seconds. Space is just sufficient for that on the Bangle.js 2.
I doubt that your second (and also third) proposal works as there must be enough space for four full-width digits ("22:22") for the time, and that would not be sufficient if the seconds are at the same line - even without the colon.
In the meantime, I have added another configuration option whether to use the Vector font for date and day of week (which I find far better to read) or the original scaled 6x8 font which uses Anton 0.03. My pull request for Anton 0.04 is updated accordingly, on my own App Loader, I have an "Anton clock with seconds" v0.09 which incorporates this enhancement.
Best regards, Dirk
-
Hello everyone,
It is always great to see that someone actually is interested in such work! I totally agree with some of the remarks and have adopted the following changes:
- Colorisation of seconds (and date) in seconds screen is configurable and disabled by default.
- Presentation of date in seconds screen is configurable, seconds are centered if no date is shown.
- Initlal settings are chosen in a way to pertain the original look (no seconds, long date format, uppercase)
- Formatting is also tweaked a bit to resemble v0.03.
- Added a README.md according to the "best practices" documentation.
I have not changed using the "Vector" font instead of the scaled "6x8" font for all non-"Anton" text. It just looks way better. Actually, this is what I really like about the Anton clock: It is really very well readable as it uses this large, clear font.
You might want to give it another try on
https://dirkhillbrecht.github.io/BangleApps/#
There, I do not only have it as an independent "Anton clock with seconds" (now in v0.08), but also as change to the "official" Anton clock in the way I issued it as pull request. Whether it should be such an extension or a new clock is still discussed in the github pull request. I would prefer it to be an update to the existing Anton clock as it really is exactly this: An update to the existing Anton clock.
Regards, Dirk
- Colorisation of seconds (and date) in seconds screen is configurable and disabled by default.
-
Hello everyone,
I really like the Anton watch as it has IMHO the clearest digit set. I also really like my watch to show seconds. I combined both together and created an extended version of the Anton Clock watch:
Show seconds (also in Anton font), either always or only if the (Bangle 2) display is unlocked.
Show date in ISO-8601 format, regardless of the locale.
Make weekday presentation configurable
Make upper-case conversion configurable
I already issued a pull request but in the meantime I'd like to invite you to test it and give me any kind of feedback.
I've created an independent version "Anton Clock with seconds" and uploaded it to my own App Loader copy on
https://dirkhillbrecht.github.io/BangleApps/#
Source code in
https://github.com/dirkhillbrecht/BangleApps/tree/dh/apps/antwsclk
Feel free to give it a try. I'd love to get any feedback. I developed it for the Bangle.js 2. I also tested it against the Bangle.js 1 using the emulator.
Best regards,
Dirk -
Hi,
I finally got it: I garbled the JS for the app icon! I misunderstood the docs for creating app-icon.js on https://github.com/espruino/BangleApps . I did not enable compression and I copied the result of the converter verbatim into app-icon.js. Either that
var img =
at the beginning orE.toArrayBuffer
generated due to the missing compression broke the app loader's neck.With the correct icon file deployment works now. I removed the "Garbled 15 puzzle" "app" from my loader and released a new version 0.02 of the "real" app with working deployment. It is also already actually playable, even though there are still some problems with the menu system. I'm on it.
Thanks again for pointing me into the right direction. Your help was greatly appreciated!
Best regards,
Dirk