Closed rohansingh closed 4 months ago
Holy smokes @rohansingh
When is this going live? Could be game changer for apps that need to render a lot of images.
@jmanske Ideally this week. Agreed, it will be great for images and other assets. The primary motivation is to be able to include audio files for Tidbyt Gen 2.
Offline review from @matslina:
readall()
, since seeking isn't necessaryserve
and bundle
.Deferred for future PR's:
render.Image
could accept a file object, so it’s easy for devs to not do redundant calls to readall
. Thinking of apps that load 100 assets, but only show 2 per run depending on config.readall
the data on every run. Should files have some internal attribute asset_id
set to myapp/icon.mp3
or equivalent, that then gets passed on to firmware?load("tidbyt/skip_forward.mp3", meeting_starts_audio = "file")
?
Starlark scripts can now load arbitrary files from their bundle and read them using a Python-like
open()
andread()
API. Areadall()
convenience function is also provided.The examples have been updated to use this functionality where relevant. For example:
Supporting changes:
The
pixlet render
command can now accept an entire directory containing multiple Starlark files and static resources.The
pixlet private bundle
command can now accept an entire directory. It will load the applet contained in the directory, and bundle any files that the applet itself loads. Not that "private" is a misnomer, this command is used by both private and community apps.App manifests no longer contain a
fileName
attribute, since an app may contain multiple files.packageName
has been removed as well, since it is no longer used for anything.