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

React Chat Room example #25

Merged
merged 8 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target
target
node_modules
dist
131 changes: 1 addition & 130 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
workspace = { members = [
"./crates/*",
"./examples/*",
"examples/authentication",
"examples/counter",
"examples/hello_world"
] }
[workspace]
members = [
"./crates/qubit-macros"
]
exclude = [
"./examples/authentication",
"./examples/chaos",
"./examples/chat-room-react/src-rust",
"./examples/counter",
"./examples/hello-world",
]

[package]
name = "qubit"
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ focus on building amazing applications.
qubit = "latest"

ts-rs = "8.1.0" # Required to generate TS types
serde = { version = "1.0", features = ["derive"] } # Required for seraialisable types
serde = { version = "1.0", features = ["derive"] } # Required for serialisable types
futures = "0.3.30" # Required for streaming functionality

tokio = { version = "1.35", features = ["full"] }
Expand Down Expand Up @@ -101,20 +101,22 @@ const api = ws<Server>("ws://localhost:9944/rpc");

// Call the handlers
const message = await api.hello_world();
console.log("recieved from server:", message);
console.log("received from server:", message);
```

## Examples

Checkout all the examples in the [`examples`](./examples) directory.

## Hyper 1.0
## FAQs

### Hyper 1.0

Unfortunately, this crate is blocked by upstream dependencies before it can upgrade to Hyper 1.0
(and other associated packages like Axum 0.7). This is actively being worked on by the upstream
dependencies, so will be arriving soon.

## Qubit?
### Qubit?

The term "Qubit" refers to the fundamental unit of quantum information. Just as a qubit can exist
in a superposition of states, Qubit bridges the gap between Rust and TypeScript, empowering
Expand Down
4 changes: 2 additions & 2 deletions docs/ctx.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Sharing Context

Qubit manages context on a per HTTP request basis. That is, for every incomming HTTP request a new
Qubit manages context on a per HTTP request basis. That is, for every incoming HTTP request a new
`Ctx` instance will be generated. This occurs in the `service_fn` closure within the `to_service`
method on `Router`. This process will include calling the user-defined `build_ctx` method with the
incomming HTTP request, allowing for the state to be populated using request information, including
incoming HTTP request, allowing for the state to be populated using request information, including
headers. Unfortunately, due to the nature of how Axum nests services, the underlying connection
(and therefore information like the IP address of the upstream request initiator) is not accessible
to the context builder. If this is a problem, then raise an issue.
Expand Down
5 changes: 2 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Examples

- [Hello, World](./hello_world)

- [Hello, World](./hello-world)
- [Counter](./counter)

- [Authentication](./authentication)
- [Chat Room (React)](./chat-room-react)
Loading
Loading