-
Notifications
You must be signed in to change notification settings - Fork 460
feat(expo): let native components keep their own chrome when embedded #9121
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8e98c2b
feat(expo): add embedded navigation mode to native components
mikepitre 26a68b3
fix(expo): pop hosted routes on dismiss
mikepitre d1497e8
refactor(expo): rename embedded navigation and unify iOS bridge
mikepitre 79d65a9
fix(expo): add metro-compatible stub for the native/router entry point
mikepitre 95b21a3
fix(expo): opt in to clerk-android FrameworkIntegrationApi for embedd…
mikepitre 93c371c
fix(expo): resolve HeaderBackButton across expo-router versions and d…
mikepitre 0fb418e
fix(expo): use the route's native back button for embedded navigation
mikepitre 8247da9
feat(expo): let native components keep their own chrome when embedded
mikepitre dde8e41
refactor(expo): collapse embedded navigation to a single onHostBack prop
mikepitre 9029ee7
fix(expo): drop the removed router entry point from the manifest
mikepitre 3429447
fix(expo): remove a stale doc comment left on the bridge
mikepitre 2b1f3f2
fix(expo): restore the lockfile
mikepitre 08ce3f9
Merge branch 'main' into mike/expo-hosted-navigation
wobsoriano 702952c
test: Add maestro flow for hosted navigation
wobsoriano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| '@clerk/expo': minor | ||
| --- | ||
|
|
||
| Support pushing the native `UserProfileView` and `AuthView` onto your app's own navigation stack. | ||
|
|
||
| New optional `onHostBack` prop shows a back button on the component's root screen and calls you when it is tapped. The component keeps its own navigation chrome, so screen titles, back buttons, swipe-back, and transitions inside the component stay native — hide your route's header and pop your route from the callback: | ||
|
|
||
| ```tsx | ||
| <Stack.Screen options={{ headerShown: false }} /> | ||
| <UserProfileView isDismissible={false} onHostBack={() => router.back()} /> | ||
| ``` | ||
|
|
||
| The component never leaves the route on its own, so react to auth state for flow completion — either swap the content in place or pop the route. | ||
|
|
||
| Existing usage is unaffected: the prop is optional, and the components render exactly as before without it. Requires the corresponding clerk-ios and clerk-android SDK releases. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
integration/tests/expo-native/flows/embedded-profile-host-back.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Embedded UserProfileView (onHostBack): internal navigation stays native, | ||
| # and the host-supplied root back button closes the screen from JS. | ||
| appId: com.clerk.exponativebuildfixture | ||
| name: Embedded UserProfileView host back round trip | ||
| --- | ||
| - runFlow: subflows/open-app.yaml | ||
| - tapOn: | ||
| id: 'open-auth-view-button' | ||
| - runFlow: subflows/sign-in-email-password.yaml | ||
| - runFlow: subflows/assert-signed-in.yaml | ||
| - tapOn: | ||
| id: 'open-embedded-profile-button' | ||
| - extendedWaitUntil: | ||
| visible: 'Security' | ||
| timeout: 20000 | ||
| - tapOn: | ||
| text: 'Security' | ||
| - extendedWaitUntil: | ||
| visible: 'Password|Passkeys|Two-step verification|Active devices' | ||
| timeout: 15000 | ||
| # Both back buttons read 'Back' (internal id 'BackButton', host root id | ||
| # 'chevron.backward') but only one exists at a time: this tap pops Clerk's | ||
| # internal stack, the next one is the host chevron firing onHostBack. | ||
| - tapOn: 'Back' | ||
| - extendedWaitUntil: | ||
| visible: 'Security' | ||
| timeout: 15000 | ||
| - tapOn: 'Back' | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'open-embedded-profile-button' | ||
| timeout: 15000 | ||
| - tapOn: | ||
| id: 'sign-out-button' | ||
| - runFlow: subflows/assert-signed-out.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.