@http-forge/core 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,14 @@ export declare class CollectionService implements ICollectionService {
|
|
|
24
24
|
private loader;
|
|
25
25
|
/** Debounce timer for coalescing rapid file-watcher change events */
|
|
26
26
|
private debounceTimer;
|
|
27
|
+
/**
|
|
28
|
+
* Set to true before any self-initiated write so that the resulting
|
|
29
|
+
* file-watcher event skips the expensive full `loadAll()` reload —
|
|
30
|
+
* the in-memory state was already updated by the write method itself.
|
|
31
|
+
* The watcher callback still fires `onCollectionsChanged` so tree views
|
|
32
|
+
* and panels are notified of the change.
|
|
33
|
+
*/
|
|
34
|
+
private selfWritePending;
|
|
27
35
|
/**
|
|
28
36
|
* In-memory Local Values for collection variables (not persisted)
|
|
29
37
|
*/
|
|
@@ -76,6 +76,29 @@ export declare class FolderCollectionStore implements ICollectionStore {
|
|
|
76
76
|
private loadFolderFromDir;
|
|
77
77
|
/**
|
|
78
78
|
* Load a request from directory
|
|
79
|
+
*
|
|
80
|
+
* TODO(perf/memory): This method eagerly loads ALL heavy fields for every request at
|
|
81
|
+
* startup (called by loadAll()). With thousands of requests, body, scripts, schemas,
|
|
82
|
+
* and docs can consume hundreds of MB of heap.
|
|
83
|
+
*
|
|
84
|
+
* The fix is to load only cheap metadata here (url, method, headers, auth, settings,
|
|
85
|
+
* name, description, deprecated) and introduce an on-demand
|
|
86
|
+
* `loadRequestDetail(requestPath)` that reads the heavy fields only when a request is
|
|
87
|
+
* actually opened or executed.
|
|
88
|
+
*
|
|
89
|
+
* Heavy fields to defer:
|
|
90
|
+
* - body (readBodyFromDir) — up to 100 KB+
|
|
91
|
+
* - scripts (loadScriptsFromDir) — pre/post JS source, up to 20 KB
|
|
92
|
+
* - responseSchema (readSchemaFile) — OpenAPI JSON, up to 1 MB+
|
|
93
|
+
* - bodySchema (readSchemaFile) — OpenAPI JSON, up to 1 MB+
|
|
94
|
+
* - doc (fs.readFileSync doc.md) — markdown, up to 50 KB
|
|
95
|
+
*
|
|
96
|
+
* Callers that need the heavy fields:
|
|
97
|
+
* - CollectionRequestExecutor (body, scripts)
|
|
98
|
+
* - RequestExecutionHandler (body, scripts)
|
|
99
|
+
* - SchemaHandler (responseSchema, bodySchema)
|
|
100
|
+
* - PanelDataProvider.getInitialData() (sends full request to webview)
|
|
101
|
+
* - MCP direct-execution: runRequest / runCollection (body, scripts)
|
|
79
102
|
*/
|
|
80
103
|
private loadRequestFromDir;
|
|
81
104
|
/**
|
package/package.json
CHANGED