You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I recall responding to this when it was first posted. Perhaps I forgot to hit "Reply"?
The change is deliberate, because preload doesn't do anything in a mod. This can lead to developer confusion. An error is the most reliable way to avoid the mistake.
I suppose we could treat it as a warning instead. Before deciding, I would like to understand which module(s) you are seeing this on, to make sure the solution is the right one. Thank you.
A simple example would be using a sensor driver from a Stack-chan mod user application.
In that case, it first tries to include a manifest file like $(MODDABLE)/modules/drivers/sensors/paj7620u2/manifest.json, but this fails. It’s true that directly loading the module would solve the issue, but if the manifest file has a lot of content or includes additional manifest files, it would likely require a amount of work.
Thanks for the example. It is a little different than what I had in mind. But, it is a reasonable use. We definitely want developers using the manifests to include modules, as this avoids all sorts of problems.
The decision to preload isn't always the module itself. A module can indicate that it is compatible with preload. That's really what the "preload" attribute means. We've developed a coding style in the Moddable SDK that allows the vast majority of modules to be compatible with preload, but it isn't always the case. There are other reasons a host might not want to preload a module, for example to allow it to be overridden by a mod at runtime. We don't have a solution to describe that in the manifest at this time though.
So, we should reduce the error to warning. That's practical.
How does this look to you?
if(this.manifest.preload?.length){trace("Warning: preload is unavailable in mods. These modules request preload:\n")this.manifest.preload.forEach(item=>trace(` ${item}\n`));}
Thank you for the detailed explanation. I feel like I have a much better understanding of preload now.
How does this look to you?
if (this.manifest.preload?.length) {
trace("Warning: preload is unavailable in mods. These modules request preload:\n")
this.manifest.preload.forEach(item => trace(` ${item}\n`));
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
In e56f371, preload can no longer be used in mod. I understand that preload cannot be used in mod, but many module manifest files preload the module.
How about ignoring preload when building mod and outputting a warning log?
All reactions