Skip to content

Finish ESM transition, move to composite builds, detangle type refs, and re-enable macos PR pipeline#4124

Open
JasonVMo wants to merge 13 commits into
mainfrom
user/jasonvmo/esm
Open

Finish ESM transition, move to composite builds, detangle type refs, and re-enable macos PR pipeline#4124
JasonVMo wants to merge 13 commits into
mainfrom
user/jasonvmo/esm

Conversation

@JasonVMo

@JasonVMo JasonVMo commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • all

Description of changes

This change has a number of things rolled together into one PR as one thing kind of led to another.

Move to ESM

The previous strategy of using module/moduleResolution: "nodenext" doesn't work to esm output on react native because if a module import as an extension (i.e. import { foo } from "myFile.ts";) this will stop both metro and typescript from finding myFile.android.ts or other module suffixes. As a result:

  • module -> "esnext" to get esm output
  • moduleResolution -> "bundler" to enable export maps
  • type -> undefined to allow type imports to handle extensionless importing. (module enables stricter handling)

Composite builds

To speed up builds, and avoid race conditions for the lage builds where the file wasn't fully committed before the next tsgo instance tried to pick it up, I turned on project references and building with tsgo -b.

  • this does an incremental build from any package and when building from the root will build the whole repo at once
  • build time has decreased substantially (<8s on my laptop for the whole repo)
  • noEmit builds are not permitted directly and must be done as builds from solution files.
  • yarn constraints (part of lint-repo) will validate the links are current and update them if necessary
  • references will include any workspace dependencies and any tsconfig.* files under a targets/ directory if present. This allows long-term platform specific type checking per-package and other patterns which would yield a large number of tsconfig files.

Type defragmentation

The massive parallelism of tsgo highlighted places where we were bringing in multiple versions of @types/react into the same package. The main sources were the icons package bringing in a @types/react-native: 0.68 package and the adapters package including rn, rnw, and rn-macos in the same build, each of which have rn -> react -> react types. Resolution in these cases can be order dependent and is a problem, these were all made more explicit.

Re-enable macos pipelines

This also attempts to enable the macos PR builds again as they were turned off in the recent 81 test app changeover.

Verification

"build": "fluentui-scripts build",
"build-cjs": "tsgo --outDir lib-commonjs",
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
"build": "tsgo -b",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was build really nothing e than just ts ?

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.

2 participants