From 802a04c92f02b2807668bc880c5716af53d72cbf Mon Sep 17 00:00:00 2001 From: leon3s Date: Tue, 9 Jan 2024 12:04:35 +0100 Subject: [PATCH] chore: prepare 1.0 release --- .github/workflows/rust.yml | 3 +-- examples/application/Cargo.toml | 2 +- examples/async-handlers/Cargo.toml | 2 +- examples/databases/Cargo.toml | 2 +- examples/either/Cargo.toml | 2 +- examples/errors/Cargo.toml | 2 +- examples/extractors/Cargo.toml | 2 +- examples/flexible-responders/Cargo.toml | 2 +- examples/getting-started/Cargo.toml | 2 +- examples/http2/Cargo.toml | 2 +- examples/main-example/Cargo.toml | 2 +- examples/middleware/Cargo.toml | 4 ++-- examples/middleware/src/errorhandler.rs | 5 ++--- examples/middleware/src/main.rs | 9 +++------ examples/powerful-extractors/Cargo.toml | 2 +- examples/request-handlers/Cargo.toml | 2 +- examples/request-routing/Cargo.toml | 2 +- examples/requests/Cargo.toml | 4 ++-- examples/responses/Cargo.toml | 2 +- examples/server/Cargo.toml | 2 +- examples/static-files/Cargo.toml | 4 ++-- examples/testing/Cargo.toml | 2 +- examples/url-dispatch/Cargo.toml | 2 +- examples/websockets/Cargo.toml | 2 +- vars.js | 4 ++-- 25 files changed, 32 insertions(+), 37 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3328db0..776cdd4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,8 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rust-lang/setup-rust-toolchain@v1.3.5 - + - uses: actions-rust-lang/setup-rust-toolchain@v1.6 - name: test examples run: | cd examples diff --git a/examples/application/Cargo.toml b/examples/application/Cargo.toml index b3ec0d6..3e8ca26 100644 --- a/examples/application/Cargo.toml +++ b/examples/application/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/async-handlers/Cargo.toml b/examples/async-handlers/Cargo.toml index 800c163..00bcf56 100644 --- a/examples/async-handlers/Cargo.toml +++ b/examples/async-handlers/Cargo.toml @@ -4,6 +4,6 @@ version = "2.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } futures = "0.3.1" bytes = "0.5" diff --git a/examples/databases/Cargo.toml b/examples/databases/Cargo.toml index c8fd166..4104092 100644 --- a/examples/databases/Cargo.toml +++ b/examples/databases/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diesel = { version = "2", features = ["sqlite", "r2d2"] } serde = { version = "1", features = ["derive"] } uuid = { version = "1", features = ["v4"] } diff --git a/examples/either/Cargo.toml b/examples/either/Cargo.toml index 5a761ae..07b7d11 100644 --- a/examples/either/Cargo.toml +++ b/examples/either/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/errors/Cargo.toml b/examples/errors/Cargo.toml index dc88f58..73857e5 100644 --- a/examples/errors/Cargo.toml +++ b/examples/errors/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } derive_more = "0.99" env_logger = "0.7" log = "0.4" diff --git a/examples/extractors/Cargo.toml b/examples/extractors/Cargo.toml index 3c10bf8..83ad94f 100644 --- a/examples/extractors/Cargo.toml +++ b/examples/extractors/Cargo.toml @@ -4,6 +4,6 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } serde = "1.0" serde_json = "1.0" diff --git a/examples/flexible-responders/Cargo.toml b/examples/flexible-responders/Cargo.toml index aa01748..e53acf6 100644 --- a/examples/flexible-responders/Cargo.toml +++ b/examples/flexible-responders/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } serde = "1.0" diff --git a/examples/getting-started/Cargo.toml b/examples/getting-started/Cargo.toml index 8ef6b63..bf229d5 100644 --- a/examples/getting-started/Cargo.toml +++ b/examples/getting-started/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/http2/Cargo.toml b/examples/http2/Cargo.toml index e4ccc42..1289e72 100644 --- a/examples/http2/Cargo.toml +++ b/examples/http2/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio", "openssl"] } +ntex = { version = "1.0.0-b.1", features = ["tokio", "openssl"] } openssl = { version = "0.10", features = ["v110", "vendored"] } diff --git a/examples/main-example/Cargo.toml b/examples/main-example/Cargo.toml index 0b4b17c..e8e0eb3 100644 --- a/examples/main-example/Cargo.toml +++ b/examples/main-example/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/middleware/Cargo.toml b/examples/middleware/Cargo.toml index 9c2075e..92f5829 100644 --- a/examples/middleware/Cargo.toml +++ b/examples/middleware/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio", "cookie"] } -ntex-session = { version = "0.3.0" } +ntex = { version = "1.0.0-b.1", features = ["tokio", "cookie"] } +ntex-session = { version = "0.4.0-b.0" } futures-util = { version = "0.3.7", default-features = false, features = ["std"] } env_logger = "0.10.0" diff --git a/examples/middleware/src/errorhandler.rs b/examples/middleware/src/errorhandler.rs index 89bd25d..4e6bdd5 100644 --- a/examples/middleware/src/errorhandler.rs +++ b/examples/middleware/src/errorhandler.rs @@ -1,9 +1,9 @@ #![allow(dead_code)] +use futures_util::Future; // use ntex::http::header; use ntex::service::{Middleware, Service, ServiceCtx}; -use ntex::util::BoxFuture; use ntex::web; pub struct Error; @@ -27,11 +27,10 @@ where { type Response = web::WebResponse; type Error = web::Error; - type Future<'f> = BoxFuture<'f, Result> where Self: 'f; ntex::forward_poll_ready!(service); - fn call<'a>(&'a self, req: web::WebRequest, ctx: ServiceCtx<'a, Self>) -> Self::Future<'_> { + fn call(&self, req: web::WebRequest, ctx: ServiceCtx) -> impl Future> { Box::pin(async move { ctx.call(&self.service, req).await.map(|mut res| { let status = res.status(); diff --git a/examples/middleware/src/main.rs b/examples/middleware/src/main.rs index e32f5fc..26b48c9 100644 --- a/examples/middleware/src/main.rs +++ b/examples/middleware/src/main.rs @@ -3,9 +3,9 @@ pub mod errorhandler; pub mod logger; pub mod user_sessions; +use futures_util::Future; // use ntex::service::{Middleware, Service, ServiceCtx}; -use ntex::util::BoxFuture; use ntex::web; // There are two steps in middleware processing. @@ -33,17 +33,14 @@ where { type Response = web::WebResponse; type Error = web::Error; - type Future<'f> = BoxFuture<'f, Result> where Self: 'f; ntex::forward_poll_ready!(service); - fn call<'a>(&'a self, req: web::WebRequest, ctx: ServiceCtx<'a, Self>) -> Self::Future<'_> { + fn call(&self, req: web::WebRequest, ctx: ServiceCtx) -> impl Future> { println!("Hi from start. You requested: {}", req.path()); - - let fut = ctx.call(&self.service, req); Box::pin(async move { + let fut = ctx.call(&self.service, req); let res = fut.await?; - println!("Hi from response"); Ok(res) }) diff --git a/examples/powerful-extractors/Cargo.toml b/examples/powerful-extractors/Cargo.toml index f045e8c..65ea787 100644 --- a/examples/powerful-extractors/Cargo.toml +++ b/examples/powerful-extractors/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } serde = "1.0" diff --git a/examples/request-handlers/Cargo.toml b/examples/request-handlers/Cargo.toml index b2080d0..d97cd0c 100644 --- a/examples/request-handlers/Cargo.toml +++ b/examples/request-handlers/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/request-routing/Cargo.toml b/examples/request-routing/Cargo.toml index 12e7d16..8a4f8a6 100644 --- a/examples/request-routing/Cargo.toml +++ b/examples/request-routing/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/examples/requests/Cargo.toml b/examples/requests/Cargo.toml index 8d0fcc9..f24d2f2 100644 --- a/examples/requests/Cargo.toml +++ b/examples/requests/Cargo.toml @@ -6,6 +6,6 @@ edition = "2018" [dependencies] serde = "1.0" serde_json = "1.0" -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } futures = "0.3.1" -ntex-multipart = "0.3.0" +ntex-multipart = "0.4.0-b.0" diff --git a/examples/responses/Cargo.toml b/examples/responses/Cargo.toml index 642509f..a08aa8b 100644 --- a/examples/responses/Cargo.toml +++ b/examples/responses/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio", "compress"] } +ntex = { version = "1.0.0-b.1", features = ["tokio", "compress"] } serde = "1.0" futures = "0.3.1" bytes = "0.5" diff --git a/examples/server/Cargo.toml b/examples/server/Cargo.toml index 4cdc35f..5ba1a8f 100644 --- a/examples/server/Cargo.toml +++ b/examples/server/Cargo.toml @@ -5,7 +5,7 @@ workspace = "../" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio", "openssl"] } +ntex = { version = "1.0.0-b.1", features = ["tokio", "openssl"] } futures = "0.3" openssl = { version = "0.10", features = ["vendored"] } tokio = { version = "1.16.1", features = ["full"] } diff --git a/examples/static-files/Cargo.toml b/examples/static-files/Cargo.toml index e74c30a..d98e265 100644 --- a/examples/static-files/Cargo.toml +++ b/examples/static-files/Cargo.toml @@ -4,6 +4,6 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } -ntex-files = "0.3.0" +ntex = { version = "1.0.0-b.1", features = ["tokio"] } +ntex-files = "0.4.0-b.0" mime = "0.3" diff --git a/examples/testing/Cargo.toml b/examples/testing/Cargo.toml index e6f3d9b..29669f5 100644 --- a/examples/testing/Cargo.toml +++ b/examples/testing/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } futures = "0.3" futures-util = "0.3" bytes = "0.5" diff --git a/examples/url-dispatch/Cargo.toml b/examples/url-dispatch/Cargo.toml index 5805645..c7eec03 100644 --- a/examples/url-dispatch/Cargo.toml +++ b/examples/url-dispatch/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } futures = "0.3.1" openssl = "0.10" serde = "1.0" diff --git a/examples/websockets/Cargo.toml b/examples/websockets/Cargo.toml index 32f9c13..5b47d1a 100644 --- a/examples/websockets/Cargo.toml +++ b/examples/websockets/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" [dependencies] futures = "0.3.27" -ntex = { version = "0.7", features = ["tokio"] } +ntex = { version = "1.0.0-b.1", features = ["tokio"] } diff --git a/vars.js b/vars.js index 05a4555..1d962cf 100644 --- a/vars.js +++ b/vars.js @@ -1,4 +1,4 @@ module.exports = { - rustVersion: '1.66', - ntexMajorVersion: '0.7', + rustVersion: '1.75', + ntexMajorVersion: '1.0', };