Use official JupyterLite lifecycle instead of fragile log-based readiness detection#120
Conversation
|
@mohab-elshamy I will check this soon! |
|
@mohab-elshamy Great approach using app.restored — that's more reliable than app.started too since it waits for the full layout restore. One thing I noticed while working on this issue: the JupyterLiteStorageService is also duplicated in two places (forageIndexDb.ts in admin and localforageIndexdb.ts in projects) with slightly different IndexedDB names. Worth consolidating as part of this cleanup. Also found a window event listener leak in ProjectNotebookItemDisplayComponent — ngOnDestroy never removes the message listener added in ngOnInit. |
|
@mohab-elshamy I like this solution, but where's the source code of the new JupyterLite plugin? Can we move that to a subfolder here? |
|
@mohab-elshamy also, since now we have a plugin, can we make the commit functionality less fragile as well? In particular, it would be good to have the saved changes to notebooks automatically detected by Analysim. Please make a post on Neurostars if you want to submit a project to GSoC and you can email me at cgunay AT ggc.edu. |
|
Good morning @cengique , I’ve now added the plugin source code in a subfolder. I also took a look at the commit flow in the project, and it seems there are a few improvements I can make through the plugin instead of relying on reading directly from browser storage. I’ll work on that in a future PR. |
Ok, this sounds good. Are you planning to submit an application to GSoC for this project? You should email me a draft since it's due next week. |
Background
The current Analysim–JupyterLite integration detects readiness by intercepting an internal log message:
This approach is fragile since it depends on undocumented logging behavior and may break with future JupyterLite updates.
Solution
This PR introduces a pure frontend JupyterLab extension that:
app.restoredto ensure JupyterLite is fully initializedThe extension is published on PyPI and added to
requirements.txt, allowing anyone to install it easily:Benefits
Closes #114