Repository navigation
feat(hub): ng serve dev-server builder, and module timings in the Build tab - #493
Conversation
A client-only Angular CLI app had no server to mount the devtools in, so it needed the standalone CLI next to ng serve and a proxy config. The @pangular-inspector/devtools:dev-server builder runs the Angular CLI dev server from the workspace (@angular/build or @angular-devkit/build-angular) through executeDevServerBuilder() and hands it the hub's middleware, so the panel answers at /__devframes/ on the ng serve origin. The wrapped builder validates the serve options against its own schema; the builder adds `devtools` and `builder`, and closes the hub when the dev server stops. ng add now switches the serve target of a project with no Express server.ts and no Vite config to the builder, keeps an @angular-devkit/build-angular dev server as its `builder` option, skips webpack builds, and takes --dev-server=false to keep the target and print the standalone CLI steps. SSR and Vite setups are unchanged. Refs #342
…ild tab The Build tab and the module-graph agent tool showed the module graph, lazy boundaries and chunks, but not where the dev server spends its time. The Vite plugin now wraps the client plugin container's resolveId, load and transform calls when the dev server starts and keeps the durations per module id (dev server only, at most 5,000 modules, restored when the server closes). The module graph carries a `time` per module, the Build tab gets a sortable Time column next to sortable Size, Importers and Imports columns, and module-graph lists the slowest modules and a time per search hit. Refs #373
…er-timings # Conflicts: # extension/ui/assets/browser-agent-rpc-KH4HHvHf-B5Zk0AzF.js # extension/ui/assets/browser-agent-rpc-KH4HHvHf-DqNFcBHr.js # extension/ui/assets/browser-agent-rpc-KH4HHvHf-G6FmeCEh.js # extension/ui/assets/index-B6W3bI5a.js # extension/ui/assets/index-CH3Xqq9h.js # extension/ui/assets/index-Dw3jx7J8.js # extension/ui/index.html
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|
View your CI Pipeline Execution ↗ for commit bd654b4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
On the Windows runner tmpdir() is an 8.3 short name (RUNNER~1). Vite resolves the files to their long path, so serving /main.ts from the short-name root failed to load. The test now creates its project under realpathSync.native of the temp folder.
The Analog example's vite.config.ts imports the plugin from source, and Node loads it with type stripping only, which rejects the constructor parameter property in ModuleTimings. It is now a plain field set in the constructor.
|
Generated by Claude Code |
Two open tracker items. Ships in 1.0.0.
Dev-server builder (#342)
A client-only app run with
ng servegets the devtools without editingserver.tsand without running the standalone CLI behind a proxy.@pangular-inspector/devtools:dev-serverwraps@angular/build:dev-server(or@angular-devkit/build-angular:dev-server). It hands the hub middleware toexecuteDevServerBuilder, and the middleware runs before Angular's HTML fallback.devtools: falseturns the hub off. The builder warns on a webpack build target, because webpack takes no middleware.require().ng add: switches eligible serve targets to the new builder:applicationandbrowser-esbuildbuilds.--dev-server=falsekeeps the old behaviour. Express SSR and Vite setups are unchanged.installation.mdand the quick start explain the builder.Module timings in the Build tab (#373)
vite-timings.tswraps the client environment's plugin container. It records theresolveId,loadandtransformtimes of each module, keeps at most 5,000 modules, and runs in dev only.module-graphreports the times and gets a "Slowest modules" section. There is no new tool or argument.SortHeader. A Time cell shows the per-phase breakdown when you hover it.build.mdhas a new "Module timings" section with its limits. Timings are wall-clock and come from the Vite plugin only.Refs #342, #373
Checks
dev-server-builder.test.ts(13 tests), 9 ng-add tests,vite-timings.test.ts(7 tests, including a real Vite dev server), and Build tab sorting tests.@angular/builddev server through the builder:/__devframes/returned 200;Generated by Claude Code
Summary by CodeRabbit
ng serve;ng addconfigures this automatically when the project is compatible.