-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
refactor: integrate deno_graph 0.20.0 #13495
Conversation
0d36664
to
e35ecd8
Compare
Everything updates and compiles, but there are some regressions in the test cases that I need to dig into. |
I'm getting a lot of:
in tests. These originate in: Line 45 in a2e4fa4
I feel like this should be an error rather than error log. If it happens it most likely means that we screwed up something in Deno internals. This Lines 85 to 86 in a2e4fa4
|
18d42b3
to
6ba6180
Compare
Ok, yeah, I know the problem... Because we got rid of the seperate "Synthetic" modules, CLI is trying to cache all modules in the graph, including the synthetic ones. Need to filter those out. |
@bartlomieju ok, I've got a few more challenges to fix, but there is one that I see what the problem is, but I am not totally sure why it is occurring now and the best way to fix it. If you run test |
@bartlomieju it does look just like the compat failures with trying to find the package.json for the shim is the only outstanding issue. |
@kitsonk there is a single path that injects resolved specifier for built-in Node modules (pointing to |
@bartlomieju obviously a topic for another day, but it would be really sad if we can't integrate Deno code and Node.js code in the same workload. I fixed what I hope are the last fixture issues so the CI can go green. |
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.
LGTM! Just one small fix needed though.
@@ -121,9 +129,23 @@ fn node_resolve( | |||
let conditions = DEFAULT_CONDITIONS; | |||
let url = module_resolve(specifier, &parent_url, conditions)?; | |||
|
|||
let resolve_response = if url.as_str().starts_with("http") { |
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.
Nit: check url.scheme()
instead?
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.
@bartlomieju do you want to address or should I?
@@ -121,9 +129,23 @@ fn node_resolve( | |||
let conditions = DEFAULT_CONDITIONS; | |||
let url = module_resolve(specifier, &parent_url, conditions)?; | |||
|
|||
let resolve_response = if url.as_str().starts_with("http") { | |||
ResolveResponse::Esm(url) | |||
} else if url.as_str().ends_with(".js") { |
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.
We should be doing case insensitive comparisons. It seems like we often forget about this so maybe we should create a helper function somewhere that does it efficiently and just in case, also checks url.path()
instead of the full url?
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.
@bartlomieju same again
} else { | ||
ResolveResponse::CommonJs(url) | ||
} | ||
} else if url.as_str().ends_with(".cjs") { |
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.
Here too (case insensitive, path comparison)
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.
@bartlomieju same again
I don't think there's any problem with that - you can mix and match http/https imports with bare specifiers. I was mentioning situation with remapping of Node.js built in modules to std URLs. |
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.
LGTM too. I'll apply David's suggestions in a follow up PR tomorrow morning. Let's land this!
Down to 53 errors... just a chore to get the rest of them...