feat: add cleaning cache for plugin files#2732
Conversation
🦋 Changeset detectedLatest commit: 28eb234 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.1778506313 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778506313
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778506313
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778506313 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778511384 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778511384
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778511384
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778511384 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778514304 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778514304
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778514304
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778514304 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778704883 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778704883
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778704883
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778704883 |
|
|
||
| let isEsmCacheBustHookRegistered = false; | ||
|
|
||
| function registerEsmCacheBustHook(): void { |
There was a problem hiding this comment.
Check if one project is opened in two different IDEs. How it works. Test with Cursor and VS-code
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778773569 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778773569
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778773569
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778773569 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778773638 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778773638
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778773638
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778773638 |
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778775254 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778775254
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778775254
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778775254 |
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 073052e. Configure here.
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1778833572 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1778833572
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1778833572
# or
npm install @redocly/respect-core@0.0.0-snapshot.1778833572 |

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 introduces cache-busting behavior for both CJS and ESM (with Node-version-dependent hooks), which could affect plugin reload semantics and module singletons.
Overview
Adds a dedicated
plugins-cachemodule and wiresresolvePluginsto use it, enabling explicit cache management instead of the previous in-function map and removing the special__webpack_require__path.Introduces
clearPluginsCache()(CJSrequire.cacheeviction for local deps + ESM cache-busting via?v=versioning and a NoderegisterHooksresolver that propagates the version to nestedfile:imports while skippingnode_modules). ExposesclearPluginsCache/getPluginCacheVersionvia config/core exports and adds tests/fixtures to cover reload behavior and dependency eviction, plus a changeset bump.Reviewed by Cursor Bugbot for commit 28eb234. Bugbot is set up for automated code reviews on this repo. Configure here.