You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Transition declaration/reference discovery in in-browser type diagnostics to a TypeScript preprocessor-first flow (`ts.preProcessFile`) instead of regex-driven parsing.
25
+
- Scope this to the lazy React type environment loader first, then evaluate whether the same parser path should be reused for all type package graph walking.
26
+
- Keep current lazy-loading behavior intact: no React type graph fetch until the user switches to React render mode and triggers Typecheck.
27
+
- Preserve CDN provider fallback behavior and existing diagnostics UX while changing parser internals.
- Secondary fallback only when unavailable: current lightweight parsing logic.
31
+
- Never treat commented example code as imports/references.
32
+
- Add guardrails around known failure classes discovered during development:
33
+
- Relative declaration references like `global.d.ts` must resolve as file paths, not package names.
34
+
- Extensionless declaration references (for example `./user-context`) must attempt `.d.ts` candidates first.
35
+
- Avoid noisy parallel fetch fan-out for bad candidates; use ordered fallback to reduce 404/CORS console noise.
36
+
- Add focused test coverage (unit or Playwright) that proves:
37
+
- React-mode typecheck does not trigger fake fetches from commented examples in declaration files.
38
+
- React-mode typecheck resolves `react` and `react-dom/client` without module-not-found diagnostics.
39
+
- DOM mode still avoids React type graph hydration.
40
+
- Suggested implementation prompt:
41
+
- "Refactor `src/modules/type-diagnostics.js` to make TypeScript preprocessor parsing (`preProcessFile`) the source of truth for declaration graph discovery in the lazy React type loader. Keep current CDN fallback and lazy hydration semantics. Ensure references from comments are ignored, `*.d.ts`/relative path handling is correct, and candidate fetch ordering minimizes noisy failed requests. Add regression coverage for `global.d.ts` and commented `./user-context` examples. Validate with `npm run lint`, `npm run build:esm`, and targeted React/typecheck Playwright runs."
0 commit comments