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

deno_fetch attempt 2 #7524

Merged
merged 23 commits into from
Sep 18, 2020
Merged

deno_fetch attempt 2 #7524

merged 23 commits into from
Sep 18, 2020

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Sep 16, 2020

Depends on #7521

ry
ry previously approved these changes Sep 17, 2020
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ry ry changed the title refactor: Merge fetch related runtime files op_fetch attempt 2 Sep 17, 2020
@ry ry changed the title op_fetch attempt 2 deno_fetch attempt 2 Sep 17, 2020
@ry ry mentioned this pull request Sep 17, 2020
op_crates/fetch/lib.rs Show resolved Hide resolved
op_crates/fetch/lib.rs Show resolved Hide resolved
cli/build.rs Show resolved Hide resolved
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We've been working on untangling fetch for many weeks - ultimately it required a bit of a sledge hammering to get it out. This patch is not the most elegant, but it does the job.

struct CreateHttpClientOptions {
ca_file: Option<String>,
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a --unstable check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no unstable check currently

deno/cli/ops/fetch.rs

Lines 174 to 191 in cead79f

fn op_create_http_client(
state: &mut OpState,
args: Value,
_zero_copy: &mut [ZeroCopyBuf],
) -> Result<Value, AnyError> {
let args: CreateHttpClientOptions = serde_json::from_value(args)?;
if let Some(ca_file) = args.ca_file.clone() {
super::cli_state(state).check_read(&PathBuf::from(ca_file))?;
}
let client = create_http_client(args.ca_file.as_deref()).unwrap();
let rid = state
.resource_table
.add("httpClient", Box::new(HttpClientResource::new(client)));
Ok(json!(rid))
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that is bad - there is meant to be one. Deno.createHttpClient() is unstable.

@ry ry merged commit 7845740 into denoland:master Sep 18, 2020
@bartlomieju bartlomieju deleted the merge_some_rt_files branch September 18, 2020 13:22
vitormmatos pushed a commit to vitormmatos/deno that referenced this pull request Sep 21, 2020
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants