Skip to content

fix(repack): run build steps serially to avoid wiping declarations - #1496

Merged
dannyhw merged 1 commit into
mainfrom
fix/repack-build-race
Oct 10, 2026
Merged

dannyhw merged 1 commit into
mainfrom
fix/repack-build-race

Conversation

@dannyhw

@dannyhw dannyhw commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

packages/repack ran build:js (Babel with --delete-dir-on-start) and build:ts (tsc --emitDeclarationOnly) in parallel. If Babel started slowly, for example while turbo was building other packages, its delete could land after tsc had already written some .d.ts files. Dependent packages then failed with TS7016: Could not find a declaration file for module '@callstack/repack' (seen in repack-expo and plugin-reanimated).

The two steps now run one after the other. tsc takes most of the build time, so running Babel alongside it saved little. Measured on a cold build: ~1.7s in parallel vs ~3.4s serially, and turbo caches the result.

Test plan

  • pnpm turbo run build --force passes with packages/repack/dist/index.d.ts present

build:js and build:ts ran in parallel, and babel's --delete-dir-on-start
could wipe declaration files tsc had already written when babel started
slowly (e.g. under turbo load), breaking dependent package builds with
TS7016. Run them one after the other; tsc dominates the build time, so
this costs roughly a second or two on a cold build.
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
repack-website Ready Ready Preview Oct 10, 2026 11:43am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b2afd34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dannyhw
dannyhw merged commit 1dd17f6 into main Oct 10, 2026
10 checks passed
@dannyhw
dannyhw deleted the fix/repack-build-race branch October 10, 2026 11:44

This branch was successfully deployed

1 active deployment
Preview — b2afd340 Deployed Oct 10, 2026 by vercel[bot]
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