Re:Show HN: I created a URL shortener that can be entirely h...
by darkwater on Monday November 16, 2020 @08:16AM
(#25111236)
I always wondered if relying so much on external libraries in the long run is more hassle to maintain than doing it by yourself. Security updates will be provided for X major version for a reasonable amount of time, but afterwards you will have to update, check that nothing breaks and update your code as well. Also some of the deps will break regardless of SemVer and you will need to update.
Re:Show HN: I created a URL shortener that can be entirely h...
by wwwwwwwww on Monday November 16, 2020 @08:31AM
(#25111379)
Sadly, its a lost cause. The result is [left-pad](https://www.theregister.com/2016/03/23/npm_left_pad_chaos/).
Re:Show HN: I created a URL shortener that can be entirely h...
by nelsontky on Monday November 16, 2020 @09:44AM
(#25112219)
I figured that since the dependencies were only used in the build step it's not really considered. That being said, I didn't know ES2015 had `.then()` and was kinda trying out babel since I always used CRA and never knew what was going on behind the scenes. The dependencies were definitely not needed but in the production build, they aren't really "unminimal"
Re:Show HN: I created a URL shortener that can be entirely h...
by interactivecode on Monday November 16, 2020 @08:22AM
(#25111302)
even though this isn't really a constructive comment, most of that package-lock.json is build tools. If you remove those and only install production packages it's 27 lines: https://gist.github.com/StefKors/3b43896467d05cb1fb693ed0da9...
Re:Show HN: I created a URL shortener that can be entirely h...
by tjelen on Monday November 16, 2020 @08:47AM
(#25111531)
And all that is just for being able to write `response = await fetch(...)` instead of `fetch(...).then(...)`.
Re:Show HN: I created a URL shortener that can be entirely h...
by nelsontky on Monday November 16, 2020 @09:41AM
(#25112183)
My fault. Didn't know that ES2015 actually supported `.then()`. Anyway, this was also an exercise for me to learn about babel (I use CRA all the time so have no idea what is going on behind the scenes) and this was a nice intro!
https://github.com/nelsontky/gh-pages-url-shortener/blob/mai...