Home Web Front-end JS Tutorial What is the difference between LTS and Current in Node.js

What is the difference between LTS and Current in Node.js

Apr 27, 2021 am 09:59 AM
current lts node.js

This article will introduce to you the difference between LTS and Current in Node.js. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

What is the difference between LTS and Current in Node.js

On October 18, 2016, Node.js v6 LTS (Boron) was released. This is also the first time since Node.js started the LTS release plan that two active LTS (v4 and v6). This series of articles will describe a series of changes brought about by Node.js v6 LTS. This article mainly focuses on LTS. If the reader is still unfamiliar with the release process of Node.js LTS, you can read this article first, otherwise you can skip reading the next article about Node.js Core changes.

What is the difference between LTS and Current in Node.js

Related recommendations: "nodejs Tutorial"

Node.js LTS Plan

Node.js core After the merger of Node.js and io.js, in order to ensure a stable and orderly release and allow developers to reasonably arrange upgrades, LTS (Long Term Support ) to plan the release cycle. The first LTS version was v4, released in October 2015.

Under this plan, the version of Node.js is equivalent to a snapshot of the master branch that has been stabilized at a specific time. When the time is up, the stable parts of the master branch will be integrated and a new version will be released. Therefore The release of Node.js is based on the passage of time, and the version jumps on the premise of ensuring close compatibility, rather than on the number of compatibility and new features. This also explains why the version of Node.js seems to jump. So fast (not "Ah, we have saved so many big moves, we can release a new version!" but "Ah, it's time to release a new version in April. Let's go through the big moves we have saved to see what is stable enough. Added in, although these tricks may not be that big...").

It is worth mentioning that the current Evergreen browser/mainstream JavaScript engine/ECMAScript standard/C standard also adopts similar principles, taking the time span as the benchmark, and intercepting stable features from the backbone for release .

Each LTS will have a code name. Take the element name from the periodic table, sort it alphabetically, and select the appropriate one. The code name of v4 is Argon (argon), and the code name of v6 is Boron (boron).

The version naming rules of Node.js follow Semantic Versioning (Semantic Versioning). The version number is divided into three parts. The first number (semver-major) increases, indicating incompatibility. changes; the second number (semver-minor) increases, indicating that there are new features that maintain compatibility; the third number (semver-patch) increases, indicating that there are changes while maintaining compatibility and features unchanged, such as Bugs fixed or documentation improved. This naming rule has advantages and disadvantages, which will not be described here. However, some of its contradictions make some exceptions to the naming of Node.js. For example, even if a security update causes incompatibility, in order to be able to update to all major versions, it is still semver. -minor.

The life of an LTS

What is the difference between LTS and Current in Node.js

##LTS current: April to October of the first year

Currently, Node.js will branch off from master every April, collect enough stable features, and release a major even-numbered version (such as v6.0.0) as an alternative for the next LTS. During the 6-month period from April to October of that year, this even-numbered version is called "current" (for example, v6.0.0 "current"). After accepting feedback from the community, this version will fix bugs, add new features, continue to improve, and may also delete some improvements that have too great a compatibility impact. At this time, the minor version of this version will continue to increase. Developers can use this time to test their applications offline with this candidate LTS version, and report compatibility issues and bugs to Node.js developers.

LTS active: October of the first year to April of the third year

By October of that year, this even-numbered version will become LTS (such as v6.9.0 "LTS"), At this time it is also referred to as "active LTS". During the next 18 months of active use, this version will almost never have any incompatible changes, and other dependencies (such as v8) other than security-related OpenSSL will not undergo major updates. During this period, developers can upgrade online Node.js to this stable LTS version and iterate using the new features of Node.js.

LTS maintenance: April of the third year to April of the fourth year

After 18 months of active period, in April of the third year, this version will usher in the last 12 months of maintenance period. At this time, its updates will only include security updates and bug fixes. Since Node.js releases an LTS in October every year, a new active LTS will be born on 2/3 of the nodes during the active period of this version (currently when v4 LTS has 6 months left to be active, v6 The time point when LTS active is released). By the time its active period ends, developers have had 6 months to transition to the next active LTS. Even if the progress of developer updates is slow, there is still 12 months of maintenance time, so upgrade as soon as possible. After 12 months, this LTS will end its life and will no longer receive any updates. So, every even-numbered version, has a lifespan of 3 years.

How do Node.js application developers choose?

For Node.js application developers who pursue stability, they only need to follow up and upgrade online when a version becomes active LTS in October every year, that is, every 12 The major version is upgraded once a month, and each upgraded version has a lifespan of 18 to 12 months. You don't have to worry too much about compatibility issues when following up on minors and patches. The current recommendation is that it is best to complete the online upgrade within 12 months after an active LTS comes out (because the next active LTS will be released after 12 months). If you are behind schedule, you can compromise until 18 months, before the end of the active period of this LTS. If you still can't catch up, you must at least upgrade it before the end of this version's life within 30 months, otherwise there will be no security updates.

If you are worried about the compatibility problems encountered by direct upgrade, you can test and upgrade offline in advance when the even-numbered version comes out every April, and feedback the problems to the community (of course, if you don’t have time) There is no need to worry about this step), and continue to follow up, and upgrade to the online version in October. In this way, both online and offline majors are promoted once every 12 months, but the time points are different. Although there are more compatibility issues that need to be followed up offline, you can also have your compatibility needs taken care of by the community through feedback.

If you are keen on trying new features, or if you are an experimental project that is not used in a production environment, you can try the odd-numbered major versions released every October. Each odd-numbered version will only be maintained for 8 months, and there will be no compatibility guarantee like LTS, but Node.js developers will use this version to prepare for the next LTS, so it will have more bold attempts. For example, more frequent v8 updates (meaning more ECMAScript new feature implementations and performance optimizations).

Therefore, developers who are still using v4.x online can already prepare to upgrade to v6.x. If your online application is still using a version released before the LTS plan was launched, such as v0.12.x, it is best to upgrade to v4.x or above as soon as possible, because v0.12.x will not be available after December 2016. There will be no security updates, let alone earlier versions. The main reason is that OpenSSL vulnerabilities will not be fixed, and these applications will be exposed to various security risks. Once you upgrade to v4.

How does this correspond to the source code of Node.js?

First of all, the Github Repo of Node.js has a master branch, and most commits are submitted to this branch through PR. Depending on whether these commits change compatibility or introduce new features, they are labeled semver-major or semver-minor.

When LTS needs to be prepared before April every year, Node.js will take a new branch from the master branch. If this is v6, then this branch is called v6.x-staging. Later modifications related to this LTS/modifications intended to enter this LTS, such as bug fixes, etc., still submit PR to master, but you need to add a tag lts-watch-v6.x.

After being merged into master, these changes will be picked out by the person responsible for release and merged into v6.x-staging. When the first version of v6 is ready for release one day in April, the person responsible for the release will create a v6.x branch and merge the changes from v6.x-staging. From April to October, all modifications to v6, whether minor or patch, are still submitted to master first, and then selected and merged into v6.x-staging, and then entered into v6.x when the version is released.

In this way, master always retains the latest changes. Other version-related branches are microcosms of mixing the commits selected from the master and suitable for release. v6.x-staging retains v6.x LTS-related modifications, and v6.x retains the version of each v6 release. . Except for the person responsible for handling the branch, other developers will not touch these version-related branches.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of What is the difference between LTS and Current in Node.js. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
A sneak peek of the seven highlights of Ubuntu 24.04 LTS A sneak peek of the seven highlights of Ubuntu 24.04 LTS Feb 27, 2024 am 11:22 AM

Ubuntu24.04LTS, codenamed "NobleNumbat" will be released soon! If you are using a non-LTS version such as Ubuntu 23.10, sooner or later you will need to consider upgrading. For those using Ubuntu20.04LTS or Ubuntu22.04LTS, it is worth thinking about whether to upgrade. Canonical has announced that Ubuntu 24.04LTS will provide update support for up to 12 years, broken down as follows: As an LTS version, it will have 5 years of regular maintenance and security updates. If you subscribe to Ubuntu Pro, you can enjoy an additional 5 years of support. Currently, this additional support period has been extended to 7 years, which means you will get up to 12

Detailed graphic explanation of the memory and GC of the Node V8 engine Detailed graphic explanation of the memory and GC of the Node V8 engine Mar 29, 2023 pm 06:02 PM

This article will give you an in-depth understanding of the memory and garbage collector (GC) of the NodeJS V8 engine. I hope it will be helpful to you!

An article about memory control in Node An article about memory control in Node Apr 26, 2023 pm 05:37 PM

The Node service built based on non-blocking and event-driven has the advantage of low memory consumption and is very suitable for handling massive network requests. Under the premise of massive requests, issues related to "memory control" need to be considered. 1. V8’s garbage collection mechanism and memory limitations Js is controlled by the garbage collection machine

Let's talk about how to choose the best Node.js Docker image? Let's talk about how to choose the best Node.js Docker image? Dec 13, 2022 pm 08:00 PM

Choosing a Docker image for Node may seem like a trivial matter, but the size and potential vulnerabilities of the image can have a significant impact on your CI/CD process and security. So how do we choose the best Node.js Docker image?

Node.js 19 is officially released, let's talk about its 6 major features! Node.js 19 is officially released, let's talk about its 6 major features! Nov 16, 2022 pm 08:34 PM

Node 19 has been officially released. This article will give you a detailed explanation of the 6 major features of Node.js 19. I hope it will be helpful to you!

Let's talk about how to use pkg to package Node.js projects into executable files. Let's talk about how to use pkg to package Node.js projects into executable files. Dec 02, 2022 pm 09:06 PM

How to package nodejs executable file with pkg? The following article will introduce to you how to use pkg to package a Node project into an executable file. I hope it will be helpful to you!

Let's talk in depth about the File module in Node Let's talk in depth about the File module in Node Apr 24, 2023 pm 05:49 PM

The file module is an encapsulation of underlying file operations, such as file reading/writing/opening/closing/delete adding, etc. The biggest feature of the file module is that all methods provide two versions of **synchronous** and **asynchronous**, with Methods with the sync suffix are all synchronization methods, and those without are all heterogeneous methods.

Let's talk about the event loop in Node Let's talk about the event loop in Node Apr 11, 2023 pm 07:08 PM

The event loop is a fundamental part of Node.js and enables asynchronous programming by ensuring that the main thread is not blocked. Understanding the event loop is crucial to building efficient applications. The following article will give you an in-depth understanding of the event loop in Node. I hope it will be helpful to you!

See all articles