feat: bring lazy platform compilation to Rspack - #1430
Conversation
# Conflicts: # apps/tester-app/ios/Podfile.lock
🦋 Changeset detectedLatest commit: c6a2573 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@jbroma is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
| this.buildStartTime[platform] = Date.now(); | ||
|
|
||
| if (platform === 'android') { | ||
| void runAdbReverse({ |
There was a problem hiding this comment.
I noticed we calling runAdbReverse in watchRun so basically ADB system command on every file save, I know it was before this PR but since we refactoring this parte maybe we could move it outside watchRun or add some debounce (30 seconds) to prevent ADB spam on rapid saves
There was a problem hiding this comment.
hey @bartekkrok nice catch! It has been that way for a while to ensure smoother dev experience, I'd leave it as it is in this PR but this is definitely something that can be improved, although the gains are almost non-existent in this case - adb happily accepts that spam and this generates no performance overhead in reality.
bartekkrok
left a comment
There was a problem hiding this comment.
I reviewed this and everything looks fine for me. Good job
# Conflicts: # packages/repack/src/commands/rspack/Compiler.ts
Summary
Bring the Rspack development experience to parity with Webpack by compiling each configured platform only when its bundle is first requested.
Developer wins
How it works
Rspack starts every child compiler in a multi-compiler eagerly. Re.Pack now holds each child compiler at its initial watch run and releases it on the first bundle request for that platform. The watcher timestamps are refreshed when a gate is released to prevent the deferred compiler from treating changes made during startup as a second, phantom rebuild.
Unsupported platforms fail immediately instead of leaving requests pending. The implementation also tracks compilation, assets, stats, and request resolvers per platform.
Validation