Skip to content

[No QA] Split app TypeScript into web and native programs - #99495

Draft
roryabraham wants to merge 3 commits into
mainfrom
rory/tsconfig-cleanup-phase-2
Draft

[No QA] Split app TypeScript into web and native programs#99495
roryabraham wants to merge 3 commits into
mainfrom
rory/tsconfig-cleanup-phase-2

Conversation

@roryabraham

Copy link
Copy Markdown
Contributor

Explanation of Change

Phase 2 of the tsconfig cleanup: typecheck the app as separate web and native programs instead of one mega-program.

  • Add tsconfig.app.web.json (moduleSuffixes: [".web", ""], DOM, RN-web) and tsconfig.app.native.json (moduleSuffixes: [".ios", ".android", ".native", ""], no DOM).
  • Point npm run typecheck at web + native + jest/root + bun + node + VCR. Root tsconfig.json no longer includes src as a mega-program.
  • Move Window / Document / Navigator / env ambients off the native graph (src/types/web, src/types/app, types/env.d.ts).
  • Keep Metro NodeRequire on both app programs. ESLint src/** uses the web project; native-suffixed files use the native project. no-restricted-globals bans jest / describe / it / test / expect in src/**.

Fixed Issues

$ #99287

Tests

CI only.

  1. Run npm run typecheck and verify it checks tsconfig.app.web.json, tsconfig.app.native.json, tsconfig.json, tsconfig.bun.json, tsconfig.node.json, and VCR.
  2. Confirm a document / window use in a .native.ts file is a type error under tsconfig.app.native.json.
  3. Confirm src/** ESLint uses the web project and reports jest / describe / it / expect as restricted globals.
  • Verify that no errors appear in the JS console

Offline tests

n/a

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms (not applicable: tooling-only change)
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (not applicable: tooling-only change)
  • I followed proper code patterns (see Reviewing the code)
  • I verified that comments were added to code that is not self explanatory
  • I verified that any new or modified comments were clear, correct English, and explained why the code was doing something instead of only explaining what it was doing.
  • I added unit tests for the changed generator behavior

Screenshots/Videos

Not applicable: tooling-only change.

Phase 2 of the tsconfig cleanup: typecheck src as separate web (DOM +
.web suffixes) and native (no DOM + ios/android/native suffixes)
projects instead of one mega-program. Move Window/Document/env ambients
off the native graph, point ESLint src/** at the web project, and
restrict Jest globals in app code.
@melvin-bot

melvin-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONFIG.ts 83.87% <100.00%> (ø)
...nchorForCommentsOnly/BaseAnchorForCommentsOnly.tsx 94.59% <100.00%> (ø)
...uggestions/AutoCompleteSuggestionsPortal/index.tsx 0.00% <ø> (ø)
...c/components/DragAndDrop/Consumer/index.native.tsx 100.00% <100.00%> (ø)
...ningContent/FeatureTrainingContentIllustration.tsx 89.13% <100.00%> (ø)
src/components/FormElement/index.native.tsx 100.00% <ø> (ø)
src/components/FormElement/index.tsx 0.00% <ø> (ø)
src/components/Lottie/index.tsx 81.35% <100.00%> (ø)
src/components/MenuItemGroup.tsx 100.00% <ø> (ø)
...ents/Modal/useSyncModalWithHistory/index.native.ts 100.00% <100.00%> (ø)
... and 66 more
... and 26 files with indirect coverage changes

Drop unused type re-exports from platform index files, restore the
native PopoverProvider no-arg stubs the compiler already accepted,
and rephrase the evals README so cspell does not flag typechecks.
Native typecheck still includes unsuffixed Popover callers that pass
an argument to close/onOpen. Optional params on the type keep those
calls valid; implementations stay no-arg so the React Compiler and
eslint unused-vars stay clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant