Skip to content

Migrate store locator from feature branch to develop#2542

Merged
kevinxh merged 26 commits intodevelopfrom
next-store-locator
Jun 10, 2025
Merged

Migrate store locator from feature branch to develop#2542
kevinxh merged 26 commits intodevelopfrom
next-store-locator

Conversation

@kevinxh
Copy link
Contributor

@kevinxh kevinxh commented Jun 10, 2025

Description

As we were exploring enhancing extensibility for PWA Kit, we experimented using the store locator as a standalone feature that can be optionally toggled/installed. It also gives us an opportunity to write modular code and split business logic from UI components.

In this PR, we are merging the optimized version back to develop branch.

CleanShot 2025-06-09 at 17 14 37

CleanShot 2025-06-09 at 17 19 03

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

How to Test-Drive This PR

  • npm start
  • click the store locator icon on the header
  • go to localhost:3000/store-locator
  • check the feature works

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@kevinxh kevinxh requested a review from a team as a code owner June 10, 2025 00:22
@kevinxh kevinxh added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Jun 10, 2025
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jun 10, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this file from the template-typescript-minimal project as I'm introducing typescript files to the retail react app.

countryCode: 'DE',
countryName: 'Germany'
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

How are the supported countries determined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The demo instance is set up to have these demo stores. We expect customers to change these values.

export const STORE_LOCATOR_DEFAULT_COUNTRY = 'DE'
export const STORE_LOCATOR_DEFAULT_COUNTRY_CODE = 'DE'
export const STORE_LOCATOR_DEFAULT_PAGE_SIZE = 10
export const STORE_LOCATOR_NUM_STORES_PER_REQUEST_API_MAX = 200 // This is an API limit and is therefore not configurable
Copy link
Contributor

Choose a reason for hiding this comment

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

These values seems to be configs, and we expect customers to tweak them? If so, can we rename them to config.js?

Copy link
Contributor

@bfeister bfeister Jun 10, 2025

Choose a reason for hiding this comment

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

Same comment as here #2542 (comment) ... my expectation is that since this V3 template is an upstream dependency for projects we want to avoid these kinds of big changes with only small value being provided since they will break customer implementations until the time when extensibility is removed altogether in V4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree these are more of configs rather than constants. But I'm trying to avoid introducing new patterns in this PR. We can discuss how we want to make it easier to configure features in a separate discussion.

@@ -135,11 +155,13 @@ export const TestProviders = ({
fetchedToken={bypassAuth ? (isGuest ? guestToken : registerUserToken) : ''}
>
<CurrencyProvider currency={DEFAULT_CURRENCY}>
Copy link
Contributor

Choose a reason for hiding this comment

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

@bfeister and I talked about combining IntlProvider and CurrencyProvider - the latter is a part of the former and I don't see a need to have them seperated.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kzheng-sfdc I didn't realize we wanted to backport quite that much to V3. If we open the floodgates to that category of change (provider re-structure) there will be many more, but I'm not sure they provide value yet just because customers will see them as large + breaking changes that compete with the value add of the new functionality (the main thing they're after).

Open to being wrong about that

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah let's hold off on making these breaking changes. I am just pointing out the TODOs for future v4 work.

@bfeister
Copy link
Contributor

Pending discussion with @kzheng-sfdc this looks good to me 👍

@kevinxh kevinxh merged commit 79af6fc into develop Jun 10, 2025
35 checks passed
@kevinxh kevinxh deleted the next-store-locator branch June 10, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants