TypeScript - Mobx - React
You probably asking why we use different approach to build a webapp again.
Last time we talk about babel, however it is not something I like to stick with.
Why TypeScript?
I need to solve 2 major problems:
- Highly maintainable code
- Good IDE support
I find using Typescript could solve both at the same time while making another prototype,
showroom repo : https://github.com/zeptoTon/showroom
It does help on navigating around using VSC when typescript is there.
Could there be any alternative solution?
Why Mobx?
I feel Mobx did a great job comparing with Redux. Why?
Redux has too much concept with it. One thing I do not agree is mixing Immutable concept into a framework. It is better to do single step at a time. We shall talk about ImmutableJS in later post.
Again you should not think Mobx is great because it mix with React!!!!! React is not needed!
Why React (again)?
I need to practice a bit of react life cycle, I should try something different next time.
Conclusion
TypeScript actually let me feel coding something solid all the time, it helps me focus on details, such as what should be optional attributes, what is the 3rd-party provided function overriding.
However, it is a pain to make it work well with my Jest test suite and Webpack... I have to build the test code in tsc rather than webpack loader. It is because Webpack should do one single thing - pack my dependancy tree. I don't feel right to use Webpack for Jest.
Could .ts work well with Jest test runner in future? I hope so, without losing source map and breakpoint in VSC.
Comments
Post a Comment