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

chore: update deno_graph and deno_doc #13173

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Dec 22, 2021

@bartlomieju two test cases are failing, related to compat support and have no idea how the updates broke them:

  • integration::compat::import_esm_from_cjs
  • integration::compat::require_in_repl

@kitsonk kitsonk requested a review from bartlomieju December 22, 2021 00:55
@kitsonk kitsonk requested a review from bnoordhuis as a code owner December 22, 2021 00:55
@bartlomieju
Copy link
Member

Running these test locally...

@bartlomieju
Copy link
Member

bartlomieju commented Dec 22, 2021

@kitsonk this is caused by https://github.com/denoland/deno_std/blob/4e01d764eb86caef2e15c42585f323610903802c/node/stream/consumers.js#L5-L9

deno_graph started understanding these comments and it seems they are broken links. I will fix it in deno_std.

I suggest disabling the tests temporarily before we fix and release new version.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

Oh yeah, they were just always "broken" in the sense it would just be an any type. Now they actually work and follow standard Deno resolution (unless there is a resolver).

@bartlomieju
Copy link
Member

That's good, another small bug caught :) opened denoland/std#1740 to fix it

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

Thinking about this though, I think I need to change deno_graph, dependencies like this shouldn't be a hard fail for the graph, our tsc integration handles these missing fine and we should prevent code from running if a type only dependency is missing. Doing so would be a big change in behaviour, especially if you tried to use code that has just JSDoc type imports that can't be resolved.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

Hmmm... I have gone back to deno_graph and it is actually behaving like it is expected, in that graph.valid() is "ok" but graph.valid_types_only() errors, as would be expected, which is due to the whole GraphData thing. So I need to ferret out how it is going wrong, and only raises more concerns I have about the whole GraphData abstraction. 😖

@nayeemrmn
Copy link
Collaborator

dependencies like this shouldn't be a hard fail for the graph, our tsc integration handles these missing fine and we should prevent code from running if a type only dependency is missing

We used to call graph.valid() which checks runtime deps only, and additionally call graph.valid_types_only() only if type checking is enabled. With the current graph_data.check(), you can toggle that with follow_type_only. It is similarly set based on --no-check status. The abstraction is better. The same problem would have been hit with the old API, it's just now we have newly acknowledged type only deps from JSDoc, and checking those (since type checking is on) isn't working out with some existing code ¯\_(ツ)_/¯

@nayeemrmn
Copy link
Collaborator

Also based on #11362, it sounds like we only want to visit JSDoc dependencies for a JS module when either --checkJs is enabled or // @ts-check is written at the top? If that's what tsc does we should do the same.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

@nayeemrmn yes, basically I am folding that into the logic, but that ended up not being the root cause... the loader appears to actually not be handling missing modules "properly", which is causing a problem.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

Ok, yeah, it looks like the loader wasn't treating 404's like it was treating files missing locally, causing a difference in behaviour. That is corrected now, and now I am at the point of figuring out the graph valid stuff.

@kitsonk kitsonk requested a review from dsherret as a code owner December 22, 2021 05:33
@kitsonk kitsonk linked an issue Dec 22, 2021 that may be closed by this pull request
@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

I have confirmed this patch fixes #13156.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 22, 2021

M.O.A.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

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.

lsp: JSDoc imports not recognised
3 participants