question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove the As type infer to make intellisense faster

See original GitHub issue

With latest release typescript intellisense is still very slow

I did some investigation and the problem is the ComponentWithAs type, i tried tweaking that types removing the As generic argument and everything becomes super smooth, making intellisense instantaneous

The as generic argument delays intellisense even if you son’t use it, the delay is about 1000ms average for me

I think we should remove the as generic and instead encourage people to use the new chakra.tag approach

The as type infer approach could be added maybe in the future, we shouldn’t add it in the 1.0 release or it will be impossible to remove (because of breaking changes) and it will make everyone experience worse

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
santialbocommented, Aug 10, 2020

As much as I love having the type safety, I wouldn’t mind going back to the chakra v0 way if that meant a more responsive dev experience.

1reaction
segunadebayocommented, Aug 12, 2020

Thanks for reporting this @remorses. I would rather try to improve the IntelliSense a bit more instead of removing as prop support completely.

I also agree with @santialbo, we need to keep the DX very close to v0.8 as much as we can.

As a first attempt, @with-heart and I worked on improvements here #1627. @remorses can you check it out to see if you notice any boost in IntelliSense speed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to infer or provide intellisense for parameter types of ...
I have tried: type BrowserWindowOnEvents = Parameters<InstanceType<typeof Electron.BrowserWindow>['on']>[0];. But that only gives, at least for Intellisense, ...
Read more >
IntelliSense in Visual Studio Code
If you prefer, you can turn off IntelliSense while you type. See Customizing IntelliSense below to learn how to disable or customize VS...
Read more >
Two ways you can take advantage of types in JavaScript ...
This blog post describes how you can enable javascript intellisense and design time error highlighting without TypeScript.
Read more >
Can you disable type inference for variable declarations? : r/rust
The reason is, yes I can see the variable types on the IDE, but git, vim, nano and company do not have a...
Read more >
programming languages - What's the tradeoff for type inference?
Languages with opt-out type inference strike an agreeable balance between the ... you're trying to do, harming autocomplete and similar helpers during the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found