Files
insomnia/scripts/circular-references
Bingbing 010c37fa44 refactor: break route<->component circular dependencies in debug/mock routes
## Background

The debug and mock-route routes are imported back by the components they render: the gRPC panes import `GrpcRequestState` from the debug route, and the mock editors and panes import the loader hook and patcher from the mock-route route. The request update action also imports `updateMimeType` from the content-type dropdown, which pulls `use-request` back to the action route. Those edges close six route <-> component cycles.

## Changes

- Move `GrpcMessage`/`GrpcRequestState` to `ui/utils/grpc.ts`; repoint the debug route and the two gRPC panes.
- Move the mock-route loader hook and patcher into `ui/hooks/use-mock-route.ts`. The route keeps its `clientLoader` and `satisfies MockRouteLoaderData`; the components import the neutral hook. The patcher still uses the update action route's generated fetcher.
- Move the pure `updateMimeType`/`newBodyGraphQL` helpers from the content-type dropdown into `common/request-mime-type.ts`, so the action route no longer imports a UI component.
- Remove the six now-resolved entries from `scripts/circular-references/known-violations.json`.

## Testing

- `npm run check-cycle-references`: insomnia 19 -> 13 cycles, 0 new.
- `npm run type-check -w insomnia` and eslint on the changed files: clean.

## References

Follows #10496 in the circular-reference cleanup chain.
2026-11-03 11:29:17 +08:00
..