Skip to content

ci: test cache#29511

Open
tommasini wants to merge 6 commits intorn-upgrade/0.81.5-no-unit-testsfrom
chore/build-e2e-rn-update-81
Open

ci: test cache#29511
tommasini wants to merge 6 commits intorn-upgrade/0.81.5-no-unit-testsfrom
chore/build-e2e-rn-update-81

Conversation

@tommasini
Copy link
Copy Markdown
Contributor

@tommasini tommasini commented Apr 29, 2026

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Adds a global Babel transform that rewrites all import() calls, which can affect runtime module loading semantics if any code relies on native dynamic-import behavior. UI import cleanups are low risk, but the build-step change impacts the entire bundle.

Overview
Prevents Hermes builds from failing on parser-fatal dynamic import() by adding an inlined Babel visitor that rewrites import(x) to Promise.resolve().then(() => require(x)).

Cleans up UI code to import Spinner directly from @metamask/design-system-react-native (and updates the affected Perps toast test mocks accordingly), removing usage of the separate @metamask/design-system-react-native/spinner entrypoint.

Reviewed by Cursor Bugbot for commit 6307cc3. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-platform Mobile Platform team label Apr 29, 2026
@tommasini tommasini added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label Apr 29, 2026
@andrepimenta andrepimenta requested review from a team as code owners April 29, 2026 19:08
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 58245c7. Configure here.

Hermes (RN's bytecode compiler) does not accept dynamic `import()` syntax —
even inside dead code branches — and aborts the bytecode compile with
"Invalid expression encountered". When that happens during the Xcode
"Bundle JS Code & Upload Sentry Files" phase, the .app ends up without a
main.jsbundle and crashes immediately on launch (Detox sees
FBSOpenApplicationServiceErrorDomain code=3 / SBMainWorkspace denials).

Two known sources currently trip this:
- PerpsController.ts uses `import(/* webpackIgnore */ myxModulePath)` for
  extension/webpack tree-shaking. The mobile build doesn't need code
  splitting, but the syntax is fatal for Hermes regardless of runtime path.
- lilconfig (transitive via tailwindcss/postcss-load-config) does the same
  in its dynamicImport loader.

Add a tiny inline Babel visitor that rewrites every `import(x)` →
`Promise.resolve().then(() => require(x))`, mirroring
babel-plugin-dynamic-import-node. Inlined to avoid a new dependency. Runs
across user code AND node_modules (Metro applies babel transforms there
too), so PerpsController.ts can stay bit-identical with the extension
sync, and lilconfig needs no shim.

Verified end-to-end locally: Metro bundles cleanly, Hermes compile exits 0,
85 MB main.hbc produced.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Failed
The fixture validation job failed. Review the logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants