I
I
Intelligent20142016-06-24 14:46:08
Node.js
Intelligent2014, 2016-06-24 14:46:08

How to properly update dependencies in a MEAN stack application?

If NodeJS+AngularJS application with 30 dependencies (+40 devDependencies). Now the application seems to work without problems. The client wants to update all dependencies to the latest version (minor.patch and major ideally). How would it be more correct to organize the update process while maintaining the performance of the application? While such thoughts come:
1. develop a bunch of tests to test the piece of code where the component is used (I only delve into the MEAN stack, so I may not quite understand how writing tests is organized).
2. to update minor.patch in package.json, specify '^' for all dependencies (for versions that start with zero ^0.x)
3. run npm update --save and npm update --save-dev.
4. run tests.
How to estimate the approximate amount of work when updating to the latest minor.patch and major versions? As far as I understand, upgrading to minor.patch shouldn't cause any compatibility issues.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-06-24
@maxfarseer

When facebook rolls out a new version of react, they write:
"We removed such and such a thing ... 99% of our tests passed, otherwise we tweaked the code a bit and voila."
That is, it will definitely be easier for you to upgrade with tests. But writing tests for the entire application (not your own, and even with little experience) is a voluminous and long task.
In fact, if you evaluate the time for writing tests - it will be at worst half, at best 9/10 of the total time for the task.
In my opinion, if it's not worth the task of making money / closing a critical bug, you shouldn't upgrade at all.
There is Bad advice to calm the soul:
Take the project, create a separate branch, delete the node_modules folder, install the npm-check-updates utilityand see how many packages you have updates for. The NCU will also indicate that "for some packages, there are new versions that exceed the rule in package.json". If you are ready to update everything in general, use ncu -a, and then npm install. Run the application and see how many errors/warnings there are.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question