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

TypeScript 3.1 improved error UX meta-issue #26077

Closed
8 of 11 tasks
DanielRosenwasser opened this issue Jul 31, 2018 · 6 comments
Closed
8 of 11 tasks

TypeScript 3.1 improved error UX meta-issue #26077

DanielRosenwasser opened this issue Jul 31, 2018 · 6 comments
Labels
Domain: Error Messages The issue relates to error messaging Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Meta-Issue An issue about the team, or the direction of TypeScript

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jul 31, 2018

Continuing on from the release of TypeScript 3.0, we're committed to improving the user experience all around, and following up on both #25310 and #25257.

Error improvements

(:running_man: implies we have an existing PR)

Related error spans

(:running_man: implies we have an existing PR)

Psst, even though the issues are assigned, we'd welcome any help on them!


The following didn't make the cut, or are in 3.2:

@mhegazy mhegazy added Domain: Error Messages The issue relates to error messaging Meta-Issue An issue about the team, or the direction of TypeScript Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. labels Jul 31, 2018
@emattias
Copy link

emattias commented Oct 5, 2018

Comparing my DX/UX experience from working with flow versus TypeScript, the error messages is one of the few things that I preferred how flow does it. Especially after flow v0.66 release. I would love it if typescript would adopt some for the formatting and helpful information that flow has in their error messages.

This blog post explains more about the flow 0.66 error message changes: https://medium.com/flow-type/better-flow-error-messages-for-the-javascript-ecosystem-73b6da948ae2

@emattias
Copy link

emattias commented Dec 14, 2018

There is so much room for improvement here. For example:

  • prettifying/formatting the outputted types
  • syntax highlighting
  • bold/highlight the conflicting parts

Heres and example of the ginormous unstructured blob of text that is a ts error with big types involved:

Type '({ expandedRowIds, orderBy, currentPage, filters: { columns: columnFilters, period, categoryIds }, ...restUrlQueryState }: Pick<Overwrite<DataGridUrlQueryStateUrlSerialized, { filters: { columns: { promotionName?: string | undefined; startDate?: string | undefined; endDate?: string | undefined; "sumFacts.switching.amount"?: string | undefined; "sumFacts.netLift.profit"?: string | undefined; "sumFacts.netLift.amount"?: string | undefined; }; period: Date[]; categoryIds: string[]; }; }>, "hiddenColumnNames" | "filters" | "orderBy" | "expandedRowIds" | "currentPage">, pageSize: any) => Dictionary<any>' is not assignable to type '(a: Overwrite<DataGridUrlQueryStateUrlSerialized, { filters: { columns: { promotionName?: string | undefined; startDate?: string | undefined; endDate?: string | undefined; "sumFacts.switching.amount"?: string | undefined; "sumFacts.netLift.profit"?: string | undefined; "sumFacts.netLift.amount"?: string | undefined; }; period: Date[]; categoryIds: string[]; }; }>) => DataGridQueryVariables'.

Another interesting thing that happened with flow is the glow project that formatted errors and made them way more readable (I believe all or some of glows functionality got integrated into flow itsself.).

@DanielRosenwasser
Copy link
Member Author

Yup, agreed. We have some work that will enable that, but this is a pretty old issue at this point. Opening a specific issue to track that would be super helpful.

@emattias
Copy link

Tracking exactly what? Should I just create an issue of my last comment or should I break it down in some way?

@DanielRosenwasser
Copy link
Member Author

Yup, something like that but with context that you're talking about the command line

@emattias
Copy link

Done: #29059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Error Messages The issue relates to error messaging Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Meta-Issue An issue about the team, or the direction of TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants