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

Pyodide & Solara Integration? #629

Open
SuperPauly opened this issue May 2, 2024 · 1 comment
Open

Pyodide & Solara Integration? #629

SuperPauly opened this issue May 2, 2024 · 1 comment

Comments

@SuperPauly
Copy link

I want to add Pyodide to Solara so the clients can run Python code in the browser.

Having a look over Solara code base i noticed this line:

render_kwargs={"for_pyodide": True}

What does it do? I found it here and was curious to know if there is a simpler way than adding it manually, which brings me onto my next question.

I can see in Solara's documentation that I can have a head tag but I can't use a script tag, is this correct? If so how would I add Pyodide from a CDN?

I have setup the Assets & Public directories but I'm not sure how to use the <script> tag to load Pyodide.

@maartenbreddels
Copy link
Contributor

Hi Paul,

I did some initial work on Pyodide support, but I didn't like how it worked, I'm more of a fan of pycafe, which runs solara unmodified.

However, it seems that you do not want to run solara in Pyodide, but solara with solara-server, and have Pyodide running on a page rendered by solara. If that is correct, maybe it's better to look at:
https://solara.dev/documentation/api/utilities/component_vue
and look at some of the vue files in this repo to see how we use it.
We consider it an advanced usage, but we want to improve the docs on this in the future.

Regards,

Maarten

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