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

Remove dependency on App Bridge React and update navigation patterns and components #203

Merged
merged 1 commit into from
May 16, 2024

Conversation

devisscher
Copy link
Contributor

@devisscher devisscher commented Apr 18, 2024

What problem is this PR solving?

Fixes: #196

Breaking change - major version release

This PR removes dependency on App Bridge React. In App Bridge React V4+ the utilities for navigation and opening modals are no longer needed. The preferred way is to leverage App Bridge React methods within you app.

Consequences of this change:

  • HelpText was removed
  • AppBridgeLink was removed
  • The combination card was simplified to avoid opening the DiscountCombinationModal in web, which is not possible anymore
    • If a developer wants to show the possible combining discounts, they will need to create a modal within their app instead of spawning the DiscountCombinationModal in web, from their app.

Reviewers’ hat-rack 🎩

To tophat this change you'll need to do the following:

Testing in app context:

On your local machine:

  1. shopify app init --template https://github.com/Shopify/function-examples/sample-apps/discounts\#update-discounts-app --package-manager yarn
  2. Clone the discount-app-components repository onto your local machine in a different folder.
  3. Run yalc publish --private
  4. In the folder for the app you created in step 1 run: yalc add @shopify/discount-app-components
  5. Then run yarn to install dependencies
  6. Then run yarn dev to test your app out on your store
  7. Ensure the volume discount page is properly rendered.

Testing storybook

  1. Clone this repo
  2. Run yarn && yarn storybook
  3. Check that all components render properly in Storybook

Before requesting reviews

Before you deploy

Warning
With every PR, you MUST think through each of the items in the following checklist and check the appropriate ones. This step cannot be overlooked by the PR author or its reviewers. Please remove this warning when you're done.

  • This PR is safe to rollback.
  • I tophatted this change on Storybook.

@devisscher devisscher changed the title Update app bridge react Remove dependency on App Bridge React and update navigation patterns and components Apr 18, 2024
@devisscher devisscher marked this pull request as ready for review April 18, 2024 16:39
@devisscher
Copy link
Contributor Author

devisscher commented Apr 18, 2024

This is part of: https://github.com/Shopify/core-issues/issues/68945

@devisscher devisscher requested a review from jharlap April 18, 2024 20:15
@jharlap jharlap requested review from mathiusj and removed request for jharlap May 1, 2024 13:42
Copy link
Contributor

@mathiusj mathiusj left a comment

Choose a reason for hiding this comment

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

have 🎩'd and reviewed code changes which LGTM, just left a comment to track the removal of the yalc.lock file 🙏

yalc.lock Outdated
@@ -0,0 +1,9 @@
{
Copy link
Contributor

@mathiusj mathiusj May 13, 2024

Choose a reason for hiding this comment

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

will just need to remove this file before shipping

@devisscher devisscher merged commit 8d15cc1 into main May 16, 2024
4 checks passed
@devisscher devisscher deleted the update-app-bridge-react branch May 16, 2024 12:10
@thosakwe
Copy link

Thanks for making this change! It will unblock migration to App Bridge v4 for many discount apps.

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.

🐛[Bug] Support for @shopify/app-bridge-react V4
3 participants