This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure a little bit and mess things up with async
I think it makes sense to actually create a `Bundler` struct because like...eventually in my head it makes sense to have one `Bundler` instance that you could like pass around in `wrangler dev` or whatever. I think most of the codebase is more functional-y but i'm sure someone will tell me if this is not the preferred style to do this in. How many more commits can I make before I have to actually parse any javascript? Let's find out, shall we?
- Loading branch information
Showing
4 changed files
with
146 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
use std::{fmt::Debug, path::Path}; | ||
use super::check_file_size; | ||
use std::path::PathBuf; | ||
|
||
pub fn check_wasm<P: AsRef<Path> + Debug>(_path: P) -> Result<String, failure::Error> { | ||
todo!() | ||
pub async fn check_wasm(wasm_file: Option<&PathBuf>) -> Result<String, failure::Error> { | ||
Ok(match wasm_file { | ||
None => "No WebAssembly detected, skipping check!".to_string(), | ||
|
||
Some(file) => { | ||
let file_size = check_file_size(file)?; | ||
format!("WASM size: {}", file_size) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters