|
| 1 | +# Node.js LTS |
| 2 | + |
| 3 | +Date: 2023-07-03 |
| 4 | + |
| 5 | +Status: accepted |
| 6 | + |
| 7 | +## Context |
| 8 | + |
| 9 | +Node.js has a regular release cycle which is documented in the |
| 10 | +[release schedule](https://nodejs.org/en/about/releases/). At the time of this |
| 11 | +writing, there are 5 stable maintained releases: 14, 16, 18, 19, 20. I'll refer |
| 12 | +you to that documentation to understand how the release cycle works. |
| 13 | + |
| 14 | +Deciding which version of Node.js to use for a project is a trade-off between |
| 15 | +using the latest features and stability. |
| 16 | + |
| 17 | +The Epic Stack is more focused on stabling shipping web apps than experimenting |
| 18 | +with the latest features which is where the Active Long-Term Support (LTS) |
| 19 | +version really shines. |
| 20 | + |
| 21 | +We deploy our apps in Docker containers, and there are various base images we |
| 22 | +can use as options which you can find on |
| 23 | +[the Node.js Docker Hub](https://hub.docker.com/_/node). Aside from the version, |
| 24 | +there flavors of the base image which are based on the Linux distribution used. |
| 25 | +Feel free to read more about the different flavors on Docker Hub. One of the |
| 26 | +goals for us here is to not ship more than we need in production. |
| 27 | + |
| 28 | +An additional consideration we'll add as context here is what version of Linux |
| 29 | +to have our base image built on. With the same pragmatic approach as the Node.js |
| 30 | +version we want to balance latest features with stability. We'll use the |
| 31 | +[Debian release cycle](https://wiki.debian.org/DebianReleases) as a guide for |
| 32 | +this. |
| 33 | + |
| 34 | +## Decision |
| 35 | + |
| 36 | +Use and current LTS version of Node.js as the default in the starter. |
| 37 | + |
| 38 | +We'll use the `slim` flavor of the node.js images. |
| 39 | + |
| 40 | +We'll use the `bookworm` flavor of the node.js images (which is the current |
| 41 | +stable version of Dabian: v12). |
| 42 | + |
| 43 | +## Consequences |
| 44 | + |
| 45 | +Folks should hopefully run into few compatibility issues. It's possible they |
| 46 | +will need features that are not back-ported to the current active LTS version, |
| 47 | +however it's trivial to update the Node.js version. Added documentation to the |
| 48 | +[managing updates](../managing-updates.md) docs should help people manage this. |
| 49 | + |
| 50 | +We'll need to update the Node.js version in the starter whenever the active LTS |
| 51 | +version changes. |
| 52 | + |
| 53 | +Folks who need a bunch more out of their operating system packages will need to |
| 54 | +switch from the `slim` flavor which only involves updating the `Dockerfile`. It |
| 55 | +is possible some will not realize they need more than `slim` until they run the |
| 56 | +Docker image (which many people will only do in production). However the |
| 57 | +likelihood of this impacting anyone is pretty low. |
0 commit comments