Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pyodide worker a global #142

Open
WardBrian opened this issue Jul 23, 2024 · 4 comments
Open

Make pyodide worker a global #142

WardBrian opened this issue Jul 23, 2024 · 4 comments
Milestone

Comments

@WardBrian
Copy link
Collaborator

This would fix the current frustration that closing then reopening a tab with pyodide inside means it needs to re-download/re-initialize

@magland
Copy link
Collaborator

magland commented Jul 23, 2024

Perhaps this should be global anyway but... more fundamentally the analysis.py react component should not unmount when a new tab is selected. This is important for other reasons, such as maintaining the splitter states and the scroll position in the editor. This needs to be changed in TabWidget. I'm not certain, but I believe a previous version of TabWidget had the property of preserving the child components.

@WardBrian
Copy link
Collaborator Author

You can prevent the tab widget from unmounting its children by using just {children} instead of {value === index && <>{children}</>} on line 59. I believe this has some potentially unintended effects like causing plotly to load in the background even when the tab isn't selected yet

@magland
Copy link
Collaborator

magland commented Jul 23, 2024

It will take some more coding that might look hacky, but I think we should have tab widget load tabs only when they are first opened, and then remember which had been opened. Requires internal state keeping track of which tabs had been opened.

@magland
Copy link
Collaborator

magland commented Jul 24, 2024

I just thought of a reason not to have a single global pyodide worker. We want to be able to kill runs, and I think that involves terminating the worker. So I think the worker should be specific to that editor window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants