{"id":61,"date":"2018-07-07T05:13:03","date_gmt":"2018-07-07T05:13:03","guid":{"rendered":"http:\/\/bruceng.com\/?p=61"},"modified":"2018-07-07T05:13:03","modified_gmt":"2018-07-07T05:13:03","slug":"migrating-btd-to-typescript-and-possibly-antd-mobile","status":"publish","type":"post","link":"https:\/\/bruceng.com\/?p=61","title":{"rendered":"Migrating BTD To TypeScript, and possibly Antd Mobile"},"content":{"rendered":"<p>BTD has quite a few bugs that was due to type mismatch. After a while I decided to migrate the application from ES6 to TypeScript. I believe it will provide me with some benefits in refactoring, type checking, type safety, and possibly making the code more well organized by having to define types more clearly.<\/p>\n<p>After spending a few hours copying the code over, rename all the files from .js to .tsx and modifying the files to run in TypeScripts, I managed to make it compile and run. Though I had to disable TSLint completely as it throws lots and lots of errors.<\/p>\n<p>To finish this migration, I will just work on it bit by bit until it becomes stable again.<\/p>\n<p>I&#8217;m also considering switching the UI framework from Antd to Andtd mobile as it supports building using react-native, which might make it possible to build an Android version of the app together with the web version for desktop.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BTD has quite a few bugs that was due to type mismatch. After a while I decided to migrate the application from ES6 to TypeScript. I believe it will provide me with some benefits in refactoring, type checking, type safety, and possibly making the code more well organized by having to define types more clearly. &hellip; <a href=\"https:\/\/bruceng.com\/?p=61\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Migrating BTD To TypeScript, and possibly Antd Mobile<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bruceng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":1,"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/bruceng.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/bruceng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bruceng.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bruceng.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}