Skip to content

fix: reexport Source, Range and DiagnosticMessage from compiler's index.d.ts #1688

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

Closed
wants to merge 2 commits into from

Conversation

willemneal
Copy link
Contributor

This means any tool which imports the types from both, e.g. vistor-as there will be one source of truth.

Willem Wyndham added 2 commits February 16, 2021 15:39
This means any tool which imports the types from both, e.g. vistor-as there will be one source of truth
@dcodeIO
Copy link
Member

dcodeIO commented Feb 17, 2021

If I understood correctly, asc does indeed not expose all members of the internal classes in question, and I think that made it necessary to define a subset of only those properties actually present. Not sure if that applies to all of them, though.

Relevant PR: #1625
cc @piotr-oles

@piotr-oles
Copy link

Yes, these typings are a subset on purpose - we are exposing only a few fields. It's because the compiler can be compiled to WASM and if it runs in a WASM environment, then we have to copy these diagnostics. We could use the Pick<> type instead of duplicating them - but re-exporting them would create invalid expectations in some cases :)

@willemneal willemneal closed this Oct 29, 2021
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.

3 participants