Skip to content
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

Merged
merged 3 commits into from
Oct 10, 2023
Merged

feat: prepare supporting runtime #37

merged 3 commits into from
Oct 10, 2023

Conversation

underfin
Copy link
Contributor

@underfin underfin commented Oct 8, 2023

Description

related #35

Test Plan

no need.


@@ -13,6 +13,7 @@ pub struct Graph {
pub entries: Vec<(Option<String>, ModuleId)>,
pub sorted_modules: Vec<ModuleId>,
pub symbols: Symbols,
pub runtime: ModuleId,
Copy link
Contributor Author

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.

@underfin
Copy link
Contributor Author

underfin commented Oct 8, 2023

!bench

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Benchmark Results

group                            baseline                               pr
-----                            --------                               --
rolldown benchmark/threejs       1.00     65.9±4.87ms        ? ?/sec    1.02     67.0±8.51ms        ? ?/sec
rolldown benchmark/threejs10x    1.01   704.1±36.37ms        ? ?/sec    1.00   695.8±36.31ms        ? ?/sec

@hyf0
Copy link
Member

hyf0 commented Oct 8, 2023

Would you mind holding this PR before #27 being merged? I need to apply some changes to this PR after #27.

@underfin
Copy link
Contributor Author

underfin commented Oct 8, 2023

ok

@hyf0 hyf0 changed the title feat: add runtime file to module graph feat: prepare supporting runtime Oct 10, 2023
@@ -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() {
Copy link
Member

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.

@hyf0 hyf0 merged commit cd4899f into main Oct 10, 2023
3 checks passed
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.

2 participants