Skip to content

Commit

Permalink
perf: use transpile_owned (#171)
Browse files Browse the repository at this point in the history
* perf: use transpile_owned

* format
  • Loading branch information
dsherret authored Apr 15, 2024
1 parent 1acce7e commit 2f1bc3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
[workspace.dependencies]
anyhow = "1.0.44"
base64 = "0.21.5"
deno_graph = { version = "0.71.0", default-features = false }
deno_graph = { version = "0.71.5", default-features = false }
url = { version = "2.3.1" }

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion rs-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT"
[dependencies]
anyhow = { workspace = true }
base64 = { workspace = true }
deno_ast = { version = "0.36.0", features = ["bundler", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "visit", "transpiling"] }
deno_ast = { version = "0.36.2", features = ["bundler", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "visit", "transpiling"] }
deno_graph = { workspace = true }
escape8259 = "0.5.2"
futures = "0.3.17"
Expand Down
8 changes: 5 additions & 3 deletions rs-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ pub async fn transpile(
let mut map = HashMap::new();

for module in graph.modules().filter_map(|m| m.js()) {
if let Some(parsed_source) = analyzer.get_parsed_source(&module.specifier) {
let transpiled_source =
parsed_source.transpile(transpile_options, emit_options)?;
if let Some(parsed_source) =
analyzer.remove_parsed_source(&module.specifier)
{
let transpiled_source = parsed_source
.transpile_owned_with_fallback(transpile_options, emit_options)?;

map.insert(module.specifier.to_string(), transpiled_source.text);

Expand Down

0 comments on commit 2f1bc3a

Please sign in to comment.