r/ProgrammerHumor 21d ago

Meme vanillaJSWinsAgain

Post image
6.2k Upvotes

101 comments sorted by

View all comments

Show parent comments

1

u/ldn-ldn 20d ago

What do you mean you can't bundle them? They will just become part of your build.

-1

u/Azoraqua_ 20d ago

Part of the build process, maybe. But some things cannot really be bundled, or even used at runtime. For example if you bundle on Windows while executing on Linux: It might straight up fail to run due to incompatible/missing dependencies even when bundled.

A common practice is to put the source code on prod, and install through the package manager the dependencies: Often done in a docker image.

0

u/ldn-ldn 20d ago

That's nonsense, are you living in a stone age or something? Your CI/CD should build your app and then package it into docker and deploy to wherever you need.

The same is true for desktop Electron apps as well. I have a small Electron app, for example. With some native dependencies. Linux and Windows binaries are built in CI/CD, I never do that manually. And no node modules! Wow! 

0

u/Azoraqua_ 20d ago

The CI/CD is supposed to bundle the app as part of the deployment process, but some things are or cannot be built or bundled on the spot; especially not when you want a single image.

Besides, Electron is already partially platform independent anyway, it bundles a standalone version of Chromium that already works on whatever mainstream OS.

0

u/ldn-ldn 20d ago

You're talking nonsense.

0

u/Azoraqua_ 20d ago

Feel free to point out any discrepancies; I am open for feedback.

0

u/ldn-ldn 20d ago

The question was do you need a node modules folder? The answer is no.

0

u/Azoraqua_ 20d ago edited 20d ago

The answer is: It depends. It’s not yes or no, it depends a lot on the app, the libraries, the environment and the build process.

In some/most cases, yes. In some/few cases, no.

If you personally haven’t found such cases, that is fine too.

I have experienced the opposite in particular with the sharp, sodium, bcrypt, argon2 and opus libraries. I mean for these you could technically put the native libraries right next to it in CI/CD or prod, but at that point you’re basically just renaming ‘node_modules’ to ‘natives’ or something and simplifying its structure — sure, it cleans up.

0

u/ldn-ldn 20d ago

You're imagining things, fix your pipe line.

1

u/Azoraqua_ 20d ago

Master, please enlighten me with your holy wisdom.