4 ms·
I'm currently migrating an ancient codebase of mine from Node 0.X to the most modern Node I could find. I'd just make the big jump, assuming that things aren't
by mmastrac 4y ago
I'm currently migrating an ancient codebase of mine from Node 0.X to the most modern Node I could find. I'd just make the big jump, assuming that things aren't that broken.
Here's the process I followed:
- Ensure that all the tests are passing at the start to have something to compare against.
- Run some manual functional tests to cover gaps in the test and document how the old system worked
- Migrated everything to the latest code standards, one at a time, testing at each stage: ES6 modules, classes, etc (this might not apply for your codebase if it's modern enough)
- Migrated deps to modern ones, one at a time, testing between each one
- Migrated the toolchains to modern ones (ie: rollup, etc - whatever you decide on for your cases)
- Migrated tests to modern test libraries. This step might be moved earlier depending on whether the testing libraries support the older version of Node.
It's not painful, but it's somewhat tedious. May as well make that jump as large as possible, and consider just jumping to a non-LTS version of node if you're going to be actively maintaining it. I prefer LTS for projects that are going into hibernation while running (mostly just bugfixes and minor tweaks - not active changes).