solara icon indicating copy to clipboard operation
solara copied to clipboard

Pyodide & Solara Integration?

Open SuperPauly opened this issue 1 year ago • 1 comments

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

SuperPauly avatar May 02 '24 19:05 SuperPauly

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

maartenbreddels avatar May 08 '24 15:05 maartenbreddels