Skip to content

refactor: move denort to separate crate #27688

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

Merged
merged 27 commits into from
Jan 17, 2025

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jan 15, 2025

This slightly degrades the performance of CJS export analysis on subsequent runs because I changed it to no longer cache in the DENO_DIR with this PR (denort now properly has no idea about the DENO_DIR). We'll have to change it to embed this data in the binary and that will also allow us to get rid of swc in denort (will do that in a follow-up PR).

Closes #27326
Closes #26982

@dsherret dsherret marked this pull request as ready for review January 16, 2025 00:37
Comment on lines -392 to -402
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash());
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
println!(
"cargo:rustc-env=GIT_COMMIT_HASH_SHORT={}",
&git_commit_hash()[..7]
);

let ts_version = ts::version();
debug_assert_eq!(ts_version, "5.6.2"); // bump this assertion when it changes
println!("cargo:rustc-env=TS_VERSION={}", ts_version);
println!("cargo:rerun-if-env-changed=TS_VERSION");
Copy link
Member

Choose a reason for hiding this comment

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

Where did these go?

cli/lib/build.rs Outdated
Comment on lines 5 to 12
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", commit_hash);
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
println!(
"cargo:rustc-env=GIT_COMMIT_HASH_SHORT={}",
&commit_hash[..7]
);
let ts_version = "5.6.2";
println!("cargo:rustc-env=TS_VERSION={}", ts_version);
Copy link
Member

Choose a reason for hiding this comment

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

Nvm, it's here. It's strange that TS_VERSION is emitted by cli/lib/ - I thought the idea was that TS shouldn't be available for denort

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to inline this and fix it

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, yeah it's unfortunate, but we need the typescript version in denort still for the Deno.versions.typescript property. That property should have ideally never been exposed, but not a big deal.

Comment on lines 19 to 21
// todo(THIS PR): include the typescript version in this crate
// so that it can be asserted when building the CLI
let snapshot_options = SnapshotOptions {
Copy link
Member

Choose a reason for hiding this comment

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

Flagging that this should be addressed

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I just forgot to remove this. It's already asserted in the CLI crate.

@dsherret dsherret enabled auto-merge (squash) January 17, 2025 20:06
@dsherret dsherret merged commit 57dd66e into denoland:main Jan 17, 2025
17 checks passed
@dsherret dsherret deleted the refactor_deno_rt_crate branch January 17, 2025 21:50
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Jan 17, 2025
This slightly degrades the performance of CJS export analysis on
subsequent runs because I changed it to no longer cache in the DENO_DIR
with this PR (denort now properly has no idea about the DENO_DIR). We'll
have to change it to embed this data in the binary and that will also
allow us to get rid of swc in denort (will do that in a follow-up PR).
crowlKats pushed a commit that referenced this pull request Jan 21, 2025
This slightly degrades the performance of CJS export analysis on
subsequent runs because I changed it to no longer cache in the DENO_DIR
with this PR (denort now properly has no idea about the DENO_DIR). We'll
have to change it to embed this data in the binary and that will also
allow us to get rid of swc in denort (will do that in a follow-up PR).

(cherry picked from commit 57dd66e)
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.

deno compiled binaries programs generate stuff at ~/.cache/deno
2 participants