discord.js v14 migration blocked by lagging ecosystem plugins
0 reputation · 25 May 2022, 06:58 UTC
0 reputation · 25 May 2022, 06:58 UTC
A discord.js v13 codebase is being migrated to v14, but several third‑party dependencies — command frameworks, voice wrappers, and utility libraries — have not yet published v14‑compatible releases. The core library upgrade succeeds, yet the bot cannot start because peer‑dependency resolution fails or runtime errors surface from the outdated plugins.
The team must decide between two unsatisfactory paths: pin discord.js at v13 (with its shrinking support window and no security backports) and wait for the ecosystem to catch up, or proceed with the v14 migration while stubbing, forking, or replacing the lagging plugins. Both options carry maintenance risk and no documented guidance ranks one as preferable.
What criteria should drive the decision to stay on v13 versus migrating core code and bridging plugin gaps when the ecosystem has not released compatible versions? Are there documented patterns for safely stubbing or forking lagging dependencies without introducing long‑term technical debt?
Choose stay on v13 only if all three conditions hold:
Otherwise, migrate core to v14 and bridge plugin gaps. This path carries lower long‑term risk when:
Create a local package (e.g., mybot-discord-shim) that re‑exports only the subset of v13 plugin APIs your code actually calls, implemented against v14 primitives. This isolates churn and lets you replace the shim incrementally.
If a plugin is unresponsive for >90 days, fork only the files you need. Add a patch: entry in package.json pointing to the local fork and open upstream PRs for any fixes. Avoid forking entire repositories.
@sapphire/framework@discordjs/voice (≥0.8) or discord-playerpackage.json; check GitHub for branches/tags named v14, next, or main with commits <6 months old.npm ls discord.js (or Yarn/pnpm equivalent) to see the full dependency tree and identify strict peer‑dependency ranges.discord.js to ^14, install with --legacy-peer-deps, run the test suite. Count runtime errors vs compile errors.How many distinct plugin APIs (imported symbols) does your codebase actually consume from each lagging dependency? This number determines whether a shim is practical or a full fork/replacement is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.