On the 24th of September I attended the SAP Inside Track 2022 event to join the big re-connect! It was a pleasure to see so many SAP Community members in one place, after 2 postponed years of SITbe! All these people, a great location and amazing sessions were key to another fantastic and fun SITbe edition. Together with my good friend Wouter Lemaire I presented “A Type Trip” session, later known as “The Great Type Trip”, to a lot of CAP & UI5 enthusiasts. All together we went on a TypeScript adventure, one not to forget!
We wanted to spread the TypeScript word and to get you started with TypeScript yourself. That is why we summarized our session in this blogpost, to get you started or continue your Type Trip journey.
But before we do so, we think it is more than fair to share some cool tips & tricks that we’ve learned during some other sessions we attended at SITbe. Thank you to all speakers for the great sessions!
A Type Trip was born
This trip was born due to two TypeScript fans sharing their experiences and ideas during a real-life development project. We were inspired by some amazing and helpful community repositories and tools as well, which we definitely wanted to highlight below.
Typed CAP’s to wear
When using TypeScript, coding get’s lot easier and makes more sense while reading or being at it. Not only the benefits mentioned above will be experienced, but fun is guaranteed as well. To get started with TypeScript in CAP we would like to refer to the SAP CAP documentation containing some great examples (repositories): Enable TypeScript Support, Developing with cds-ts, Full Stack TypeScript App.
Quick & typed tests
We hope that we do not have to convince you any longer that testing is actually time saving and not a waste of time at all. Did some new developments? Run some tests to see if you broke the initial code, before passing your new developments to the testing team. Tough TypeScript will “help” you to make less mistakes along the way, a good test at the end of the day keeps the stress away. 😉 That’s why we would like to refer to the SAP CAP documentation once more, to highlight the Testing with ts-jest section. Here the documentation describes on how to use typescript with the JEST testing framework.
Beautiful & typed views
As stated during the presentation we wanted to add a cherry on top, by adding a UI5 TypeScript application to the demo. Like mentioned earlier the best repository in our opinion is the hacking-away-sampleapp repository on the GitHub page of the UI5-Community.
If you would have more questions still, you can find all your answers right here UI5-TypeScript | UI5 & TypeScript.
As mentioned during the session, you were not leaving empty handed. Your travel backpack was stuffed with the following awesome supplies:
- TypeScript rocks!
- So does SITbe!
- CAP has good documentation!
- Just like UI5!
- JEST is super handy!
- PNPM even handier!
- GIT repositories are the best!
- An ENT ≠ END
Good to know & troubleshoot
This presentation and demo were not setup without any struggle. But we were lucky to have our fellow community members sharing their knowledge along the way.
See you next year!
We believe it is more than obvious we had a great time and learned a lot along the way. With this we would like to wrap up an amazing event with amazing people and lots of awesome content. We are already looking forward to the next edition and hope to see you there as an attendee or speaker!
See you then!
Wouter & Dries