3 ms·
I didn’t touch “web dev” since php/dream-weaver/myspace era. I started working with some web developers for a simple project recently, my mock product was buil
by dijit 6y ago
I didn’t touch “web dev” since php/dream-weaver/myspace era.
I started working with some web developers for a simple project recently, my mock product was built with vue.js using the standard way of “including” it: But what really threw me for a loop was that the web developers told me that that’s wrong, they are now _compiling_ (Or, semantically “packing”) JavaScript blobs to make even very simple websites.
I don’t know why we as a community have started doing that, but it feels like an anti-pattern, it makes adding new dependencies opaque and we can very quickly end up including dozens and dozens of lines of code which must all be rendered by every device that comes into contact with my site.
Often this happens because we want only a small bit of the functionality too.
- RandoHolmes 6y ago100% with you there. I personally think it's a bit insane to add node.js as a dependency to a simple PHP project.
- WrtCdEvrydy 6y agoTo be honest, we've seen this in Rails and PHP in the form of grunt.
- WrtCdEvrydy 6y agoWait till someone wants to add JS polyfills for everything...
- lukeramsden 6y ago> Often this happens because we want only a small bit of the functionality too. To be fair, this 'compiling' also allows for tree shaking, which if you use a well-structured library like lodash/date-fns etc, allows you to get that small bit of functionality without paying for the whole library.
- sanitycheck 6y agoSo.. There are benefits to this for complex apps - but 90% (charitably) of this kind of code is not in a complex app. I think it's for two main reasons: 1. If you don't use complicated new technology you won't get a job doing web dev. 2. Many new JS devs don't understand JS/HTML/CSS well, they only understand a particular framework - and even then not in a sufficiently deep way. When you come across a seemingly normal site that requires JS in order to display anything, it's pretty unlikely that anyone involved ever considered not doing it that way.
- gtr 6y agoOften this is to do with making a site work across browsers. IE11 is the bane of our lives! Plus doing the transpiling allows using things like Typescript which is a godsend on a complex site.