Integrate rkt_ws contrib crate as feature into core crate - #21
Open
martynp wants to merge 2 commits into
Open
Conversation
AI-Tool: Claude Code, Codex
There was a problem hiding this comment.
Pull request overview
This PR promotes the existing contrib/ws functionality into the core rkt crate as an optional ws feature exposed via rkt::ws, while keeping rkt_ws as a deprecated, source-compatible shim for one minor release cycle. It also bumps the workspace version to 1.3.0 and updates docs/examples/testing to reflect the new integration.
Changes:
- Add
rkt::wsbehind the newwsfeature in the core crate, backed bytokio-tungstenite. - Convert
rkt_wsinto a deprecated compatibility shim that re-exportsrkt::ws. - Update documentation, examples, and CI/test scripts for
1.3.0and the new WebSocket feature path.
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| website/src/pages/index.js | Updates website copy to point to rkt::ws and bumps displayed version. |
| website/docs/index.md | Bumps guide version reference to 1.3.0. |
| website/docs/14-faq.md | Updates FAQ WebSocket guidance to rkt::ws and notes shim deprecation. |
| website/docs/12-pastebin.md | Bumps version in guide snippet to 1.3.0. |
| website/docs/10-configuration.md | Bumps dependency snippets to 1.3.0. |
| website/docs/06-responses.md | Migrates WebSocket docs/examples from rkt_ws to rkt::ws. |
| website/docs/04-requests.md | Bumps feature-enable examples to 1.3.0. |
| website/docs/02-getting-started.md | Bumps getting-started dependency snippet to 1.3.0. |
| scripts/test.sh | Adds ws to core feature test matrix; adjusts shim testing strategy. |
| release.toml | Updates release command example formatting/parameters. |
| README.md | Removes rkt_ws crate listing; documents WebSockets as rkt::ws + ws feature; bumps version. |
| examples/upgrade/src/main.rs | Switches example to use rkt::ws module import. |
| examples/upgrade/Cargo.toml | Enables rkt’s ws feature and removes explicit rkt_ws dependency. |
| examples/README.md | Updates description of the upgrade example to reference rkt::ws. |
| docs/tests/Cargo.toml | Enables ws feature for docs tests; removes dev-dependency on contrib rkt_ws. |
| core/lib/src/ws/websocket.rs | Adjusts imports/paths for in-core ws module integration. |
| core/lib/src/ws/mod.rs | Adds new rkt::ws module API + Stream! macro and documentation. |
| core/lib/src/ws/duplex.rs | Updates module-internal paths to match new core/lib/src/ws/* layout. |
| core/lib/src/server.rs | Minor formatting change (single-line expression). |
| core/lib/src/serde/uuid.rs | Bumps embedded doc snippet to 1.3.0. |
| core/lib/src/serde/msgpack.rs | Bumps embedded doc snippet to 1.3.0. |
| core/lib/src/serde/json.rs | Bumps embedded doc snippet to 1.3.0. |
| core/lib/src/response/redirect.rs | Fixes doc comment indentation. |
| core/lib/src/request/request.rs | Minor formatting (closure inlining). |
| core/lib/src/listener/quic.rs | Bumps embedded doc snippet to 1.3.0. |
| core/lib/src/listener/proxy.rs | Formatting-only changes for readability in proxy protocol code/tests. |
| core/lib/src/lib.rs | Adds ws feature row to docs and gates new pub mod ws behind feature = "ws". |
| core/lib/src/form/form.rs | Fixes doc comment indentation. |
| core/lib/Cargo.toml | Adds ws feature + optional tokio-tungstenite dependency; updates release replacements. |
| core/codegen/src/lib.rs | Bumps embedded doc snippet to 1.3.0. |
| contrib/ws/tests/legacy.rs | Adds a compatibility test ensuring legacy rkt_ws imports/macros still work. |
| contrib/ws/src/lib.rs | Replaces implementation with deprecated type re-exports to rkt::ws. |
| contrib/ws/README.md | Rewrites README as deprecation notice + migration instructions to rkt::ws. |
| contrib/ws/Cargo.toml | Reworks crate to depend on rkt with ws feature; makes tungstenite feature a no-op alias. |
| contrib/dyn_templates/README.md | Bumps documented version to 1.3.0. |
| CHANGELOG.md | Notes new built-in WebSocket support and shim deprecation policy. |
| Cargo.toml | Bumps workspace/package versions and workspace dependency versions to 1.3.0. |
Suppressed comments (1)
core/lib/src/ws/mod.rs:314
Stream!macro hard-codesrkt::async_stream::try_stream!, which breaks if therktdependency is renamed in Cargo.toml. Use$crate::async_streamso the macro is robust to crate renaming.
ws.stream(move |$channel| rkt::async_stream::try_stream! {
$($token)*
})
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| macro_rules! Stream { | ||
| () => ($crate::ws::Stream!['static]); | ||
| ($l:lifetime) => ( | ||
| $crate::ws::stream::MessageStream<$l, impl rkt::futures::Stream< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI-Tool: Claude Code, Codex