Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplify routing logic [Part 1] #11178

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

MounirDhahri
Copy link
Member

@MounirDhahri MounirDhahri commented Nov 22, 2024

Description

Now we are getting to the parts that matter. In this PR I am suggesting an incremental step to our Appregistry modules to help us move towards a more common definition for our modules.

I wanted to keep this PR's context small so I am making tiny changes here: (The PR looks big but it's actually the same change many times)

  • Update reactModule function to accept a single argument (as a subject) instead of multiple arguments
    So instead of reactModule(Component, ViewOptions, Queries), we will have reactModule({Component, options, Queries }). This will help us avoid cases like reactModule(Component, {}, Quries)
  • Align logic to hide and show headers.
    This change will help us avoid maintaining 2 props and rely on the default option that comes from react-navigation.
    Reasoning: https://github.com/artsy/eigen/blob/main/src/app/Navigation/Utils/isHeaderShown.tsx

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

  • simplify routing logic [Appregistry.tsx] - mounir

Need help with something? Have a look at our docs, or get in touch with us.

@MounirDhahri MounirDhahri self-assigned this Nov 22, 2024
@MounirDhahri MounirDhahri force-pushed the feat/simplify-screens-registering branch from 68301ce to 2f34cca Compare November 25, 2024 11:21
@MounirDhahri MounirDhahri marked this pull request as ready for review November 25, 2024 11:26
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Nov 25, 2024

This PR contains the following changes:

  • Dev changes (simplify routing logic [Appregistry.tsx] - mounir - MounirDhahri)

Generated by 🚫 dangerJS against f37717a

Copy link
Member

@gkartalis gkartalis left a comment

Choose a reason for hiding this comment

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

looking good! Thanks

@MounirDhahri MounirDhahri merged commit d0dbfb6 into main Nov 25, 2024
5 of 7 checks passed
@MounirDhahri MounirDhahri deleted the feat/simplify-screens-registering branch November 25, 2024 14:08
Component,
options = {},
Queries,
}: {
Copy link
Member

Choose a reason for hiding this comment

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

Object props FTW

WorksForYou: reactModule({
Component: WorksForYouQueryRenderer,
Queries: [WorksForYouScreenQuery],
}),
Copy link
Member

Choose a reason for hiding this comment

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

so much nicer!

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.

4 participants