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

Add "HTTP Mode" to ReactPy-Django #191

Closed
Archmonger opened this issue Oct 1, 2023 · 1 comment
Closed

Add "HTTP Mode" to ReactPy-Django #191

Archmonger opened this issue Oct 1, 2023 · 1 comment

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Oct 1, 2023

Current Situation

All components are currently rendered solely via WebSockets. This is highly convenient for development and state management purposes, however, it limits ReactPy-Django to ASGI applications and cloud hosting services that support WebSocket.

Proposed Actions

Develop a HTTP mode, which will require two things

  • A separate HTTP client
  • A separate HTTP backend, which involves reading/writing ReactPy's Layout from the database.
    • Our Layout must be serialized via dill.pickle. We need to also be able to handle scenarios where deserialization fails (such as when the Layout API has changed), and we fallback to a new layout.
    • This backend will likely involve adding a layout = models.BinaryField(null=True, blank=True) field to our ComponentSession database model.

We might also want to develop some (optional?) way to automatically fall back to HTTP if WebSocket connections fail.

I'm honestly not sure if there's a way to make use_effect hooks work properly under this paradigm.

@Archmonger
Copy link
Contributor Author

Creating a system where use_effect would work with HTTP would be a large maintenance burden, so I'm closing this issue.

@Archmonger Archmonger closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant