-
Notifications
You must be signed in to change notification settings - Fork 326
Add support for deployed custom B2B Buyer Portal based on env vars #2626
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
base: integrations/b2b-makeswift
Are you sure you want to change the base?
Add support for deployed custom B2B Buyer Portal based on env vars #2626
Conversation
|
|
@CNanninga is attempting to deploy a commit to the BigCommerce Platform Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment, and then one smaller nitpick to consider. After that, this will look good from my end 👍
|
Ready for re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - some minor comments / questions.
| const hashIndex = null; | ||
| const hashIndexLegacy = null; | ||
| const hashPolyfills = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea that the hashes are hard coded - so that they can be versioned through the code?
I guess that would make it easier if you open a PR - you can test out the custom build without having to change env vars for that branch alone.
| const hashIndex = null; | |
| const hashIndexLegacy = null; | |
| const hashPolyfills = null; | |
| const hashIndex: string | null = null; | |
| const hashIndexLegacy: string | null = null; | |
| const hashPolyfills: string | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matt and I had some discussion about this, and for now it didn't seem like it was worthwhile to represent these as environment vars. What we expect to be a common workflow is for devs to deploy their custom Buyer Portal build files with Catalyst (as static files in public), so a new code deployment is commonly needed anyway. (And having the hashes in env vars actually means a code re-deploy and then another re-deploy after updating vars.)
What I opted to do instead was just separate them out very conspicuously in this file.
What/Why?
Using the B2B Buyer Portal in a headless storefront can involve loading the Buyer Portal assets from one of three sources:
Each has a different set of scripts.
Catalyst currently 1 and 2, conditionally including the right loader scripts based on the presence or absence of
LOCAL_BUYER_PORTAL_HOST. What's needed is support for 3.This PR introduces an env var for the base URL of the deployed custom Buyer Portal and introduces a third loader style that incorporates this.