Skip to content

Tracking: drop plenary.nvim dependency #340

@delphinus

Description

@delphinus

Background

plenary.nvim will be archived in late June 2026. telescope.nvim is preparing the same migration in nvim-telescope/telescope.nvim#3647, where the maintainer offered to keep some plenary modules bundled in telescope for extensions to consume.

This issue tracks our effort to remove plenary as a required dependency from telescope-frecency.nvim.

Approach

After PR 1 (#341) landed, clason confirmed in a #341 comment that telescope.nvim itself will keep vendored log and async modules until upstream vim.log / vim.async are stable. The WIP rewrite lives at lua/neoplen/* on the feat/neoplen branch (nvim-telescope/telescope.nvim#3647, the neoplen prefix is explicitly temporary). frecency therefore only needs to rename its requires to the telescope-vendored versions once that PR lands — no in-tree logger, and no lua/frecency/async/ vendoring. plenary.path / plenary.scandir / plenary.job are still being removed from telescope, so we replace those ourselves.

  • Switch plenary.log and plenary.async requires to the telescope-vendored modules (final names land with telescope's PR).
  • Replace plenary.path call sites with vim.fs / vim.fn (the OO wrapper goes away — telescope itself is moving to flat string manipulation).
  • Vendor plenary.scandir.__make_gitignore only (the single function we use; telescope is dropping scandir entirely).
  • Replace plenary.job use in tests/util.lua with vim.system.
  • Move the test runner from plenary.busted to nvim-treesitter/plentest.nvim.
  • Drop v1 runtime code (entry score / table writes / DB write・sort・update paths and their specs) but keep the v1 → v2 auto-migration in 2.0.0. The minimal v1 read path (binary deserialize + record walk) is flattened into lua/frecency/v2/database.lua, and the existing DatabaseV2:migrate_from / TableV2:from_v1 are retained, so existing file_frecency.bin users upgrade transparently with no data loss. The migration code itself is scheduled for removal in a later 2.x minor release after a CHANGELOG notice.
  • Remove the db_version config option (only v2 exists internally).
  • Public query() API: emit v2 native fields (num_accesses, last_accessed, half_life, reference_time) plus a count alias that mirrors num_accesses for backwards compatibility. The timestamps array field is dropped because v2 keeps only the latest access time, not history.

Minimum supported Neovim is bumped to v0.11.7 to match telescope.nvim.

PR breakdown

  • PR 1 (feat!: drop v1 runtime, keep v1 -> v2 auto-migration (PR1 of plenary removal) #341, merged 2026-05-10) — Drop v0.10.4 from CI matrix; remove v1 runtime code; flatten the v1 → v2 auto-migration path into v2 so existing file_frecency.bin users upgrade transparently; drop the db_version option; update query() shape to v2 + count alias.
  • PR 2 — Switch plenary.log and plenary.async requires to the telescope-vendored modules. Small, mechanical change; gated on feat: vendor and clean up plenary telescope.nvim#3647 landing with stable module names. Affects both production code and tests.
  • PR 3 — Production-code plenary cleanup: replace plenary.path call sites in file_lock.lua / entry_maker.lua / os_util.lua / picker.lua / fs.lua / v2/database.lua with vim.fs / vim.fn / vim.uv equivalents; vendor plenary.scandir.__make_gitignore into fs.lua; drop the now-unused FrecencyPlenaryScanDirOptions / scan_dir type aliases. Tests are left alone in this PR — they still require "plenary.async" until PR 2, so switching the test framework now does not actually drop the dep. Independent of the telescope PR.
  • PR 4 — Test framework migration (depends on PR 2 landing first, so that test files no longer need plenary.async): replace plenary.path in tests/util.lua with vim.fs / vim.fn and update spec callers; replace plenary.job in tests/util.lua with vim.system; switch test runner from plenary.busted to nvim-treesitter/plentest.nvim (update bin/run-tests, tests/minimal.lua, .github/workflows/ci.yml); drop the remaining FrecencyPlenary* type aliases; remove plenary.nvim from bin/run-tests's prepare_lib list; final README / :help cleanup.

Each PR keeps bin/run-tests green on Linux / macOS / Windows × stable / nightly.

Breaking changes

  • Minimum Neovim is now v0.11.7.
  • The db_version config option is removed (only v2 exists internally; setting it becomes a no-op or validation error TBD).
  • v1 file_frecency.bin is migrated automatically on first launch with 2.0.0; the v1 file itself is left on disk for rollback safety. Internal score representation changes from v1 (count × static recency) to v2 (exponential decay), so initial rankings may shift after upgrade. The migration shim itself will be removed in a later 2.x minor release after CHANGELOG notice (separate tracking issue to be filed).
  • The query({ record = true }) return shape changes from v1 (count/path/score/timestamps) to v2 (path/score/num_accesses/last_accessed/half_life/reference_time) plus a count alias for num_accesses. The timestamps array is no longer returned because v2 has no per-access history; downstream integrations that previously read timestamps should use reference_time + last_accessed to recover the most-recent access epoch (single value, not a list).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions