From c3cba7f22c49ca3a3f58df44d8ea4c85d8510bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 9 Mar 2023 08:10:54 -0400 Subject: refactor(core): Extension::builder_with_deps (#18093) Prerequisite for https://github.com/denoland/deno/pull/18080 --- ext/flash/lib.rs | 76 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'ext/flash/lib.rs') diff --git a/ext/flash/lib.rs b/ext/flash/lib.rs index b50b7bb5c..605dc3e43 100644 --- a/ext/flash/lib.rs +++ b/ext/flash/lib.rs @@ -1527,46 +1527,48 @@ pub trait FlashPermissions { } pub fn init(unstable: bool) -> Extension { - Extension::builder(env!("CARGO_PKG_NAME")) - .dependencies(vec![ + Extension::builder_with_deps( + env!("CARGO_PKG_NAME"), + &[ "deno_web", "deno_net", "deno_fetch", "deno_websocket", "deno_http", - ]) - .esm(deno_core::include_js_files!("01_http.js",)) - .ops(vec![ - op_flash_serve::decl::

(), - op_node_unstable_flash_serve::decl::

(), - op_flash_respond::decl(), - op_flash_respond_async::decl(), - op_flash_respond_chunked::decl(), - op_flash_method::decl(), - op_flash_path::decl(), - op_flash_headers::decl(), - op_flash_addr::decl(), - op_flash_next::decl(), - op_flash_next_server::decl(), - op_flash_next_async::decl(), - op_flash_read_body::decl(), - op_flash_upgrade_websocket::decl(), - op_flash_drive_server::decl(), - op_flash_wait_for_listening::decl(), - op_flash_first_packet::decl(), - op_flash_has_body_stream::decl(), - op_flash_close_server::decl(), - op_flash_make_request::decl(), - op_flash_write_resource::decl(), - op_try_flash_respond_chunked::decl(), - ]) - .state(move |op_state| { - op_state.put(Unstable(unstable)); - op_state.put(FlashContext { - next_server_id: 0, - join_handles: HashMap::default(), - servers: HashMap::default(), - }); - }) - .build() + ], + ) + .esm(deno_core::include_js_files!("01_http.js",)) + .ops(vec![ + op_flash_serve::decl::

(), + op_node_unstable_flash_serve::decl::

(), + op_flash_respond::decl(), + op_flash_respond_async::decl(), + op_flash_respond_chunked::decl(), + op_flash_method::decl(), + op_flash_path::decl(), + op_flash_headers::decl(), + op_flash_addr::decl(), + op_flash_next::decl(), + op_flash_next_server::decl(), + op_flash_next_async::decl(), + op_flash_read_body::decl(), + op_flash_upgrade_websocket::decl(), + op_flash_drive_server::decl(), + op_flash_wait_for_listening::decl(), + op_flash_first_packet::decl(), + op_flash_has_body_stream::decl(), + op_flash_close_server::decl(), + op_flash_make_request::decl(), + op_flash_write_resource::decl(), + op_try_flash_respond_chunked::decl(), + ]) + .state(move |op_state| { + op_state.put(Unstable(unstable)); + op_state.put(FlashContext { + next_server_id: 0, + join_handles: HashMap::default(), + servers: HashMap::default(), + }); + }) + .build() } -- cgit v1.2.3