Conversation
* Bump wasm-streams * Use Body::into_readable_stream * fmt * clippy * Remove unused js hack * clippy * Added remaining routes and fixed testes (#473) * Added test script to package.json. * Added worker-sandbox r2 routes. * Added worker-build to the npm test script. * Added worker-sandbox r2 routes - cleanup. * Added worker-sandbox queue routes. * Added worker-sandbox service-bindings routes - implied porting and adapting some improvements from the latest version. * Added worker-sandbox service-bindings routes - implied porting and adapting some improvements from the latest version - fmt. * Added worker-sandbox cache stream route - Implied porting some more recent stuff. * Added worker-sandbox remaining cache routes. * Added worker-sandbox init called route. * Added worker-sandbox custom-response-body route. * Added worker-sandbox now route. * Added worker-sandbox redirect-307 route. * Added worker-sandbox redirect-default route. * Added worker-sandbox subrequests routes and fetch helpers that were requeried. * Added worker-sandbox subrequests fetch-timeout to be shorter. * Added worker-sandbox request catchall fixed test case. * Added worker-sandbox request xor route. * Added worker-sandbox request xor route. * Added worker-sandbox websocket route. * worker-sandbox queue routes clean up. * worker unused dependencies clean up. * worker-sandbox: Added missing d1 routes and improved d1 tests to use miniflare. * worker-sandbox: Clippy. * worker-sandbox: fmt. --------- Co-authored-by: Alexandre Faria <alexandre.faria@auroka.pt>
|
@spigaz I've merged main into this branch. Looks like I broke 4 tests that I'm working on now. I have to say, there are a lot of breaking changes here. I'm thinking:
Overall I'm not feeling super comfortable about this. @zebp do you have thoughts? |
|
Amazing work! I would be very happy if this is merged and released. It will be a big breaking change but I think it'll be such a huge improvement to the usability of the With semver, I'm happy to assist with updating the documentation if that helps (UPDATE: I'm working on an example now). |
|
Another reason to go forward with this is that it'll supersede at least 5 open PR's. |
| futures-channel = "0.3.29" | ||
| futures-util = { version = "0.3.29", default-features = false } | ||
| http = "1.0.0" | ||
| http = "0.2.0" |
There was a problem hiding this comment.
I am curious about this change. What's the rationale? The ecosystem has been slowly moving over to http 1.0. Is there a reason to go back in this crate's case?
There was a problem hiding this comment.
@jakubadamw This is work in progress, most likely its just some part of the merge that didn't go well.
And that one is easy to find and fix. Thanks!
The version of the fork was way behind the main, so it was always a likely painful process.
There was a problem hiding this comment.
Yep, there were a number of crates using 0.2 as a dep that would have needed major version bumps to move to 1.0. I can try to do that as part of this PR, but I was mostly just trying to get the merge done.
There was a problem hiding this comment.
Ah, I see, fair enough!
|
@kflansburg Thanks! I feel exactly the same. This was always going to be disruptive, and I do expect a lot regressions, as we have only about 50 tests, so I was counting with their interest to help flush them out and to write some tests if necessary, that's what pushed me in the end. You can always create a stable branch, but we survived many months without a release. The sooner you push it out, the sooner the issues will start to flush in. In the end its what all of us want. So a breaking api and a warning should be enough. I can pick up if you want. |
|
@spigaz were you able to get the D1 |
efe9fa7 to
d47e476
Compare
|
@kflansburg Yesterday it was running fine, now I'm having the same issue. The test case is executed by miniflare so it might be more permissive. Unfortunately I deleted the previous branch, but I'm going to try to sort this out. |
d47e476 to
2b2e155
Compare
Yep, it works from before I merged main. So far I've tried downgrading miniflare and removing the fetch mock. Not sure what else changed :/ |
You may still find it in your |
|
I'm creating an example to demonstrate how to use this with the axum (0.6) router but I'm running into the issue that there's no convenient way to convert a use axum::{http::StatusCode, routing::get, Router};
use tower_service::Service;
use worker::{event, Body, Context, Env, Request, Response};
fn router() -> Router {
Router::new().route("/", get(root))
}
#[event(fetch)]
async fn fetch(req: Request, env: Env, _ctx: Context) -> worker::Result<Response> {
console_error_panic_hook::set_once();
let response = router().route("/", get(root)).call(req).await.unwrap();
Ok(response.map(Body::new))
}
pub async fn root() -> StatusCode {
StatusCode::OK
}I'm not entirely sure why this is a problem though because Here's the full example if anyone is interested: https://github.com/avsaase/workers-rs/tree/axum-router-example/examples/axum |
|
Ok, so the main error message is being generated here: https://github.com/cloudflare/workerd/blob/b53050ed2117ae10d2b673cb36d7b137905a1549/src/cloudflare/internal/d1-api.ts#L81 Which happens when This version of |
|
@jakubadamw Unfortunately I removed the directory, but github saved the PR, dahh... Once I had the two versions, running side by side... Only a couple of minutes... @kflansburg It was a miniflare dependency issue, it seems that an older version works differently. I already asked on discord to see what is the proper behavior, but if it was dropped, then we should remove not only the test case, but also the method. I created a #476 with it running just in case its helpful. |
The function has the comment: As you mention the documentation says: Even without @mrbbot confirmation I'm guessing he dropped support for dump on purpose, that explains why the more recent versions cause the error. I'm guessing it makes sense to drop it also, I just wonder if they have some alternative planned. |
|
@spigaz thanks for finding that. What threw me off is that the file was moved when the route was removed, so I didn't see it when scanning the history for the file. cloudflare/workers-sdk@88d4e45 Ok, I'm inclined to remove this. I think |
|
@kflansburg I just got a confirmation from @geelen: "dump only applied to alpha DBs, it's being replaced with export for beta ones but that's not available yet" And from @mrbbot: I'm not sure how the d1 tests were executed, they weren't running locally, but now using miniflare they should be all just fine, as long as we drop dump. |
|
@kflansburg It seems the http or http-body update will require a reimplementation of some parts. How do you want to proceed? I already discussed with @mrbbot about adding support for workerd to wasm-bindgen-test and miniflare-rs, it seems I can start working on that. |
Is this referring to the update to |
|
@kflansburg I understand. To be honest given the implications of that update, plus a merge with a branch that forked about a year ago... I'm not sure the wisest option isn't to start with main, updating to the latest http and http-body and then back-porting only the required changes. I say this also because I noticed API changes, for instance on fetch and I wasn't sure what was the "newer" version the one on main or the one on the "http-types branch". Once I read somewhere about they having an internal document about this, an internal discussion, but that's as far as I know about that, so they should know when reviewing. |
I'm not aware of any internal docs / discussion. But I agree, it is tempting to try to implement this off of main in a much more surgical way. As it stands this PR has had 3 or 4 distinct owners and so a lot of context has been lost. I will probably try to give this a brief shot today to see how it could be done. |
Would be more than happy to write tests for this if you can specify what needs coverage. |
@SebastiaanYN or @zebp Can you share if that has any relevance on @kflansburg work? @kflansburg I used that strategy to get the tests running and ported what was implied. I normally have have multiple folders, multiple vscodes and a visual diff comparing the folders. |
|
@spigaz what do you think of something like this (only a skeleton, lots of https://github.com/cloudflare/workers-rs/pull/477/files The idea here is to introduce For now, the flag would change the arguments / return type of the We would also provide |
@kflansburg I agree, I think its a brilliant idea. That will allow us to move forward with small PRs without causing instability, while at the same time you can accept PRs for other stuff. And to be honest, I definitely agree on the part of changing the least possible, specially while we have few tests. As a rule we should only change when we have enough tests. The approach regarding testing is also awesome, because it will allow us to focus on API compatibility. In the long run it might seem more work, but I believe it will be worth it. Let me know if you want me to start filling the blanks. |
Ok, cool. I've also added the changes I mentioned to |
|
Closed in favor of #477 |
No description provided.