Skip to content

fix(plugins): reload updated plugins via version-keyed cache paths#103

Merged
albanm merged 1 commit into
masterfrom
fix-npm-cache
Jun 3, 2026
Merged

fix(plugins): reload updated plugins via version-keyed cache paths#103
albanm merged 1 commit into
masterfrom
fix-npm-cache

Conversation

@albanm
Copy link
Copy Markdown
Member

@albanm albanm commented Jun 3, 2026

Upgrade @data-fair/lib-node-registry to ^0.7.0 and remove the query-string cache-busting from importPluginModule.

Why: 0.7.0 extracts each plugin version into its own directory, so an updated plugin resolves to a fresh module URL and Node's registry reloads the whole graph naturally — the manual ?imported=<timestamp> cache-bust in the API's prepare flow is no longer needed.

Regression risks:

  • Correctness now depends on 0.7.0 giving each plugin version a distinct directory. A plugin re-published with changed code under the same version string would resolve to the same path and be served stale from the long-lived API process (the old cache-bust would have dodged this).
  • The API prepare flow can run twice in one save (api/src/processings/router.ts:187); the second import now hits Node's module cache. Safe as long as the path is identical across both runs within a save, which it should be.
  • Worker is unaffected — it never used cache-busting and runs each task in a fresh child process.

Bump @data-fair/lib-node-registry to ^0.7.0, which extracts each plugin
version into its own directory (<version>+<epoch>/<buildTuple>) behind a
stable pointer file. An updated plugin now resolves to a fresh absolute
path, so the long-lived API process reloads the whole module graph
instead of serving stale code.

The old `cacheBust` query-string only re-evaluated the entry module,
leaving transitive imports (siblings + bundled deps) stale; drop it and
the now-unused option from importPluginModule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@albanm albanm merged commit 3e8fc57 into master Jun 3, 2026
4 checks passed
@github-actions github-actions Bot added the fix label Jun 3, 2026
@albanm albanm deleted the fix-npm-cache branch June 3, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant