-
Notifications
You must be signed in to change notification settings - Fork 505
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
feat: prepare supporting runtime #37
Conversation
@@ -13,6 +13,7 @@ pub struct Graph { | |||
pub entries: Vec<(Option<String>, ModuleId)>, | |||
pub sorted_modules: Vec<ModuleId>, | |||
pub symbols: Symbols, | |||
pub runtime: ModuleId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime module put into modules
of graph and use runtime
to refrence it, but maybe is good to put it to runtime
.
!bench |
Benchmark Results
|
ok |
@@ -50,7 +51,11 @@ impl ModuleTask { | |||
let mut builder = ModuleBuilder::default(); | |||
tracing::trace!("process {:?}", self.path); | |||
// load | |||
let source = tokio::fs::read_to_string(self.path.as_ref()).await?; | |||
let source = if RUNTIME_PATH == self.path.as_ref() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm intending to not include runtime
module as the part of making module graph. In this way, we don't need to write such code.
Another way is to have a special ModuleTaskForRuntime
to deal with the special logic of runtime module.
I haven't think through which way is better. Let's change it later.
Description
related #35
Test Plan
no need.