[TIMOB-6854] iOS "load" event when the engine ends parsing the JavaScript code
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2016-08-22T20:45:26.000+0000 |
Affected Version/s | Release 1.7.5, Release 1.8.0.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Karol Pomaski |
Assignee | Ingo Muschenetz |
Created | 2011-12-22T15:35:21.000+0000 |
Updated | 2017-03-22T21:39:02.000+0000 |
That event is meaningful in browser environment, but in my opinion has no sense in Titanium environment, since "app.js" is entrance point so application is loaded when "app.js" starts to execute. On the other hand, "Ti.include" and "require" are blocking operations. That means that JS code execution is blocked until included file is loaded and parsed and therefore there is no need to wait for "load" event.
There is a use case where 3rd party modules or other scripts may need to hook into a "load" event for other JS files.
I'm not sure if this ticket refers to exposing an event from the Titanium JavaScript environment or from the native Titanium module API. Since it references the "load" event in the context of web pages, I assume it means having a "load" event from the Titanium JavaScript environment. As Ivan suggested, there is no point in having a "load" event since the
app.js
is executed right away. There is no DOM like a web page that takes time to load external scripts.Ti.include()
has been deprecated, no need for a "load" event for that.require()
is blocking and when it returns, that's when you know the module has been loaded. If you need an event to be emitted, then you will have to wraprequire()
and emit your own event. Perhaps in a future Titanium release we will have a module loader similar to Node.js where you can register/change module extension handlers and such. If this ticket was meant to be about exposing a native API, then I ask we open another ticket specifically for that and include a valid use case.Closing ticket as "Won't Fix".