Repository navigation
feat: Re.Pack DevTools plugin with agent tools for runtime debugging - #1510
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
a6e2806 to
690957f
Compare
690957f to
47a6b67
Compare
47a6b67 to
b73f502
Compare
|
/review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 6 new findings on b73f502. The verdict and the full list are in the summary comment.
Add a private, workspace-only Rozenite plugin (packages/repack-devtools-plugin) that records ScriptManager activity, Module Federation runtime state and events, uncaught errors, dev-server compilations and requests, and turns them into diagnostics. - Panels for scripts, federation, dev server and errors/symbolication - 16 `rozenite agent callstack/repack-devtools` tools, including actions to reproduce issues headlessly (load-script, load-remote, invalidate-scripts, symbolicate, reload) - `withRepackDevTools` adds a compilation collector and `/repack-devtools/state` endpoints to any Re.Pack dev server - MF 2 runtime plugin export for recording from container start-up Wire it into all tester apps behind WITH_ROZENITE=true and add the repack-debug-runtime and repack-reproduce-issue skills describing how to use it to reproduce and root-cause issues.
…ults Add agent tools to check retry, dedup and cache behaviour and to test failure handling without changing app code: - list-script-calls: every loadScript/prefetchScript/invalidateScripts call with outcome, duration, whether resolvers ran and whether it reused a stored attempt (the #1506 signature). The tracer returns a derived promise so unhandled rejections are still reported. - get-script-manager: stored promises with their state, resolvers, hook taps and cache; flags stored rejected promises. - inject-script-fault: fail or delay the resolve/load stage through ScriptManager hooks. - inject-server-fault / list-faults / clear-faults: make any dev server wrapped with withRepackDevTools (MF remotes included) answer with an error status, a delay or a dropped connection; also available as GET|POST|DELETE /repack-devtools/faults. The request log now records connections closed before a response (status 0) and marks faulted responses. The MF runtime plugin records the manifest HTTP status, since MF parses error pages as JSON and only reports a parse error.
…nostics Panels: - Detail boxes no longer collapse over the next section and scroll into view when opened from a table row. - Table cells keep long ids, URLs and messages on one line (full value on hover) instead of breaking every few characters; times, sizes and durations do not wrap; tables scroll sideways in narrow panels instead of clipping columns. - Diagnostics show identical messages once and only the first three until expanded. - Dev server: requests come before build output, warnings/errors and assets are collapsible, platforms that were never built show "not requested". - The symbolication result scrolls into view; the federation load box is hidden without an MF runtime. Data: - Strip ANSI colour codes from /symbolicate code frames. - Report a shared-package problem once when instances share a scope. - Group MF load failures per URL and downgrade them to warnings when a later load of the same URL succeeded.
…build on Node < 20.19 The tester apps now load the plugin from their gated rozenitePlugins.ts and import the bundler entry dynamically, including the MF mini-app configs, so default dev runs and E2E builds never load it. Rozenite and Vite 7 need Node 20.19+, and tester-app's tests depend on this package's build through turbo, which broke the Node 18 test matrix. The build now skips on older Node; nothing loads the package without WITH_ROZENITE and its tests run from source.
- Read MF share flags written as numbers (Rspack emits `singleton: 1`, `eager: 1`), so duplicate-singleton and strictVersion diagnostics fire. - satisfiesRange returns undefined for wildcards, partial versions and prereleases instead of treating `1.x` as an exact `1.0.0`. - Forward compilations from Re.Pack's webpack worker threads to the dev server's store over a BroadcastChannel; /repack-devtools/state was empty with webpack. - get-overview also queries the dev servers of MF remotes and other script origins and merges their diagnostics, prefixed with the origin. - Drop `Access-Control-Allow-Origin: *` and refuse cross-origin POST/DELETE to /repack-devtools/*, so a web page cannot inject faults. - load-remote reports a missing instance name and a default instance without loadRemote separately. - Dev-server panel shows a first in-flight build as compiling, and the errors panel shows symbolication failures instead of dropping them.
…in the webpack host config Matches the Rspack host config, so startup MF events are recorded with USE_WEBPACK too.
…ck-reproduce-issue Covers tester-federation-v2's NativeWind/Reanimated/E2E coverage, tester-expo-widget, and jest, vitest and @e2e-dev/mobile test layers.
b73f502 to
be30b3b
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on be30b3b. The verdict and the full list are in the summary comment.
…t-overview, boot-record tester-expo
get-overview probed every script origin as a dev server, so a chunk loaded
from a CDN was listed as an unreachable dev server on every call. MF remote
origins are still always reported; other script origins are reported only
when they serve DevTools state, origins that answer without it are not
probed again, and remote probes time out after 3 s.
tester-expo never called installRepackDevTools({ boot: true }), so its
overview always warned that startup events may be missing. The root layout
module now starts recording, since expo-router/entry is the app entry.
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Stacked on #1509.
Summary
Adds
packages/repack-devtools-plugin(@callstack/repack-devtools-plugin), a private, workspace-only Rozenite plugin. It makes Re.Pack runtime and dev-server state inspectable in DevTools and by fully automated agents. The aim is to reproduce issues and find root causes without a human driving the app.What it records
__webpack_require__.S.Diagnostics (
get-overview, severity-sorted, each with arefto the details):requiredVersionmismatchescatalog:/workspace:)/symbolicate400s with the reasonHow to reach it
rozenite agent callstack/repack-devtools <tool>. Besides reads, they include actions to reproduce issues headlessly:load-script,prefetch-script,invalidate-scripts,load-remote,symbolicate,clear,reload. Typed descriptors are exported from/sdkfor@rozenite/agent-sdk.withRepackDevTools(config)addsGET /repack-devtools/state,/compilation?platform=andPOST /clearto any dev server, including MF mini-app servers. These work with curl even when the bundle doesn't build.Tester apps
All four depend on the plugin from the workspace. Everything is behind
WITH_ROZENITE=true, as in #1509. tester-federation-v2's host also registers the runtime plugin viaruntimePluginsin development.Agent skills (
.agents/skills, symlinked into.claude/skills):repack-debug-runtime: setup, tool and endpoint reference, playbooks per failure type, and gotchas found while testing on device.repack-reproduce-issue: the issue → tester repro → evidence → root cause → fix → regression test loop.The design doc is in
agent_context/repack-devtools-oct2026.Notes
rozenite buildemits the CommonJS entry withmoduleResolution: node10, which TypeScript 7 removed.scripts/rozenite.mjsruns the CLI with TypeScript 5 (typescript-5alias) astsc. The package's owntypescriptstays at the workspace version. Pinning TS 5 directly gavereact-nativea different pnpm peer variant, so the MF host bundled two React Native copies and crashed (Tried to register two views with the same name DebuggingOverlay).@swc/helpersdevDependency: the testers' SWC loader transforms the linked package'sdist(it isn't undernode_modules), as with@callstack/repack.react-native-safe-area-contextandreact-native-screenswith versioncatalog:testers(copied from package.json). MF logs "does not satisfy the requirement" for these. Not fixed here.Test plan
pnpm --filter @callstack/repack-devtools-plugin test: 38 unit tests covering the ScriptManager reducer, error parsing, stack parsing and symbolication alignment, semver/federation diagnostics, the collector, request diagnostics, the middlewares against a real HTTP server, and the config wrapper.pnpm lint:ci,pnpm build.pnpm test: 17/17. No new tsc errors in the testers vs. base.get-overviewreports boot-recorded chunk loads and the/symbolicate400 from app start.load-scriptwith a bogus chunk produced aRequestFailurerecord plus a 404 diagnostic pointing atsrc_asyncChunks_Async_local_tsx.chunk.bundle.symbolicatemaps frames correctly. This caught and fixed an off-by-one: Re.Pack's symbolicator drops non-http frames.get-federationshows instances, remotes and share scopes, and the runtime plugin is active.load-remote MiniApp/MiniAppNavigatorloads the container and chunks through ScriptManager.get-dev-server --originexplains it.