-
Notifications
You must be signed in to change notification settings - Fork 403
chore: (CXSPA-11949) [BEFORE DF] Migration docs for breaking changes #21057
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
Changes from 10 commits
1f2897f
0120bd8
688e7b0
9fa4ec5
d32a2e5
8f9c987
7cd9be8
86047bf
5eeb0c5
30cbb10
e22886a
c8f56de
69499f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Breaking Changes | ||
| --- | ||
|
|
||
| ## Removed Constants | ||
| - **`USER_CMS_ENDPOINTS`** (from `projects/core/src/model/cms.model.ts`): | ||
| - **Impact:** This feature toggle constant has been removed. The functionality is now always enabled. | ||
| - **Action Required:** Remove any references to this constant in your code. The CMS adapters now always use user-specific endpoints. | ||
|
|
||
|
|
||
| - **`SMART_EDIT_DUMMY_COMPONENT_TYPE`** (from `projects/core/src/cms/config/cms-config.ts`): | ||
| - **Impact:** This constant was unused since version 6.5. The `SmartEditLauncher` is now responsible for triggering the lazy loading of the `SMART_EDIT_FEATURE`. | ||
| - **Action Required:** Remove any references to this constant if you were using it. | ||
|
|
||
| ### `cart-proceed-to-checkout.component.ts` | ||
| - **Constructor Cleanup**: Removed the deprecated constructor overload `constructor(router: Router)`. | ||
| - **Action Required**: Any classes extending this component must now provide both `Router` and `ChangeDetectorRef` (optional) in the `super()` call. | ||
|
|
||
| ### `store-finder-stores-count.component.ts` | ||
| - **Required Dependency**: `RoutingService` is no longer optional. The `@Optional()` decorator and `inject` optional flag were removed. | ||
| - **Action Required**: Ensure `RoutingService` is available in the injection context where this component is used. | ||
|
|
||
| ### `default-cms-config.ts` | ||
| - **Config Consolidation**: Removed `defaultUserCmsModuleConfig`. | ||
| - **Breaking Impact**: `defaultCmsModuleConfig` was updated to include the configuration that was previously only in `defaultUserCmsModuleConfig`. If you were specifically relying on the old structure of `defaultCmsModuleConfig` (without the `/users/{userId}` defined as it is now), this may affect CMS request building. | ||
|
|
||
| ### `occ-cms-component.adapter.ts` | ||
| - **Feature Toggle Removal**: Removed all logic related to the `USER_CMS_ENDPOINTS` feature toggle. | ||
| - **Behavior Change**: The adapter now **always** uses the `userIdService` to determine the current user and builds the component request URL accordingly. | ||
| - **API Cleanup**: Removed usage of `FeatureConfigService`. | ||
| - **Outcome**: | ||
| - All CMS component requests now consistently include user context in the endpoint URL. | ||
| - Endpoint format is now standardized: `/users/{userId}/cms/components` is always used instead of the legacy `/cms/components` format. | ||
|
|
||
| ### `occ-cms-page.adapter.ts` | ||
| - **Feature Toggle Removal**: Removed all logic related to the `USER_CMS_ENDPOINTS` feature toggle. | ||
| - **Behavior Change**: Similar to the component adapter, it now always fetches the user ID to build CMS page request URLs. | ||
| - **API Cleanup**: Removed usage of `FeatureConfigService`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This comment applies to all similar places.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re-checked. all places. In this case it was protected. |
||
| - **Outcome**: | ||
| - All CMS page requests now consistently include user context in the endpoint URL. | ||
| - The conditional branching based on `USER_CMS_ENDPOINTS` feature flag has been eliminated, simplifying the code path. | ||
| - Endpoint format is now standardized: `/users/{userId}/cms/pages` is always used instead of the legacy `/cms/pages` format. | ||
| - This ensures personalized CMS content is consistently served based on the authenticated or anonymous user context. | ||
|
|
||
|
|
||
| ### `search-box.component.ts` | ||
| - **Required Dependencies**: `BreakpointService` and `ChangeDetectorRef` are no longer optional. | ||
| - **Action Required**: Ensure these services are available in the injector. | ||
| - **API Removal**: Removed `isEnabledFeature(feature: string)` method and the `FeatureConfigService` dependency. | ||
| - **Property Rename**: `changeDetecorRef` was renamed to `changeDetectorRef` (fixing a typo) and made `protected`. | ||
| - **Action Required**: Update any references in subclasses to the new spelling `changeDetectorRef`. | ||
|
|
||
| ### `cms-routes-impl.service.ts` | ||
| - **Refactored Guard Handling**: The `wrapCmsGuard` method no longer uses `CmsGuardsService.canActivateGuard` (which was removed). | ||
| - **New Dependencies**: Now uses `GuardsComposer` and `UnifiedInjector` to resolve and execute guards. | ||
| - **Internal Change**: This change primarily affects how Spartacus internally handles CMS-driven routes and guards, ensuring better support for both class-based and functional guards (`CanActivateFn`). | ||
|
|
||
| ### `ng-select-a11y.directive.ts` | ||
| - **Method Removal**: Removed deprecated `onOpen()` and `appendAriaLabelToOptions()` methods. | ||
| - **Method Removal**: Removed `customizeNgSelectAriaLabelDropdown()` method. | ||
| - **Breaking Impact**: If you were overriding or calling these deprecated methods in a custom directive extending this one, your code will fail to compile. | ||
|
|
||
| ## Removed Methods & APIs | ||
|
|
||
| #### `CmsGuardsService` | ||
| - **Removed Method:** `canActivateGuard(guardClass: any, route: CmsActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<GuardResult>` | ||
| - **Reason:** Deprecated in favor of `GuardsComposer`. | ||
| - **Action Required:** Use the `GuardsComposer` service to execute guards manually if needed. | ||
|
|
||
| ### `unit-address-item.service.ts` | ||
| - **Dependency Removal**: Removed `protected featureConfigService` with `optional: true` flag. | ||
| - **Feature Flag Removal**: Removed logic related to the `fixMyCompanyUnitAddressCreation` feature flag. | ||
| - **Breaking Impact**: Custom services extending this class that relied on `protected` access to `featureConfigService` will encounter compilation errors. | ||
| - **Action Required**: If feature configuration is needed in a subclass, inject `FeatureConfigService` directly within that subclass as a `private` property. | ||
|
|
||
| ### `org-unit.effect.ts` | ||
| - **Dependency Removal**: Removed `protected featureConfigService` with `optional: true` flag. | ||
| - **Feature Flag Removal**: Removed logic related to the `fixMyCompanyUnitAddressCreation` feature flag in the address creation success action. | ||
| - **Breaking Impact**: The effect now always uses the simplified address creation response format (`{ id: payload.address.id }`). | ||
| - **Action Required**: Ensure any custom effects extending this class do not rely on the removed `featureConfigService` property. | ||
|
|
||
| ## Global Changes | ||
|
|
||
| #### `FeatureConfigService` Visibility Refactor | ||
| - **Change**: The `FeatureConfigService` (often injected as `featureConfigService` or `featureConfig`) has been made **private** across all Spartacus components and services. | ||
| - **Impact**: Any custom classes extending Spartacus components or services that relied on `protected` access to `FeatureConfigService` will now encounter compilation errors. | ||
| - **Action Required**: Subclasses should no longer rely on the base class's `FeatureConfigService`. If feature configuration is needed in a subclass, it should be injected directly within that subclass. | ||
|
|
||
| --- | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Hey Stan,
Only now I realized that using the name
feature togglefor this DI injection token, could be confusing from the customers' perspective, because officially we use the namefeature togglefor all toggles listed here:spartacus/projects/core/src/features-config/feature-toggles/config/feature-toggles.ts
Line 11 in aa75b93
What do you think about changing
feature toggleto config? If you aggree, then it's needed to change it in all references toUSER_CMS_ENDPOINTSin this doc.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.
absolutely agree. Updated.