Skip to content

build: rebundle the example when library sources change - #10

Merged
janicduplessis merged 1 commit into
mainfrom
@janic/bundle-inputs
Sep 21, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
@janic/bundle-inputs

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

assembleRelease embeds the JS bundle through the React Native Gradle plugin's createBundle<Variant>JsAndAssets task. That task's source input tree is rooted at the app root, which is example/ (BundleHermesCTask.kt). In this hoisted pnpm workspace the library sources live at the repository root, so a change under src/ leaves the task UP-TO-DATE and the previous bundle ships.

The Android e2e check builds the release variant, so it could pass against stale library code; the worklets crash fix in #9 first looked green for exactly this reason.

Solution

Register src/ as an additional input of the bundle tasks in the example build.gradle, with relative path sensitivity so the cache key does not depend on the checkout location. The plugin's own tree still covers the example sources.

Test plan

./gradlew :app:createBundleReleaseJsAndAssets from example/android, appending a comment to src/index.tsx between runs:

  • Without this change, the task reports UP-TO-DATE after the library change.
  • With this change, the task executes after the library change and reports UP-TO-DATE when nothing changed.

@janicduplessis
janicduplessis marked this pull request as ready for review September 21, 2026 13:18
@janicduplessis
janicduplessis merged commit 7fe266c into main Sep 21, 2026
3 checks passed
@janicduplessis
janicduplessis deleted the @janic/bundle-inputs branch September 21, 2026 13:18
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