Closed
Bug 971442
Opened 11 years ago
Closed 10 years ago
[System2] Instantiable System
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1094759
People
(Reporter: alive, Unassigned)
References
Details
We need system.js to be instantiable and let bootstrap to instantiate it.
Also jsdoc + unit test wanted.
Reporter | ||
Updated•11 years ago
|
Reporter | ||
Updated•11 years ago
|
Blocks: system-app-v2
No longer depends on: system-app-v2
Comment 1•11 years ago
|
||
This one seems pretty simple, I'll take it.
Assignee: nobody → kgrandon
Status: NEW → ASSIGNED
Updated•11 years ago
|
Whiteboard: [c= p=2 s= u=]
Comment 2•11 years ago
|
||
Signing up as the backup assignee of this bug :)
Comment 3•11 years ago
|
||
Sure thing Tim :) I have a million things to do - so if you're interested it's all yours. Otherwise feel free to send it back to me.
Comment 4•11 years ago
|
||
This bug is not as easy to solve as it seems.
First of all, I don't know if I should <script defer> system.js and/or bootstrap.js. If we defer them, nothing (e.g. event listeners) will be run before the DOM is ready, therefore we might lose some time to show something fast like the init logo.
I have also investigated more and it seems bug 793082 is still valid in terms making sure mozChromeEvent timing issue.
However, bug 924032 moved launch request away from mozChromeEvent, so I would worry we would miss that. Given the fact it will probably not a bug fixable here, I will ignore that.
Comment 5•11 years ago
|
||
The other problem around NOT using <script defer> for bootstrip.js is that DOMContentLoaded is currently affected by bug 688580, so there is no way for non-defered script to get a consistent callback at the moment right after all other deferred scripts.
Comment 6•11 years ago
|
||
I was looking at this a bit earlier, and we probably do need a *single* non-deferred object. My thoughts were that we could combine system.js and bootstrap.js into a single app containing class. Things that don't need to be there onload could be moved into other files, or within a bootstrap method. E.g., in a new app.js:
function App() {
... // Add any necessary listeners
window.addEventListener('load', this.bootstrap.bind(this));
window.addEventListener('mozChromeEvent', this);
}
App.prototype = {
bootstrap: function() {
this.activities = new Activities();
this.devtoolsView = new DevtoolsView();
this.ttlView = new TTLView();
// Other new and exciting classes.
}
};
// Inside same file (or app_init.js for easy unit testing)
window.app = new App();
Anyway, I'm not sure if it solves your problem - but just throwing my thoughts in here.
Comment 7•10 years ago
|
||
Anything needs to be done here is probably all covered in bug 1094759.
Assignee: timdream → nobody
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•