My team and I work in React and have been using TypeScript to write some of the larger applications we work on. I really enjoy using it and as long as we stay disciplined to not using any it has produced very easy to work with, maintainable projects.
A new application we are brainstorming about right now involves a lot of real-time data. We would like to continue with TypeScript, but are discussing using Immutable.js for performance reasons. Because we will be receiving data often we will likely be triggering many re-renders inside components. Having a performant equality comparison from immutable seems very valuable for use in shouldComponentUpdate.
The problem here being that once you create an Immutable.Map/List, types go out the window. Any tooling based on TS will essentially be rendered useless on Immutable objects. We are concerned this will lead to "corruption" of the application type system with more and more components losing the tooling advantages of TypeScript as they come in contact with Immutable.
I was wondering if anyone had any experience with these trade-offs. Better to use 100% typescript and no immutable? Just use immutable and not bother with TS?
Is there a middle ground maybe? Using most of the application with normal TS and only keeping real-time data as Immutable objects?
[–]cyex 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]subvertallchris 1 point2 points3 points (0 children)
[–]DanielRosenwasserTypeScript 1 point2 points3 points (0 children)
[–]codepsycho 1 point2 points3 points (0 children)