feat: add cleaning cache for plugin files#2732
Conversation
🦋 Changeset detectedLatest commit: 1155164 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1775733825 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1775733825
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1775733825
# or
npm install @redocly/respect-core@0.0.0-snapshot.1775733825 |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1775739903 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1775739903
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1775739903
# or
npm install @redocly/respect-core@0.0.0-snapshot.1775739903 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1775814315 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1775814315
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1775814315
# or
npm install @redocly/respect-core@0.0.0-snapshot.1775814315 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1775819371 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1775819371
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1775819371
# or
npm install @redocly/respect-core@0.0.0-snapshot.1775819371 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1776082389 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1776082389
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1776082389
# or
npm install @redocly/respect-core@0.0.0-snapshot.1776082389 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1776085657 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1776085657
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1776085657
# or
npm install @redocly/respect-core@0.0.0-snapshot.1776085657 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1776087574 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1776087574
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1776087574
# or
npm install @redocly/respect-core@0.0.0-snapshot.1776087574 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777399620 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777399620
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777399620
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777399620 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777470128 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777470128
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777470128
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777470128 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777472433 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777472433
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777472433
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777472433 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777474661 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777474661
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777474661
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777474661 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778237731 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778237731
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778237731
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778237731 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7e44cfe. Configure here.
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778250423 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778250423
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778250423
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778250423 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778253852 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778253852
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778253852
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778253852 |

What/Why/How?
In VSCE, we have a problem with clean cache for plugin files. This PR adds cleaning the general cache for plugin files, cjs files, and esm files.
__webpack_require__Reference
Issue Redocly/redocly-vs-code#10
VSCE Part https://github.com/Redocly/redocly/pull/22293
Testing
Tested in VSCE part
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Touches plugin loading/caching and Node module resolution (including
module.registerHooksfor ESM cache-busting), which can affect runtime behavior across environments. Tests cover core scenarios, but the process-wide hook and cache eviction logic could have edge-case compatibility risks.Overview
Adds a centralized plugin cache implementation (
plugins-cache.ts) and a new publicclearPluginsCacheAPI (exported fromconfig/index.tsandcore/index.ts) to force reloading plugin modules.Updates
resolvePluginsto use the new cache +loadPluginModule(mtime-based cache busting for ESM, targetedrequire.cacheeviction for CJS) and removes the legacy__webpack_require__path. Adds dedicated tests for cache reuse/clearing behavior and updates fixtures to cover both ESM and CJS plugin init cases.Also introduces a temporary
plugin-import-tree.tsdebug logger wired into plugin loading to print plugin import graphs to stderr.Reviewed by Cursor Bugbot for commit 1155164. Bugbot is set up for automated code reviews on this repo. Configure here.