reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Uvicorn is imported in common backend module

Open rmorshea opened this issue 2 years ago • 2 comments

Current Situation

Currently Uvicorn gets imported in reactpy.backend._common. This is a problem because not all backends require uvicorn (e.g. Flask). Thus you can get an import error.

Proposed Actions

Make uvicorn a common dependency or import it in a try block.

rmorshea avatar May 25 '23 19:05 rmorshea

I think this has happened before. We might consider just making this a common dependency.

rmorshea avatar May 25 '23 19:05 rmorshea

I don't think it should be a common dependency, solely because reactpy can be installed without specifying any backends.

But I do think Uvicorn should be our default webserver for all reactpy.run calls, assuming a backend was specified during install.

Archmonger avatar May 25 '23 19:05 Archmonger