* Put back in the pending set the route references whose answer reads a * module in `changedFilePaths` (`FrameworkResolver.lazyModules`), for a * sync's resolution sweep. Returns the number put back. * * A route that renders a same-file `const Docs = lazy(() => * import('./pages/Docs'
(changedFilePaths: readonly string[])
| 731 | * new files already. |
| 732 | */ |
| 733 | reopenRouteModuleReaders(changedFilePaths: readonly string[]): number { |
| 734 | const readers = this.frameworks.filter((f) => f.lazyModules); |
| 735 | if (readers.length === 0 || changedFilePaths.length === 0) return 0; |
| 736 | const changed = new Set(changedFilePaths); |
| 737 | const edgeIds: number[] = []; |
| 738 | const refs: UnresolvedReference[] = []; |
| 739 | for (const edge of this.queries.getRouteEdgesMovedBy(changedFilePaths)) { |
| 740 | const ref = resurrectRefFromDroppedEdge(edge); |
| 741 | if (!ref) continue; |
| 742 | const asked: UnresolvedRef = { ...ref, filePath: edge.sourceFilePath, language: edge.sourceLanguage }; |
| 743 | const reads = readers.some((f) => f.lazyModules!(asked, this.context).some((file) => changed.has(file))); |
| 744 | if (!reads) continue; |
| 745 | edgeIds.push(edge.edgeId); |
| 746 | refs.push(ref); |
| 747 | } |
| 748 | if (refs.length > 0) this.queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs); |
| 749 | return refs.length; |
| 750 | } |
| 751 | |
| 752 | /** |
| 753 | * Pre-build lightweight caches for resolution. |
no test coverage detected