Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Obsidian v0.3 Discussion #54

Open
11 tasks
jk-gan opened this issue Apr 24, 2020 · 3 comments
Open
11 tasks

Obsidian v0.3 Discussion #54

jk-gan opened this issue Apr 24, 2020 · 3 comments
Labels
discussion New feature discussion
Projects
Milestone

Comments

@jk-gan
Copy link
Member

jk-gan commented Apr 24, 2020

Version 0.3 is about Evolution, we hope to improve DX and productivity by converting it from a micro-framework into rails/phoenix like framework. And this is the first step:

@jk-gan jk-gan added the discussion New feature discussion label Apr 24, 2020
@jk-gan jk-gan mentioned this issue Apr 24, 2020
10 tasks
@jk-gan jk-gan pinned this issue Apr 24, 2020
@jk-gan jk-gan added this to the v0.3 milestone Apr 24, 2020
@jk-gan jk-gan added this to To do in Obsidian via automation Apr 24, 2020
@jk-gan jk-gan moved this from To do to In progress in Obsidian Apr 24, 2020
@pickfire
Copy link

pickfire commented Sep 2, 2020

@jk-gan Just wondering, I tried following zero2prod for actix-web and I noticed that actix-web data extractor is not type-safe during compile time, it error out when I used the wrong data type at runtime. Looks like we have the same thing here, I am wondering if it would be good to explore that since we can probably guarantee that data during compile time?

@jk-gan
Copy link
Member Author

jk-gan commented Sep 5, 2020

can u provide some examples?

@pickfire
Copy link

pickfire commented Sep 6, 2020

The example that I have is in actix-web.

// cargo add actix-web actix-rt
use actix_web::{web, App, HttpServer, Responder};

async fn greet(_data: web::Data<String>) -> impl Responder {
    "Hello world"
}

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().route("/", web::get().to(greet)))
        .bind("127.0.0.1:8000")?
        .run()
        .await
}

It compiles perfectly fine, but

> curl 127.1:8000
App data is not configured, to configure use App::data()

I am sure obsidian have the same issue since it have Context which is checked at runtime. Not sure if it's possible to be able to check it during compile time.

So far, I never know any framework that solves this. If obsidian can successfully tackle this, I think it would be cool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion New feature discussion
Projects
Obsidian
  
In progress
Development

No branches or pull requests

2 participants