3 ms·
https://github.com/mickael-kerjean/filestash/blob/master/public/assets/pages/ctrl_connectpage.js https://github.com/mickael-kerjean/filestash/blob/master/pub...
by throwaway-0001 1y ago
https://github.com/mickael-kerjean/filestash/blob/master/public/assets/pages/ctrl_connectpage.js https://github.com/mickael-kerjean/filestash/blob/master/pub...
All using plain strings, what happens when you do a typo? Will your app will silently break or you’ll have a compile time error? that’s a huge draw back - in react I can get a compile time error for a typo most of the time
- mickael-kerjean 1y ago> using plain strings, what happens when you do a typo? The tests fails > Will your app will silently break or you’ll have a compile time error? There is no silent error. In practice, there are a couple fail safes: - using both eslint and tsc: https://github.com/mickael-kerjean/filestash/blob/master/public/package.json#L8-L9 https://github.com/mickael-kerjean/filestash/blob/master/pub... - the code is full of runtime assertions: https://github.com/mickael-kerjean/filestash/blob/1d1bad001b5e34f9712ee86412cf2c149a291efb/public/assets/lib/assert.js#L4 https://github.com/mickael-kerjean/filestash/blob/1d1bad001b... - unhandled error (like most assertion) will interrupt everything to show a scary looking screen: https://github.com/mickael-kerjean/filestash/blob/1d1bad001b5e34f9712ee86412cf2c149a291efb/public/assets/boot/ctrl_boot_frontoffice.js#L53-L54 https://github.com/mickael-kerjean/filestash/blob/1d1bad001b... - controlled error which are part of the regular error handling will stop the flow showing a screen like this: https://demo.filestash.app/?error=test https://demo.filestash.app/?error=test