Tanda sisipan (^) Pengkhianatan: Bagaimana SemVer Menjadi Bumerang
Untuk mencari tahu mengapa aplikasi Anda rusak tanpa Anda menyentuh satu baris kode backend pun, buka package.json mengajukan. Anda akan melihat baris yang terlihat seperti ini:
{
"dependencies": {
"express": "^4.21.0",
"cors": "~2.8.5",
"dotenv": "16.4.5"
}
}
Perhatikan simbol-simbol kecil yang ada di depan nomor versi? Itu Versi Semantik (SemVer)dan meskipun dirancang untuk menyelamatkan kita, hal ini dapat menyebabkan masalah pada runtime Anda.
Mendapatkan Shreyashcerita di kotak masuk Anda
Bergabunglah dengan Medium secara gratis untuk mendapatkan pembaruan dari penulis ini.
Di SemVer, nomor versi mengikuti a MAJOR.MINOR.PATCH struktur (misalnya, 4.21.0):
- tambalan (
0.0.X): Perbaikan bug. Seharusnya benar-benar aman dan kompatibel ke belakang. - KECIL (
0.X.0): Fitur baru. Seharusnya aman dan kompatibel ke belakang. - BESAR (
X.0.0): Perubahan yang merusak. Harapkan segalanya akan rusak.
Saat Anda menginstal sebuah paket, npm default untuk menambahkan a tanda sisipan (^) awalan.
"^4.21.0" means: "Install 4.21.0, but automatically pull any MINOR or PATCH update up to < 5.0.0"
"~2.8.5" means: "Install 2.8.5, but automatically pull any PATCH update up to < 2.9.0"
"16.4.5" means: "Install EXACTLY version 16.4.5"
Teorinya terdengar bagus: Anda mendapatkan patch keamanan otomatis dan perbaikan bug tanpa perlu bersusah payah.
Kenyataannya? Pemelihara paket adalah manusia. Pengelola sumber terbuka memublikasikan “tambalan kecil” ke paket empat tingkat jauh di dalam pohon ketergantungan Anda, secara tidak sengaja menimbulkan bug karena perubahan yang dapat menyebabkan gangguan dirilis dan penghapusan API yang tidak digunakan lagi yang masih diandalkan oleh ketergantungan Anda, dan saat berikutnya Anda menjalankannya npm installaplikasi Anda secara otomatis mengunduhnya.
PakarPBN
A Private Blog Network (PBN) is a collection of websites that are controlled by a single individual or organization and used primarily to build backlinks to a “money site” in order to influence its ranking in search engines such as Google. The core idea behind a PBN is based on the importance of backlinks in Google’s ranking algorithm. Since Google views backlinks as signals of authority and trust, some website owners attempt to artificially create these signals through a controlled network of sites.
In a typical PBN setup, the owner acquires expired or aged domains that already have existing authority, backlinks, and history. These domains are rebuilt with new content and hosted separately, often using different IP addresses, hosting providers, themes, and ownership details to make them appear unrelated. Within the content published on these sites, links are strategically placed that point to the main website the owner wants to rank higher. By doing this, the owner attempts to pass link equity (also known as “link juice”) from the PBN sites to the target website.
The purpose of a PBN is to give the impression that the target website is naturally earning links from multiple independent sources. If done effectively, this can temporarily improve keyword rankings, increase organic visibility, and drive more traffic from search results.