Skip to content

Commit 755a654

Browse files
review
1 parent 16db71e commit 755a654

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/start-plugin-core/src/import-protection-plugin/INTERNALS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ Key fields for violation handling:
216216
deferral. Keyed by importer file path.
217217
- `deferredBuildViolations: Array<DeferredBuildViolation>` — build mode
218218
deferral. Each entry has `{ info, mockModuleId }`.
219+
220+
Per-build/watch iteration, `buildStart` clears `pendingViolations` and resets
221+
`deferredBuildViolations` so deferred entries don't leak across rebuilds.
222+
219223
- `graph: ImportGraph` — import dependency graph for reachability checks.
220224
- `serverFnLookupModules: Set<string>` — modules transitively loaded during
221225
server-fn analysis (false-positive suppression).

‎packages/start-plugin-core/src/import-protection-plugin/plugin.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,8 @@ export function importProtectionPlugin(
10791079
envState.transformResultKeysByFile.clear()
10801080
envState.postTransformImports.clear()
10811081
envState.serverFnLookupModules.clear()
1082+
envState.pendingViolations.clear()
1083+
envState.deferredBuildViolations.length = 0
10821084
envState.graph.clear()
10831085
envState.deniedSources.clear()
10841086
envState.deniedEdges.clear()

0 commit comments

Comments
 (0)