CodeVetter · Repo Unpack · Behavior traces
angular/angular
The investigation followed application startup, documentation navigation, and search-history persistence across their source boundaries. Additional traces cover HTTP, server rendering, tutorials, DevTools transport, and service-worker restoration. These are ordered source walkthroughs, not observed runtime executions. Each trace names the functions or operations that establish its behavior.
- Startup, stage 1: adev main calls bootstrapApplication(AppComponent, appConfig); bootstrapApplication calls createProvidersConfig and then internalCreateApplication.
- Startup, stage 2: internalCreateApplication creates or reuses the platform injector, constructs EnvironmentNgModuleRefAdapter, and calls bootstrap; bootstrap resolves injector initializers and waits for ApplicationInitStatus.donePromise.
- Startup, stage 3: bootstrap calls ApplicationRef.bootstrap(rootComponent); ApplicationRef creates a ComponentFactory and ComponentRef, then _loadComponent attaches the view, calls tick, and invokes bootstrap listeners.
- Documentation navigation, stage 1: Router construction installs and subscribes to the setupNavigations transition stream. navigateByUrl calls scheduleNavigation, which passes request state to handleNavigationRequest; that pushes into the stream whose pipeline checks guards, resolves route data, and loads lazy components.
- Documentation navigation, stage 2: the generated docContent resolver calls ContentLoader.getContent; resolved input reaches DocsComponent and DocViewer.renderContentsAndRunClientSetup, which writes HTML, loads examples, and builds navigation aids.
- Search persistence: SearchDialog binds form(searchQuery); debounced resultsResource calls searchWithQuery and parseResult; clicking a result invokes history.addItem → updateHistory → localStorage.setItem, and a later SearchHistory constructor calls loadHistory to restore the Map.adev/shared-docs/components/search-dialog/search-dialog.component.ts#L57-72adev/shared-docs/services/search.service.ts#L50-60adev/shared-docs/components/search-dialog/search-dialog.component.html#L14-19adev/shared-docs/services/search-history.service.ts#L95-120adev/shared-docs/services/search.service.ts#L189-229adev/shared-docs/services/search-history.service.ts#L48-73
- HTTP action: HttpClient.request constructs HttpRequest and runs HttpInterceptorHandler.handle on subscription; its chain reaches xsrfInterceptorFn and FetchBackend.handle → doRequest → parseBody, followed by response or error emission.
- SSR action: renderApplication → validateAllowedHosts → createServerPlatform → bootstrap({platformRef}) → applicationRef.whenStable → renderInternal; asyncDestroyPlatform runs in finally.
- Tutorial action: NodeRuntimeSandbox.init → boot → startInteractiveTerminal → initProject → mountProjectFiles → installDependencies → loadTypes/startDevServer; server-ready forwards the generated preview URL.
- DevTools connection: chrome.runtime.connect creates the port; detectAngular triggers backend script injection and attemptBackendHandshake, which retries handshakeWithBackend every 500 ms until backendReady; onAny handlers relay messages between the two buses.
- Offline request: the fetch listener calls Driver.onFetch; accepted requests use handleFetch → ensureInitialized → assignVersion → AppVersion.handleFetch, with safeFetch fallbacks; initialize restores the control-table records through CacheTable.read.