5 ms·
They don't even need to be big. They just need to cover a subject, but most of it needs to be the library code instead of a thin wrapper around multiple librari
by skydhash 3y ago
They don't even need to be big. They just need to cover a subject, but most of it needs to be the library code instead of a thin wrapper around multiple libraries. Take Carbon, the PHP library. It is centered around date time manipulation and provides a cleaner alternative to the standard library. It only has 6 dependencies, and I figure it wouldn't take long to vet it. The Laravel Framework also has few dependencies, and it was a delight to browse.
I created a small Node+Express project, added a few dependencies to handle things like CORS, API Authentication, ORM, and data validation, and my node_modules folder has 300 packages already. Frontend wise, it's worse.
I only used a few libraries when I was doing Android, most of them utilities and vendor SDKs. And the contrast is even higher in another project I'm working on. The Java Code takes less than 10 minutes to build, while the frontend code turns the laptop into a jet.
- com2kid 3y ago> I created a small Node+Express project, added a few dependencies to handle things like CORS, API Authentication, ORM, and data validation, and my node_modules folder has 300 packages already. Frontend wise, it's worse. The vast majority of node dependencies are for testing frameworks and other tools that are never shipped to the customer. For example, if you install any tool that does pretty command line output, odds are it installs some console UI libraries as a dependency, and odds are they also install a lower level curses like library as a dependency. (Also I've yet to meet a simple ORM system!) Jest is another common offender, much like every other popular testing framework, it is large and complex, and due to the nature of Javascript, it is also more powerful than a lot of the other testing frameworks I have seen (e.g. Jest can do stuff at runtime that Java frameworks need to do at compile time). Those Java frameworks that go in and mock classes are complicated, but they are all hidden behind a "single" dependency. Regarding front end build times, if a frontend website is taking any amount of time to build, something else is wrong (e.g. TypeScript is rebuilding everything one very build). Typical frontend website dev stacks have hot reloading enabled that allows for the site to be refreshed and updated the instant a file is saved. Nicer setups live change the DOM and try to avoid reloading the page unless something touching state management has been altered. (My experience is with React and Svelte alongside TS, Angular may be a different story, not sure!)
- skydhash 3y ago> Those Java frameworks that go in and mock classes are complicated, but they are all hidden behind a "single" dependency. I'd take complicated and sane over the literal software illusions that many npm packages are. > Regarding front end build times, if a frontend website is taking any amount of time to build, something else is wrong; Not necessarily. Any production build should start from scratch (the dependencies may be cached).
- saurik 3y ago> due to the nature of Javascript, it is also more powerful than a lot of the other testing frameworks I have seen (e.g. Jest can do stuff at runtime that Java frameworks need to do at compile time) oof... way to snatch defeat from the jaws of victory :(.
- com2kid 3y agoJest is magic, but far less magic than rewriting JVM bytecode. I generally prefer less magic over more magic.
- mrweasel 3y ago> The vast majority of node dependencies are for testing frameworks and other tools that are never shipped to the customer. So just to test I installed Django in a new virtualenv. I get a testing framework, and ORM, CORS, authentication, data validation, hot reloading and much more. It's three dependencies: django, asgiref and sqlparse. Part of it is that Django just builds a ton of stuff on their own, but they also have the Python stdlib to build on. As others mentioned you have things like Boost, the Go standard library, or even libc (of which there are multiple implementations). There's no reason why you couldn't have a JavaScript standard library, or multiple. They don't have to be shipped with the browsers, in fact I think that would be a bad idea. So when you start a new JavaScript project, you pull in your favorite standard library and when you ship your code, the bundler or whatever it's called could analyze your code pull out the relevant bits of the standard library and only include the bits you need.
- 3y ago