Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Jul 30, 2025

Summary by CodeRabbit

  • Refactor

    • Updated navigation to use static imports for all screen components instead of dynamic lazy loading. This change affects various areas including development, passport, prove, recovery, settings, and onboarding screens. No changes to navigation structure or user experience.
  • Chores

    • Removed an outdated comment from the main application file.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

This change removes all React.lazy-based dynamic imports for navigation screen components across several navigation modules, replacing them with static imports. Additionally, a CI/CD test comment is deleted from the application entry file. No functional code, logic, or exported entity signatures are altered.

Changes

Cohort / File(s) Change Summary
CI/CD Comment Removal
app/App.tsx
Removed a single CI/CD test comment line from the top of the file.
Aesop Navigation Static Imports
app/src/navigation/aesop.ts
Converted PassportOnboardingScreen import from dynamic lazy() to static import.
Dev Navigation Static Imports
app/src/navigation/dev.ts
Replaced all dynamic lazy() imports for dev screens with static imports; removed lazy import from React.
Passport Navigation Static Imports
app/src/navigation/passport.ts
Replaced all dynamic lazy() imports for passport screens with static imports; removed lazy import.
Prove Navigation Static Imports
app/src/navigation/prove.ts
Replaced all dynamic lazy() imports for prove screens with static imports; removed lazy import.
Recovery Navigation Static Imports
app/src/navigation/recovery.ts
Replaced all dynamic lazy() imports for recovery screens with static imports; removed lazy import.
Settings Navigation Static Imports
app/src/navigation/settings.ts
Replaced all dynamic lazy() imports for settings screens with static imports; removed lazy import.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant Navigation
    participant ScreenComponent

    App->>Navigation: Initialize navigation stack
    Navigation->>ScreenComponent: Import screen statically (at startup)
    App->>Navigation: Navigate to Screen
    Navigation->>ScreenComponent: Render component immediately
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

codex

Poem

Screens once loaded on demand,
Now march in, statically planned!
No more lazy waits in sight,
Navigation’s future is bright.
A comment is gone—so clean and neat,
Code review’s task is now complete!
🚀✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin/chore-fix-web-building-and-loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/src/navigation/settings.ts (1)

5-9: Static imports fix the web build but regress mobile startup performance

Eagerly importing every settings screen guarantees the bundler has no trouble on the web, but it also eliminates the code-splitting advantage we previously had with React.lazy, so all five screens now inflate the baseline JS bundle and memory footprint on iOS/Android.

A compromise worth considering:

import { Platform } from 'react-native';
import * as React from 'react';

const CloudBackupScreen =
  Platform.OS === 'web'
    ? require('../screens/settings/CloudBackupScreen').default
    : React.lazy(() => import('../screens/settings/CloudBackupScreen'));

Apply the same pattern for the other screens. This keeps the web build green while preserving deferred loading on native platforms.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1892cf7 and 01a0279.

⛔ Files ignored due to path filters (1)
  • app/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • app/App.tsx (0 hunks)
  • app/src/navigation/aesop.ts (1 hunks)
  • app/src/navigation/dev.ts (1 hunks)
  • app/src/navigation/passport.ts (1 hunks)
  • app/src/navigation/prove.ts (1 hunks)
  • app/src/navigation/recovery.ts (1 hunks)
  • app/src/navigation/settings.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/App.tsx
🧰 Additional context used
📓 Path-based instructions (1)
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit Configuration File

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/navigation/prove.ts
  • app/src/navigation/recovery.ts
  • app/src/navigation/dev.ts
  • app/src/navigation/aesop.ts
  • app/src/navigation/passport.ts
  • app/src/navigation/settings.ts
🧠 Learnings (1)
app/src/navigation/dev.ts (1)

Learnt from: transphorm
PR: #795
File: app/android/app/build.gradle:157-158
Timestamp: 2025-07-29T01:08:28.530Z
Learning: For this React Native project, the team prefers build flexibility over fail-fast behavior for release builds in app/android/app/build.gradle. They intentionally allow fallback to debug signing for local development runs, relying on Google Play Console validation to catch any improperly signed releases during upload.

⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: build
🔇 Additional comments (5)
app/src/navigation/prove.ts (1)

5-9: LGTM: Static imports resolve web build issues effectively.

The conversion from React.lazy dynamic imports to static imports aligns well with the PR objective of fixing web building and loading. This approach ensures all prove screens are bundled upfront, eliminating potential code-splitting issues in web environments.

Trade-off consideration: While this increases the initial bundle size, it provides more predictable loading behavior and resolves the build issues you're addressing.

app/src/navigation/recovery.ts (1)

5-10: Consistent refactoring approach approved.

The static import conversion for recovery screens follows the same pattern as other navigation files. Given that recovery screens often form a sequential flow, bundling them together makes logical sense and aligns with the web build fix objective.

app/src/navigation/dev.ts (1)

5-9: Static imports particularly beneficial for dev screens.

Converting dev screens to static imports is especially appropriate since these screens are typically used together during development and debugging. This eliminates unnecessary lazy loading complexity in the development environment while maintaining consistency with the overall refactoring approach.

app/src/navigation/passport.ts (1)

5-11: Logical grouping of passport flow screens.

The static import approach works well for passport screens since they represent a cohesive user flow (scanning → NFC → troubleshooting). Bundling these related screens together improves the user experience by ensuring immediate availability during the passport verification process.

app/src/navigation/aesop.ts (1)

7-7: Static import maintains feature flag functionality.

The conversion to static import works well here since the conditional logic in getAesopScreens() still controls whether the screen appears in navigation, while the static import ensures the component is available when the feature flag is enabled. This maintains the intended feature flag behavior while resolving build issues.

@transphorm transphorm merged commit bf158fd into dev Jul 30, 2025
12 checks passed
@transphorm transphorm deleted the justin/chore-fix-web-building-and-loading branch July 30, 2025 19:57
transphorm added a commit that referenced this pull request Jul 30, 2025
transphorm added a commit that referenced this pull request Jul 31, 2025
* Revert "fix yarn web (#814)"

This reverts commit bf158fd.

* Revert "add hermes ios engine"

This reverts commit f6defcf.

* Revert "codex feedback"

This reverts commit df35a47.

* Revert "merge with dev"

This reverts commit 47a8d9d.

* Revert "update Gemfile.lock and remove lock when reinstalling"

This reverts commit 5f25752.

* Revert "test package update"

This reverts commit 19dcba0.

* Revert "revert install cmd changes"

This reverts commit 5427bd1.

* Revert "Fix CI build by excluding nokogiri in GitHub Actions/Act environments"

This reverts commit dbff69a.

* Revert "prettier"

This reverts commit 87f4214.

* Revert "fix building"

This reverts commit fbbefd2.

* Revert "optimize path resolving"

This reverts commit 23b1118.

* Revert "fix loading"

This reverts commit f0c884b.

* Revert "clean up dupe bundle install"

This reverts commit 5428567.

* Revert "fix metro loading"

This reverts commit 3a76600.

* Revert "remove passport provider lazy loading"

This reverts commit 5f793a5.

* Revert "allow cursor to edit Gemfile and update lock file"

This reverts commit b6f7158.

* Revert "Update Gemfile.lock to exclude nokogiri in CI environments"

This reverts commit 2436401.

* Revert "fix install commands"

This reverts commit 2dc7d7c.

* Revert "fix imports and test"

This reverts commit 83d6308.

* Revert "fix import"

This reverts commit fa42b07.

* Revert "update build checks"

This reverts commit b281f15.

* Revert "save updated imports"

This reverts commit 215bca4.

* Revert "fix build command"

This reverts commit 37f95bc.

* Revert "build dependencies before linting"

This reverts commit 9e57e01.

* Revert "lint suggestions"

This reverts commit ff9b9d2.

* Revert "fix type. more opportunities"

This reverts commit 7ad82d5.

* Revert "add typing to crypto loader"

This reverts commit d55eec8.

* Revert "yarn nice"

This reverts commit df1c2db.

* Revert "update lock"

This reverts commit 04692ba.

* Revert "cm feedback"

This reverts commit 848071f.

* fix file name

* fix web loading

* fix border width styling

* fix package commands

* fix import and update lock

* fixes from reverted commits

* more fixes for web building

* fix yarn web:build

* add yarn web:build workflow

* cm feedback

* final fixes

* fix for and vitge

* fix loading
@coderabbitai coderabbitai bot mentioned this pull request Aug 23, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 8, 2025
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