forked from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 110
feat: Lord of the Configs #387
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
Conversation
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
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
…ncy. Enhanced the applyConfigOverrides function to directly update headers based on metadata, simplifying the logic for applying config overrides. Added JSDoc comments for better documentation of functions. Removed unnecessary complexity in getValue function.
…zation. Replaced the previous root path and JSON fetch logic with a simplified configuration object that directly retrieves values using getConfigValue. This enhances clarity and maintainability of the analytics setup.
….json - Introduced a new public configuration section in default-config.json, including endpoints and headers for commerce and analytics. - Updated footer and fragment components to utilize new config functions for improved modularity. - Refactored commerce.js to leverage the new getRootPath function for fetching placeholders. - Enhanced configs.js with isConfigRooted function to streamline root path checks.
…ents for improved accuracy in matching the deepest path.
…tead of window object. This change improves encapsulation and maintains consistency in accessing the root path.
…ites/aem-boilerplate-commerce into one-config-to-rule-them-all
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Co-authored-by: Stephen <sirugh@users.noreply.github.com>
…ions and enhance link decoration logic. Introduced async config retrieval and improved error handling for localized links.
…ites/aem-boilerplate-commerce into one-config-to-rule-them-all
…move unnecessary intercepts. Simplified the test structure by eliminating redundant checks and focusing on session storage updates.
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
Signed-off-by: Stephen Rugh <rugh@adobe.com>
fnhipster
approved these changes
Apr 11, 2025
fnhipster
reviewed
Apr 11, 2025
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Signed-off-by: Stephen Rugh <rugh@adobe.com>
sirugh
commented
Apr 11, 2025
sirugh
commented
Apr 11, 2025
…ialization and error handling. Introduced private state variables for config management, added new utility functions, and updated exports. Updated scripts/scripts.js to initialize configuration on page load.
herzog31
approved these changes
Apr 14, 2025
sirugh
commented
Apr 14, 2025
Signed-off-by: Stephen Rugh <rugh@adobe.com>
Collaborator
|
QA Approved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Configuration was previously a bit confusing. We had
configs,configs-stageandconfigs-dev. This was a bit duplicative.These sheets were used to manage which commerce endpoint your browser would request from. But we conflated Edge Delivery environments (prod/preview) with Commerce environments (prod/stage).
This is no longer the case. Now, regardless of whether you are on
aem.liveoraem.pageorlocalhost, you will use a single config file.This may affect how you work. Now, if you want to connect to a different backend environment your options are:
configentry values orconfig.jsonfile in the root of your code directory, matching the expected JSONAdditionally, if you wish to use this functionality on your own fork, please inspect this code for what changes you might need to apply.
Notable things:
getConfigValue(no longer async, so no need for await).We hope this change reduces confusion and complexity :)
Mulstistore Configuration
The
keyof the public configuration, outsidedefaultbecomes the root path.Example
{ "public": { "default": { "commerce-core-endpoint": "https://www.aemshop.net/graphql", "commerce-endpoint": "https://www.aemshop.net/cs-graphql", "headers": { "cs": { "Magento-Customer-Group": "b6589fc6ab0dc82cf12099d1c2d40ab994e8410c", "Magento-Store-Code": "main_website_store", "Magento-Store-View-Code": "default", "Magento-Website-Code": "base", "x-api-key": "4dfa19c9fe6f4cccade55cc5b3da94f7", "Magento-Environment-Id": "f38a0de0-764b-41fa-bd2c-5bc2f3c7b39a" } }, "analytics": { "base-currency-code": "USD", "environment": "Production", "store-id": 1, "store-name": "Main Website Store", "store-url": "https://www.aemshop.net", "store-view-id": 1, "store-view-name": "Default Store View", "website-id": 1, "website-name": "Main Website" } }, "/drafts/multistore/en/": {}, "/drafts/multistore/en_ca/": { "headers": { "all": { "Store": "en_ca" }, "cs": { "Magento-Store-Code": "ca_store", "Magento-Store-View-Code": "en_ca", "Magento-Website-Code": "ca_website" } }, "analytics": { "base-currency-code": "CAD" } } } }TODO:
After merge:
Test URLs: