Technical Changes in Spartacus 4.0
Note: Spartacus 4.x is no longer maintained. Please upgrade to the latest version.
Note: Spartacus 4.x was tested with SAP Commerce Cloud versions 1905 to 2205. Spartacus 4.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.
Table of Contents
- Config Interface Augmentation
- Detailed List of Changes
- New Checkout Library
- Use Facades Instead of Services
- CostCenterComponent
- DeliveryModeComponent
- PaymentMethodComponent
- PaymentFormComponent
- PaymentTypeComponent
- PlaceOrderComponent
- ReviewSubmitComponent
- ScheduleReplenishmentOrderComponent
- ShippingAddressComponent
- CheckoutEventModule
- CheckoutDeliveryService
- CheckoutState
- AddressVerificationState
- CheckoutPaymentService
- CheckoutService
- PaymentTypeService
- OrderConfirmationItemsComponent
- OccCheckoutAdapter
- OccCheckoutPaymentAdapter
- OccCheckoutCostCenterAdapter
- OccCheckoutDeliveryAdapter
- OccCheckoutPaymentTypeAdapter
- OccCheckoutReplenishmentOrderAdapter
- CheckoutComponentModule
- CheckoutModule
- Complete List of Symbols (Class, Interface, Const) Moved to the Checkout Library
- Breaking Changes Introduced in 4.0
- StoreFinderService
- StoreDataService
- AbstractStoreItemComponent
- StoreFinderListItemComponent
- StoreFinderListComponent
- StoreFinderStoreDescriptionComponent
- GoogleMapRendererService
- ScheduleComponent
- PromotionService
- SavedCartDetailsActionComponent
- SavedCartListComponent
- SavedCartFormDialogComponent
- AddressBookComponentService
- AddressBookComponent
- AddressFormComponent
- UserAddressService
- CheckoutDetailsLoadedGuard
- PaymentDetailsSetGuard
- ShippingAddressSetGuard
- DeliveryModeSetGuard
- AddedToCartDialogComponent
- CartDetailsComponent
- CartItemComponent
- CartItemListComponent
- OrderDetailItemsComponent
- SuggestedAddressDialogComponent
- OrderOverviewComponent
- Qualtrics Changes
- OccConfigLoaderModule
- OccConfigLoaderService
- OccLoadedConfigConverter
- OccLoadedConfig
- OccSitesConfigLoader
- OccEndpoints
- Removal of Grouping Modules
- ViewConfigModule Removed
- EventService
- Changes in the Product Configurator Feature Library
- MessageConfig
- ConfiguratorAttributeDropDownComponent
- ConfiguratorAttributeNumericInputFieldComponent
- ConfiguratorAttributeRadioButtonComponent
- ConfiguratorGroupMenuComponent
- ConfiguratorProductTitleComponent
- ConfiguratorCartService
- CommonConfiguratorUtilsService
- ConfiguratorGroupsService
- ConfiguratorUtilsService
- New and Renamed Dependencies
- LoginRegisterComponent
- NgbTabsetModule
- ASM Changes
- LaunchDialogService
- SavedCartFormLaunchDialogService
- AddToSavedCartComponent
- SavedCartDetailsActionComponent
- SavedCartDetailsOverviewComponent
- AnonymousConsentLaunchDialogService
- AnonymousConsentManagementBannerComponent
- AnonymousConsentOpenDialogComponent
- ReplenishmentOrderCancellationLaunchDialogService
- ReplenishmentOrderCancellationComponent
- OrderHistoryComponent
- OrderReturnRequestListComponent
- ReplenishmentOrderHistoryComponent
- ProductListComponent
- SmartEdit
- Personalization
- WindowRef
- ProductListComponentService
- Product reloading
- Product Variants Changes
- Feature Keys for Product Configurators
- Translations (i18n) changed
- Storage Sync Mechanism
- DefaultScrollConfig
- BaseSiteService
- LanguageService
- CurrencyService
- Page Resolvers
- SelectiveCartService
- DynamicAttributeService
- SearchBoxComponentService
- CartListItemComponent
- Models
- SearchBoxComponent
- Organization Administration Breaking Changes
- Dependencies Changes
- CmsFeaturesService
- ConfigInitializerService
- CartItemComponent
- ProductListItemComponent and ProductGridItemComponent
- CartItemContext and CartItemContextSource
- User Lib Changes
- MyCouponsComponent
- OccUserAdapter
- UserAdapter
- UserConnector
- OccEndpoints
- UserService
- UserModule
- Occ Endpoint Models
- NgRx State of the User Feature
- Connectors
- StoreFinderListItemComponent
- StoreFinderStoresCountComponent
- StoreFinderListItemComponent
- CartItemComponent
- OrderSummaryComponent
- DeliveryModeComponent
- PaymentMethodComponent
- ReviewSubmitComponent
- ShippingAddressComponent
- CmsPageTitleComponent
- CmsBreadcrumbsComponent
- BreadcrumbComponent
- PageTitleComponent
- NavigationUiComponent
- ProductCarouselComponent
- WishListItemComponent
- CardComponent
- CarouselComponent
- AddedToCartDialogComponent
- Translations (i18n) changes
- Default Routing Configuration for the My Company Feature
- LogoutGuard
- RoutingService
- RoutingActions RgRx
- AuthRedirectService
- OccEndpointsService
- Modal Service
- ExternalJsFileLoader
- CxApi
- TabParagraphContainerComponent
- b2cLayoutConfig
- UnitAddressFormService
- GuestRegisterFormComponent
- UserIdService
- PopoverDirective
- PopoverService
- PopoverComponent
- OnNavigateFocusService
- Facade Factories Are Now Inlined
Config Interface Augmentation
Spartacus exposes a lot of methods that accept configuration, and with release 4.0, Spartacus improves the way it types those methods. In previous versions, configurations were often provided with type assertions (such as, provideConfig(<I18nConfig>{i18n: {...}})) to improve type safety and autocomplete functionality.
In version 4.0, Spartacus has changed the way it works with the Config interface, and each feature contributes to this interface using TypeScript module augmentation. As a result, the Config interface now correctly describes all of the configuration options that you can pass to Spartacus.
Furthermore, the type for all methods that accept configuration has been changed from any to Config, and as a result, you no longer need to use type assertion to benefit from better type safety and a better developer experience.
The individual configs still exist (such as, I18nConfig, AsmConfig, AuthConfig, and so on), but all of these interfaces also contribute to the Config interface.
When you need to access a configuration object, you still can by using the following syntax in the constructor:
protected config: AsmConfig
This will only provide hints about the AsmConfig properties, but you now have the option to do it as follows:
protected config: Config
Doing it this way is recommended when you want to access a complete configuration with type safety (for example, FeatureConfig and MediaConfig at the same time).
This change should be seamless for most users, but it will affect you if you have custom configurations in your application.
This can be illustrated by looking at an example with a special configuration for theme:
// existing code
@Injectable({
providedIn: 'root',
useExisting: Config,
})
export abstract class ThemeConfig {
theme?: {
dark?: boolean;
};
}
// Required Changes
// You need to augment the `Config` interface from `@spartacus/core` to be able to
// provide this config with the `provideConfig` method
declare module '@spartacus/core' {
interface Config extends ThemeConfig {}
}
You do not need to change anything in places where you use this config, but anywhere that you declare your custom config, you have to instruct TypeScript that the Config interface also has a theme property with a dark option. Otherwise, TypeScript complains that you are trying to pass properties that are not part of Config.
It is recommended that you make top-level configuration properties optional, so that you can pass the configuration in multiple chunks, and not in a single place.
For more information on module augmentation in Spartacus, see Extending Built-In Models.
Detailed List of Changes
Config providers
- The first parameter of the
provideConfigfunction changed type fromanytoConfig. - The first parameter of the
provideDefaultConfigfunction changed type fromanytoConfig.
ConfigModule
- The parameter of the
withConfigmethod changed type fromobjecttoConfig. - The parameter of the
forRootmethod changed type fromanytoConfig.
Config Injection Tokens
- The
Configinjection token was replaced with an injectableConfigabstract class. - The
ConfigChunkinjection token changed type fromobject[]toConfig[]. - The
DefaultConfigChunkinjection token changed type fromobject[]toConfig[].
StorefrontConfig
This type was removed, as its purpose is now covered with the augmentable Config interface. Replace usage of StorefrontConfig with Config.
ConfigInitializerService
Prior to 4.0, the constructor appeared as follows:
constructor(
@Inject(Config) protected config: any,
@Optional()
@Inject(CONFIG_INITIALIZER_FORROOT_GUARD)
protected initializerGuard,
@Inject(RootConfig) protected rootConfig: any
) {}
The constructor now appears as follows:
constructor(
protected config: Config,
@Optional()
@Inject(CONFIG_INITIALIZER_FORROOT_GUARD)
protected initializerGuard: any,
@Inject(RootConfig) protected rootConfig: Config
) {}
- The
getStablemethod’s return signature has changed fromObservable<any>toObservable<Config>. - The
getStableConfigmethod’s return signature has changed fromPromise<any>toPromise<Config>.
Config Validators
- The
ConfigValidatortype changed from(config: any) => string | voidto(config: Config) => string | void. - The first parameter of the
validateConfigfunction changed fromanytoConfig.
ConfigInitializer
- The
ConfigInitializer.configFactorysignature changed from() => Promise<any>to() => Promise<Config>.
ConfigurationService
- The
unifiedConfig$type changed fromObservable<any>toObservable<Config>. - The
configtype changed fromanytoConfig. -
Prior to 4.0, the constructor appeared as follows:
constructor( @Inject(RootConfig) protected rootConfig: any, @Inject(DefaultConfig) protected defaultConfig: any, protected unifiedInjector: UnifiedInjector, @Inject(Config) config: any ) -
The constructor now appears as follows:
constructor( @Inject(RootConfig) protected rootConfig: Config, @Inject(DefaultConfig) protected defaultConfig: Config, protected unifiedInjector: UnifiedInjector, config: Config )
Feature Config Utils
- The first parameter type of
isFeatureLevelchanged fromunknowntoConfig. - The first parameter type of
isFeatureEnabledchanged fromunknowntoConfig.
MediaService
-
Prior to 4.0, the constructor appeared as follows:
constructor( @Inject(Config) protected config: StorefrontConfig, protected breakpointService: BreakpointService ) {} -
The constructor now appears as follows:
constructor( protected config: Config ) {} -
The
getMediamethod now supports theroleattribute
ModalService
- The
ModalServiceno longer depends on theFeatureConfigService, but theApplicationRefis now a new required dependency.
Product Configurator Configuration
- The
productConfiguratorconfiguration option is now optional (theupdateDebounceTimeandcpqproperties from this option are now also optional). - The
backend.cpqconfiguration option is now optional.
SmartEditConfig
- The
smartEditproperty is optional. - The
smartEdit.storefrontPreviewRouteproperty is optional. - The
smartEdit.allowOriginproperty is optional.
PersonalizationConfig
- The
personalizationproperty is optional.
CmsStructureConfig
- The
cmsStructureproperty is optional.
PageComponentModule
- The
forRoot()method is exposed to minimize side-effects of frequent imports in dependant modules. ThePageComponentModule.forRoot()is now imported inBaseStorefrontModule.
New Checkout Library
Spartacus 4.0 introduces the checkout library. The code related to checkout is moved out of @spartacus/core and @spartacus/storefrontlib and into one of the entry points of the new checkout library. The checkout library is split into the following entry points:
@spartacus/checkout/assets
The checkout related i18n keys are moved here.
@spartacus/checkout/components
The checkout related UI code is moved here. This includes components, guards and ui services.
@spartacus/checkout/core
The checkout facade API implementation is moved here, as well as connectors, event builder, event listener, models, other services, and state management.
@spartacus/checkout/occ
The checkout related OCC code is moved here. This includes the checkout related adapters and converters.
@spartacus/checkout/root
The root entry point is, by convention, meant to always be eager loaded. It contains the config, events, facades, http interceptors and models.
@spartacus/checkout/styles
The checkout related scss styles are moved here.
Most of the code is moved unchanged, but some classes required changes after they were moved. See the following sections for more details.
Use Facades Instead of Services
Some services are now available through facades. Facades should be used instead. The main advantage to using facades instead of their service implementation is that the facades support lazy loading. Facades are imported from @spartacus/checkout/root.
CheckoutCostCenterFacadeshould be used instead ofCheckoutCostCenterService.CheckoutDeliveryFacadeshould be used instead ofCheckoutDeliveryService.CheckoutPaymentFacadeshould be used instead ofCheckoutPaymentService.CheckoutFacadeshould be used instead ofCheckoutService.PaymentTypeFacadeshould be used instead ofPaymentTypeService.ClearCheckoutFacadeshould be used instead ofClearCheckoutService.
ExpressCheckoutService
- The service moved from the
@spartacus/storefrontentry point to@spartacus/checkout/components. - The
CheckoutDeliveryServiceconstructor parameter is replaced with theCheckoutDeliveryFacadefrom@spartacus/checkout/root. - The
CheckoutPaymentServiceconstructor parameter is replaced with theCheckoutPaymentFacadefrom@spartacus/checkout/root. - The
CheckoutDetailsServiceconstructor parameter is now imported from@spartacus/checkout/components. - The
CheckoutConfigServiceconstructor parameter is now imported from@spartacus/checkout/components. - The
ClearCheckoutServiceconstructor parameter is replaced with the requiredClearCheckoutFacadefrom@spartacus/checkout/root. - The
resetCheckoutProcessesmethod was removed. Use theresetCheckoutProcessesmethod from theClearCheckoutFacadeinstead.
CostCenterComponent
- The constructor parameter changed type from
CheckoutCostCenterServicetoCheckoutCostCenterFacade. - The constructor parameter changed type from
PaymentTypeServicetoPaymentTypeFacade.
DeliveryModeComponent
- The constructor parameter changed type from
CheckoutDeliveryServicetoCheckoutDeliveryFacade.
PaymentMethodComponent
- The constructor parameter changed type from
CheckoutServicetoCheckoutFacade. - The constructor parameter changed type from
CheckoutDeliveryServicetoCheckoutDeliveryFacade. - The constructor parameter changed type from
CheckoutPaymentServicetoCheckoutPaymentFacade.
PaymentFormComponent
- The constructor parameter changed type
CheckoutPaymentServicetoCheckoutPaymentFacade. - The constructor parameter changed type from
CheckoutDeliveryServicetoCheckoutDeliveryFacade. - The
PaymentFormComponentdoes not implementOnDestroyanymore. - The
ngOnDestroy()method was removed. - Address verification uses a new
UserAddressService.verifyAddressfunction instead ofCheckoutDeliveryService.verifyAddress. - The expiration date has been wrapped to
fieldsetinstead oflabel. Thespanhas been replaced bylegendand there are newlabelinstead ofdivfor every form control (expiration month, expiration year).
PaymentTypeComponent
- The constructor parameter changed type from
PaymentTypeServicetoPaymentTypeFacade.
PlaceOrderComponent
- The constructor parameter changed type from
CheckoutServicetoCheckoutFacade.
ReviewSubmitComponent
- The constructor parameter changed type from
CheckoutDeliveryServicetoCheckoutDeliveryFacade. - The constructor parameter changed type from
CheckoutPaymentServicetoCheckoutPaymentFacade. - The constructor parameter changed type from
PaymentTypeServicetoPaymentTypeFacade. - The constructor parameter changed type from
CheckoutCostCenterServicetoCheckoutCostCenterFacade. - The
PromotionServiceconstructor parameter was removed. - The
orderPromotions$attribute was removed. - The component gets promotions directly from the cart in the HTML template.
ScheduleReplenishmentOrderComponent
- The constructor parameter changed type from
CheckoutServicetoCheckoutFacade.
ShippingAddressComponent
- The constructor parameter changed type from
CheckoutDeliveryServicetoCheckoutDeliveryFacade. - The constructor parameter changed type from
PaymentTypeServicetoPaymentTypeFacade. - The constructor parameter changed type from
CheckoutCostCenterServicetoCheckoutCostCenterFacade.
CheckoutEventModule
The CheckoutEventModule has one new required constructor parameter: _checkoutEventListener: CheckoutEventListener.
To split out the checkout code in the checkout library, the address verification functionality was moved to the UserAddressService in the @spartacus/core library. The address verification related functions in CheckoutDeliveryService and NgRx supporting classes are not present in the checkout library.
CheckoutDeliveryService
A new processStateStore: Store<StateWithCheckout> property is added into the constructor.
The following functions are not present in the checkout library:
getAddressVerificationResults(): Observable<AddressValidation | string>verifyAddress(address: Address): voidclearAddressVerificationResults(): void
These functions are also not present in the corresponding CheckoutDeliveryFacade facade.
CheckoutState
- The
addressVerification: AddressVerificationStateproperty is removed from theCheckoutStateclass in the checkout library.
AddressVerificationState
- The
AddressVerificationStateclass is not carried over to the checkout library.
CheckoutPaymentService
A new processStateStore: Store<StateWithCheckout> property is added into the constructor.
CheckoutService
A new processStateStore: Store<StateWithCheckout> property is added into the constructor.
PaymentTypeService
A new processStateStore: Store<StateWithCheckout> property is added into the constructor.
OrderConfirmationItemsComponent
- The
PromotionServiceconstructor parameter was removed. - The
orderPromotions$attribute was removed. - The component gets promotions directly from the order in the HTML template.
OccCheckoutAdapter
- The protected
getEndpointmethod has been removed. - The following are new methods:
getPlaceOrderEndpointgetRemoveDeliveryAddressEndpointgetClearDeliveryModeEndpointgetLoadCheckoutDetailsEndpoint
OccCheckoutPaymentAdapter
- The protected
getCartEndpointmethod has been removed. - The following are new methods:
getCardTypesEndpointgetCreatePaymentDetailsEndpointgetPaymentProviderSubInfoEndpointgetSetPaymentDetailsEndpoint
OccCheckoutCostCenterAdapter
- The protected
getCartEndpointmethod has been removed. - The new method is
getSetCartCostCenterEndpoint.
OccCheckoutDeliveryAdapter
- The protected
getCartEndpointmethod has been removed. - The following are new methods:
getCreateDeliveryAddressEndpointgetDeliveryModeEndpointgetDeliveryModesEndpointgetSetDeliveryAddressEndpointgetSetDeliveryModeEndpoint
OccCheckoutPaymentTypeAdapter
- The protected
getCartEndpointmethod has been removed. - The following are new methods:
getPaymentTypesEndpointgetSetCartPaymentTypeEndpoint
OccCheckoutReplenishmentOrderAdapter
- The new method is
getScheduleReplenishmentOrderEndpoint.
CheckoutComponentModule
The CheckoutComponentModule was moved and renamed to CheckoutComponentsModule. It was moved to @spartacus/checkout/components. The new module is not exactly the same as the previous one, but the new one should essentially be a superset of the previous one.
CheckoutModule
The CheckoutModule from @spartacus/core became CheckoutCoreModule in @spartacus/checkout/core. The CheckoutCoreModule from @spartacus/checkout/core fills a similar role as the previous CheckoutModule from @spartacus/core. One exception is providing the CheckoutCartInterceptor, which is now done in CheckoutRootModule from @spartacus/checkout/root instead.
Note: The new CheckoutCoreModule does not have the forRoot() method. Just import the CheckoutCoreModule instead.
There is still a CheckoutModule in @spartacus/checkout. While its name is the same as the previous module from @spartacus/core, it has a different role. It imports other new checkout library modules: CheckoutComponentsModule, CheckoutCoreModule, CheckoutOccModule. The new module naming changes might seem confusing at first sight, but the choice of the new names was made to align with the feature library module naming convention in Spartacus.
Complete List of Symbols (Class, Interface, Const) Moved to the Checkout Library
Imports for these symbols must be updated in custom code.
| Name | Moved From | Moved To | Renamed To |
|---|---|---|---|
| CheckoutLoginComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutLoginModule | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationModule | @spartacus/storefront | @spartacus/checkout/components | - |
| ReplenishmentOrderConfirmationModule | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationGuard | @spartacus/storefront | @spartacus/checkout/components | - |
| GuestRegisterFormComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationItemsComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationOverviewComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationThankYouMessageComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| OrderConfirmationTotalsComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutComponentModule | @spartacus/storefront | @spartacus/checkout/components | CheckoutComponentsModule |
| CheckoutOrchestratorComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutOrchestratorModule | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutOrderSummaryComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutOrderSummaryModule | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressModule | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressMobileBottomComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressMobileBottomModule | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressMobileTopComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutProgressMobileTopModule | @spartacus/storefront | @spartacus/checkout/components | - |
| DeliveryModeComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| DeliveryModeModule | @spartacus/storefront | @spartacus/checkout/components | - |
| PaymentMethodComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| PaymentMethodModule | @spartacus/storefront | @spartacus/checkout/components | - |
| PaymentFormComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| PaymentFormModule | @spartacus/storefront | @spartacus/checkout/components | - |
| PlaceOrderComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| PlaceOrderModule | @spartacus/storefront | @spartacus/checkout/components | - |
| ReviewSubmitComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| ReviewSubmitModule | @spartacus/storefront | @spartacus/checkout/components | - |
| ScheduleReplenishmentOrderComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| ScheduleReplenishmentOrderModule | @spartacus/storefront | @spartacus/checkout/components | - |
| CardWithAddress | @spartacus/storefront | @spartacus/checkout/components | - |
| ShippingAddressComponent | @spartacus/storefront | @spartacus/checkout/components | - |
| ShippingAddressModule | @spartacus/storefront | @spartacus/checkout/components | - |
| DeliveryModePreferences | @spartacus/storefront | @spartacus/checkout/root | - |
| CheckoutConfig | @spartacus/storefront | @spartacus/checkout/root | - |
| CheckoutAuthGuard | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutStepsSetGuard | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutGuard | @spartacus/storefront | @spartacus/checkout/components | - |
| NotCheckoutAuthGuard | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutStepType | @spartacus/storefront | @spartacus/checkout/root | - |
| checkoutShippingSteps | @spartacus/storefront | @spartacus/checkout/root | - |
| checkoutPaymentSteps | @spartacus/storefront | @spartacus/checkout/root | - |
| CheckoutStep | @spartacus/storefront | @spartacus/checkout/root | - |
| CheckoutConfigService | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutDetailsService | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutReplenishmentFormService | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutStepService | @spartacus/storefront | @spartacus/checkout/components | - |
| ExpressCheckoutService | @spartacus/storefront | @spartacus/checkout/components | - |
| CheckoutOccModule | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutCostCenterAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutDeliveryAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutPaymentTypeAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutPaymentAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutReplenishmentOrderAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccCheckoutAdapter | @spartacus/core | @spartacus/checkout/occ | - |
| OccReplenishmentOrderFormSerializer | @spartacus/core | @spartacus/checkout/occ | - |
| CheckoutModule | @spartacus/core | @spartacus/checkout/core | CheckoutCoreModule |
| CheckoutAdapter | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutConnector | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutCostCenterAdapter | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutCostCenterConnector | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutDeliveryAdapter | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutDeliveryConnector | @spartacus/core | @spartacus/checkout/core | - |
| DELIVERY_MODE_NORMALIZER | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutPaymentAdapter | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutPaymentConnector | @spartacus/core | @spartacus/checkout/core | - |
| PAYMENT_DETAILS_SERIALIZER | @spartacus/core | @spartacus/checkout/core | - |
| CARD_TYPE_NORMALIZER | @spartacus/core | @spartacus/checkout/core | - |
| PAYMENT_TYPE_NORMALIZER | @spartacus/core | @spartacus/checkout/core | - |
| PaymentTypeAdapter | @spartacus/core | @spartacus/checkout/core | - |
| PaymentTypeConnector | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutReplenishmentOrderAdapter | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutReplenishmentOrderConnector | @spartacus/core | @spartacus/checkout/core | - |
| REPLENISHMENT_ORDER_FORM_SERIALIZER | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutEventBuilder | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutEventModule | @spartacus/core | @spartacus/checkout/core | - |
| OrderPlacedEvent | @spartacus/core | @spartacus/checkout/root | - |
| CheckoutCostCenterService | @spartacus/core | @spartacus/checkout/root | CheckoutCostCenterFacade |
| CheckoutDeliveryService | @spartacus/core | @spartacus/checkout/root | CheckoutDeliveryFacade |
| CheckoutPaymentService | @spartacus/core | @spartacus/checkout/root | CheckoutPaymentFacade |
| CheckoutService | @spartacus/core | @spartacus/checkout/root | CheckoutFacade |
| PaymentTypeService | @spartacus/core | @spartacus/checkout/root | PaymentTypeFacade |
| ClearCheckoutService | @spartacus/core | @spartacus/checkout/root | ClearCheckoutFacade |
| CheckoutDetails | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutPageMetaResolver | @spartacus/core | @spartacus/checkout/core | - |
| CHECKOUT_FEATURE | @spartacus/core | @spartacus/checkout/core | - |
| CHECKOUT_DETAILS | @spartacus/core | @spartacus/checkout/core | - |
| SET_DELIVERY_ADDRESS_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| SET_DELIVERY_MODE_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| SET_SUPPORTED_DELIVERY_MODE_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| SET_PAYMENT_DETAILS_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| GET_PAYMENT_TYPES_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| SET_COST_CENTER_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| PLACED_ORDER_PROCESS_ID | @spartacus/core | @spartacus/checkout/core | - |
| StateWithCheckout | @spartacus/core | @spartacus/checkout/core | - |
| CardTypesState | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutStepsState | @spartacus/core | @spartacus/checkout/core | - |
| PaymentTypesState | @spartacus/core | @spartacus/checkout/core | - |
| OrderTypesState | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutState | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutActions | @spartacus/core | @spartacus/checkout/core | - |
| CheckoutSelectors | @spartacus/core | @spartacus/checkout/core | - |
Breaking Changes Introduced in 4.0
StoreFinderService
- The
platformIdinjection was added to the constructor. - The
getStoreLatitude()andgetStoreLongitude()methods have been moved to this service fromStoreDataService, which has been removed.
StoreDataService
- The service has been removed and the functions have been moved to
StoreFinderService.
AbstractStoreItemComponent
- The
StoreDataServicehas been replaced by theStoreFinderService.
StoreFinderListItemComponent
- The
StoreDataServicehas been replaced by theStoreFinderService.
StoreFinderListComponent
- The
StoreDataServicehas been replaced by theStoreFinderService.
StoreFinderStoreDescriptionComponent
- The
StoreDataServicehas been replaced by theStoreFinderService.
GoogleMapRendererService
- The
StoreDataServicehas been replaced by theStoreFinderService. - The
ExternalJsFileLoaderhas been replaced by theScriptLoader.
ScheduleComponent
- The
ngOnChanges()method has been changed to thengOnInit()method, along with the corresponding class implementations (for example, implementsOnChangestoOnInit). - The
displayDaysvariable has been removed. UseweekDaysinstead. - The
StoreDataServicehas been removed`. - The
getStoreOpeningTime(),getStoreClosingTime(), andgetInitialDate()methods have been removed. UseweekDayOpeningListfromlocationinstead.
PromotionService
The PromotionService is deleted. The promotions can directly be found on the order or cart. Use other existing services to retrieve the order or cart.
The order promotions are in the order and cart attributes appliedOrderPromotions and potentialOrderPromotions.
The product promotions for order and cart entries are now available with the entries[].promotions attribute.
SavedCartDetailsActionComponent
- The
ClearCheckoutServicewas removed from the constructor.
SavedCartListComponent
- The
ClearCheckoutServicewas removed from the constructor.
SavedCartFormDialogComponent
- The
ClearCheckoutServicewas removed from the constructor.
AddressBookComponentService
Library: @spartacus/core
Class: AddressBookComponentService
Change: The checkoutDeliveryService: CheckoutDeliveryService constructor parameter is removed.
Instead, the CheckoutEventListener from the checkout library listens for the new address change events and resets the checkout delivery accordingly.
AddressBookComponent
Library: @spartacus/core
Class: AddressBookComponent
Change: Two constructor parameters are removed. The first is the checkoutDeliveryService: CheckoutDeliveryService constructor parameter that has been removed. The AddressBookComponent does not call CheckoutDeliveryService.clearCheckoutDeliveryDetails() anymore when an address is changed. Instead, the AddressBookComponentService fires events. See AddressBookComponentService entry above for more information.
The second constructor parameter that is removed is userAddressService: UserAddressService. The UserAddressService interactions are now encapsulated in AddressBookComponentService.
AddressFormComponent
Library: @spartacus/core
Change: The checkoutDeliveryService: CheckoutDeliveryService constructor parameter is removed.
The AddressFormComponent now uses the new verifyAddress address verification function from UserAddressService, instead of the verifyAddress function from CheckoutDeliveryService. The UserAddressService.verifyAddress does not use the NgRx store under the hood.
Change: TranslationService is a new, required constructor dependency.
The AddressFormComponent now uses translations to show a configurable default title option instead of a hard-coded title.
UserAddressService
Library: @spartacus/core
Change: There are two new required constructor parameters: userAddressConnector: UserAddressConnector and command: CommandService
CheckoutDetailsLoadedGuard
Library: @spartacus/storefront
The CheckoutDetailsLoadedGuard was not used and is now removed.
PaymentDetailsSetGuard
Library: @spartacus/storefront
The PaymentDetailsSetGuard was not used and is now removed.
ShippingAddressSetGuard
Library: @spartacus/storefront
The ShippingAddressSetGuard was not used and is now removed.
DeliveryModeSetGuard
Library: @spartacus/storefront
The DeliveryModeSetGuard was not used and is now removed.
AddedToCartDialogComponent
- The
PromotionServiceconstructor parameter was removed. - The
orderPromotions$attribute was removed. - The component gets promotions directly from the cart in the HTML template.
- The
incrementproperty was removed. Use thenumberOfEntriesBeforeAddproperty instead.
CartDetailsComponent
- The
PromotionServiceconstructor parameter was removed. - The
orderPromotions$andpromotions$attributes were removed. - The component gets promotions directly from the cart in the HTML template.
CartItemComponent
- The
PromotionServiceconstructor parameter was removed. - The component gets product promotions directly from the cart entry data.
- The
ngOnInit()method was removed - The
appliedProductPromotions$attribute was removed.
CartItemListComponent
- The
FeatureConfigServiceconstructor dependency was removed. - New required constructor dependencies were added:
UserIdServiceandMultiCartService.
OrderDetailItemsComponent
- The
PromotionServiceconstructor parameter was removed. - The
orderPromotions$attribute was removed. - The component gets promotions directly from the order in the HTML template.
SuggestedAddressDialogComponent
The SuggestedAddressDialogComponent uses different translation label keys:
- The
checkoutAddress.verifyYourAddresskey is replaced byaddressSuggestion.verifyYourAddress. - The
checkoutAddress.ensureAccuracySuggestChangekey is replaced byaddressSuggestion.ensureAccuracySuggestChange. - The
checkoutAddress.chooseAddressToUsekey is replaced byaddressSuggestion.chooseAddressToUse. - The
checkoutAddress.suggestedAddresskey is replaced byaddressSuggestion.suggestedAddress. - The
checkoutAddress.enteredAddresskey is replaced byaddressSuggestion.enteredAddress. - The
checkoutAddress.editAddresskey is replaced byaddressSuggestion.editAddress. - The
checkoutAddress.saveAddresskey is replaced byaddressSuggestion.saveAddress.
OrderOverviewComponent
The OrderOverviewComponent uses different translation label keys:
- The
checkoutOrderConfirmation.replenishmentNumberkey is replaced byorderDetails.replenishmentId. - The
checkoutOrderConfirmation.statuskey is replaced byorderDetails.status. - The
checkoutOrderConfirmation.activekey is replaced byorderDetails.active. - The
checkoutOrderConfirmation.cancelledkey is replaced byorderDetails.cancelled. - The
checkoutReview.startOnkey is replaced byorderDetails.startOn. - The
checkoutOrderConfirmation.frequencykey is replaced byorderDetails.frequency. - The
checkoutOrderConfirmation.nextOrderDatekey is replaced byorderDetails.nextOrderDate. - The
checkoutOrderConfirmation.orderNumberkey is replaced byorderDetails.orderNumber. - The
checkoutOrderConfirmation.placedOnkey is replaced byorderDetails.placedOn. - The
checkoutReview.poNumberkey is replaced byorderDetails.purchaseOrderNumber. - The
checkoutPO.noPoNumberkey is replaced byorderDetails.emptyPurchaseOrderId. - The
checkoutProgress.methodOfPaymentkey is replaced byorderDetails.methodOfPayment. - The
checkoutPO.costCenterkey is replaced byorderDetails.costCenter. - The
checkoutShipping.shippingMethodkey is replaced byorderDetails.shippingMethod. - The
getOrderCurrentDateCardContentmethod requires theisoDateparameter. It is no longer optional.
Qualtrics Changes
QualtricsConfigwas removed from the@spartacus/storefrontlib. Use@spartacus/qualtrics/componentsinstead.QUALTRICS_EVENT_NAMEwas removed from the@spartacus/storefrontlib. Use@spartacus/qualtrics/componentsinstead.QualtricsLoaderServicewas removed from@spartacus/storefrontlib. Use@spartacus/qualtrics/componentsinstead.QualtricsLoaderServicefrom the feature library no longer requiresRendererFactory2. It has been replaced byScriptLoader.QualtricsComponentwas removed from@spartacus/storefrontlib. Use@spartacus/qualtrics/componentsinstead.QualtricsModulewas removed from@spartacus/storefrontlib, and renamedQualtricsComponentsModule. Use@spartacus/qualtrics/componentsinstead.
OccConfigLoaderModule
- The
OccConfigLoaderModulewas removed. UseSiteContextConfigInitializerandI18nConfigInitializerinstead.
OccConfigLoaderService
- The
OccConfigLoaderServicewas removed. UseSiteContextConfigInitializerandI18nConfigInitializerinstead.
OccLoadedConfigConverter
- The
OccLoadedConfigConverterwas removed. UseSiteContextConfigInitializerandI18nConfigInitializerinstead.
OccLoadedConfig
- The
OccLoadedConfigwas removed. UseSiteContextConfigInitializerandI18nConfigInitializerinstead.
OccSitesConfigLoader
- The
OccSitesConfigLoaderwas removed. UseSiteContextConfigInitializerandI18nConfigInitializerinstead.
OccEndpoints
The backend.occ.endpoints.baseSitesForConfig config property has been removed. Use backend.occ.endpoints.baseSites instead.
NavigationUIComponent
- The
HamburgerMenuServicewas added to the constructor.
Removal of Grouping Modules
In release 4.0, a number of modules that grouped feature modules and provided some default configuration were removed.
- The
B2cStorefrontModulewas removed from@spartacus/storefront - The
B2bStorefrontModulewas removed from@spartacus/setup - The
StorefrontModulewas removed from@spartacus/storefront - The
CmsLibModulewas removed from@spartacus/storefront - The
MainModulewas removed from@spartacus/storefront - The
StorefrontFoundationModulewas removed from@spartacus/storefront - The
OccModulewas removed from@spartacus/core - The
EventsModulewas removed from@spartacus/storefront
For more information, see Updating Spartacus to Version 4.0.
ViewConfigModule Removed
- This module only provided empty default configuration that is not needed.
EventService
- The
EventServicenow registers the parent of an event as an event. For more information, see Event Type Inheritance.
Changes in the Product Configurator Feature Library
MessageConfig
The MessageConfig has been renamed to ConfiguratorMessageConfig.
ConfiguratorAttributeDropDownComponent
The onSelect method has been removed and is no longer used. Use onSelect from the super class, which takes the value as an argument.
ConfiguratorAttributeNumericInputFieldComponent
The createEventFromInput method has been removed and is no longer used.
ConfiguratorAttributeRadioButtonComponent
The onDeselect method has been removed and is no longer used.
ConfiguratorGroupMenuComponent
The preventScrollingOnSpace, navigateUpOnEnter and clickOnEnter methods have been removed and are no longer used.
ConfiguratorProductTitleComponent
The getProductImageURL, getProductImageAlt and clickOnEnter methods have been removed and are no longer used.
ConfiguratorCartService
-
The
checkoutService: CheckoutServiceconstructor parameter type is changed tocheckoutFacade: CheckoutFacadeto adapt to the new checkout library. -
The
cartStore: Store<StateWithMultiCart>constructor parameter has been removed. -
The
ConfiguratorCartServicenow requires theConfiguratorUtilsService.
CommonConfiguratorUtilsService
The signature of the getCartId method has changed from getCartId(cart: Cart): string to getCartId(cart?: Cart): string.
ConfiguratorGroupsService
- The return parameter of the
getFirstConflictGroupmethod has changed fromConfigurator.GrouptoConfigurator.Group | undefined. - The return parameter of the
getMenuParentGroupmethod has changed fromConfigurator.GrouptoConfigurator.Group | undefined. - The return parameter of the
getParentGroupmethod has changed fromConfigurator.GrouptoConfigurator.Group | undefined. - The return parameter of the
getNextGroupIdmethod has changed fromObservable<string>toObservable<string | undefined>. - The return parameter of the
getPreviousGroupIdmethod has changed fromObservable<string>toObservable<string | undefined>. - The return parameter of the
getNeighboringGroupIdmethod has changed fromObservable<string>toObservable<string | undefined>.
ConfiguratorUtilsService
- The return parameter of the
getParentGroupmethod has changed fromConfigurator.GrouptoConfigurator.Group | undefined.
New and Renamed Dependencies
ConfiguratorCartEntryInfoComponentnow also requiresCommonConfiguratorUtilsService.ConfiguratorAttributeCheckboxListComponentnow also requiresConfiguratorAttributeQuantityService.ConfiguratorAttributeDropDownComponentnow also requiresConfiguratorAttributeQuantityService.ConfiguratorAttributeInputFieldComponentnow also requiresConfiguratorUISettingsConfig.ConfiguratorAttributeNumericInputFieldComponentnow also requiresConfiguratorUISettingsConfig.ConfiguratorAttributeRadiButtonComponentnow also requiresConfiguratorAttributeQuantityService.ConfiguratorGroupMenuComponentnow also requiresConfiguratorGroupMenuServiceandDirectionService.ConfiguratorStorefrontUtilsServicenow also requiresWindowRefandKeyboardFocusService.ConfiguratorFormComponentnow also requiresConfiguratorStorefrontUtilsService.ConfiguratorIssuesNotificationComponentnow also requiresCartItemContext.ConfiguratorOverviewAttributeComponentnow also requiresBreakpointService.ConfiguratorUpdateMessageComponentnow requiresConfiguratorMessageConfiginstead ofMessageConfig.
LoginRegisterComponent
Library: @spartacus/user
Class: LoginRegisterComponent
Change: The checkoutConfigService: CheckoutConfigService constructor parameter is removed.
The display of the guest checkout button relies on the presence of the forced query parameter only.
NgbTabsetModule
StoreFinderComponentsModule
- The deprecated
NgbTabsetModuleimport from@ng-bootstrap/ng-bootstraphas been replaced withNgbNavModuleto support version 8 of the library.
StoreFinderListComponent
- The mobile template has been updated to use nav instead of tabs. For more information, see this Spartacus GitHub pull request.
- Added styles for
ul.navto keep the same appearance.
ASM Changes
- The
AsmModulewas removed from@spartacus/storefrontlib, and renamed toAsmComponentsModule. Use@spartacus/asm/componentsinstead. AsmModulewas removed from@spartacus/core, and renamed toAsmCoreModule. Use@spartacus/asm/coreinstead.AsmOccModulewas removed from@spartacus/core. Use@spartacus/asm/occinstead.OccAsmAdapterwas removed from@spartacus/core. Use@spartacus/asm/occinstead.AsmConfigwas removed from@spartacus/core. Use@spartacus/asm/core.AsmAdapterwas removed. Use@spartacus/asm/coreinstead.AsmConnectorwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCH_PAGE_NORMALIZERwas removed. Use@spartacus/asm/coreinstead.AsmServicewas removed. Use@spartacus/asm/coreinstead.CsAgentAuthServicewas removed. Use@spartacus/asm/rootinstead.CustomerSearchPagewas removed. Use@spartacus/asm/coreinstead.CustomerSearchOptionswas removed. Use@spartacus/asm/coreinstead.AsmUiwas removed. Use@spartacus/asm/coreinstead.AsmAuthHttpHeaderServicewas removed. Use@spartacus/asm/rootinstead.TOKEN_TARGETwas removed. Use@spartacus/asm/rootinstead.AsmAuthServicewas removed. Use@spartacus/asm/rootinstead.AsmAuthStorageServicewas removed. Use@spartacus/asm/rootinstead.SYNCED_ASM_STATEwas removed. Use@spartacus/asm/coreinstead.AsmStatePersistenceServicewas removed. Use@spartacus/asm/coreinstead.ASM_UI_UPDATEwas removed. Use@spartacus/asm/coreinstead.AsmUiUpdatewas removed. Use@spartacus/asm/coreinstead.AsmUiActionwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCHwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCH_FAILwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCH_SUCCESSwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCH_RESETwas removed. Use@spartacus/asm/coreinstead.CustomerSearchwas removed. Use@spartacus/asm/coreinstead.CustomerSearchFailwas removed. Use@spartacus/asm/coreinstead.CustomerSearchSuccesswas removed. Use@spartacus/asm/coreinstead.CustomerSearchResetwas removed. Use@spartacus/asm/coreinstead.CustomerActionwas removed. Use@spartacus/asm/coreinstead.LOGOUT_CUSTOMER_SUPPORT_AGENTwas removed. Use@spartacus/asm/coreinstead.LogoutCustomerSupportAgentwas removed. Use@spartacus/asm/coreinstead.ASM_FEATUREwas removed. Use@spartacus/asm/coreinstead.CUSTOMER_SEARCH_DATAwas removed. Use@spartacus/asm/coreinstead.StateWithAsmwas removed. Use@spartacus/asm/coreinstead.AsmStatewas removed. Use@spartacus/asm/coreinstead.getAsmUiwas removed. Use@spartacus/asm/coreinstead.getCustomerSearchResultsLoaderStatewas removed. Use@spartacus/asm/coreinstead.getCustomerSearchResultswas removed. Use@spartacus/asm/coreinstead.getCustomerSearchResultsLoadingwas removed. Use@spartacus/asm/coreinstead.getAsmStatewas removed. Use@spartacus/asm/coreinstead.
LaunchDialogService
SavedCartFormLaunchDialogService
- The
SavedCartFormLaunchDialogServiceservice has been removed. TheopenDialogmethod is part of theLaunchDialogServicenow.
AddToSavedCartComponent
- The
SavedCartFormLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
SavedCartDetailsActionComponent
- The
SavedCartFormLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
SavedCartDetailsOverviewComponent
- The
SavedCartFormLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
AnonymousConsentLaunchDialogService
- The
AnonymousConsentLaunchDialogServiceservice has been removed. TheopenDialogmethod is part ofLaunchDialogServicenow.
AnonymousConsentManagementBannerComponent
- The
AnonymousConsentLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
AnonymousConsentOpenDialogComponent
- The
AnonymousConsentLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
ReplenishmentOrderCancellationLaunchDialogService
- The
ReplenishmentOrderCancellationLaunchDialogServiceservice has been removed. TheopenDialogmethod is part ofLaunchDialogServicenow.
ReplenishmentOrderCancellationComponent
- The
ReplenishmentOrderCancellationLaunchDialogServicewas removed from the constructor. - The
LaunchDialogServicewas added to the constructor.
OrderHistoryComponent
- The
divthat wrapped thecx-sortingcomponent has been changed tolabelandspanwas added before field.
OrderReturnRequestListComponent
- The
divthat wrapped thecx-sortingcomponent has been changed tolabelandspanwas added before field.
ReplenishmentOrderHistoryComponent
- The
ReplenishmentOrderCancellationLaunchDialogServicewas removed from the constructor. - the
LaunchDialogServicewas added to the constructor. - The
divthat wrapped thecx-sortingcomponent has been changed tolabelandspanwas added before field.
ProductListComponent
- Two
divelements that wrapped thecx-sortingcomponent have been merged to onelabelandspanwas added before field.
SmartEdit
SmartEditModulewas removed. Use@spartacus/smarteditinstead.SmartEditServicewas moved to@spartacus/smartedit/core.
Personalization
PersonalizationModulewas removed. Use@spartacus/tracking/personalizationinstead.PersonalizationConfigwas moved to@spartacus/tracking/personalization/root.PersonalizationContextServicewas moved to@spartacus/tracking/personalization/core.PersonalizationActionwas moved to@spartacus/tracking/personalization/core.PersonalizationContextwas moved to@spartacus/tracking/personalization/core.
WindowRef
platformIdis now a required constructor dependency.
ProductListComponentService
ProductListComponentServicenow also requiresViewConfig.- The
defaultPageSizeproperty was removed. To modify the default page size, useprovideConfig(<ViewConfig>{ view: { defaultPageSize: <your_default_page_size_value }})in the module.
Product reloading
- The
reloadmethod was removed fromProductService. Instead, use the reloading triggers. - The
EventServicefrom@spartacus/corewas added as a parameter to the constructor for theProductLoadingService.
Product Variants Changes
Automated Migrations for Version 4.0
ProductVariantsModulewas removed from@spartacus/storefront. Use the@spartacus/product/variantsfeature library instead.ProductVariantsComponentwas removed from@spartacus/storefront. UseProductVariantsContainerComponentfrom@spartacus/product/variants/componentsinstead.VariantColorSelectorComponentwas removed from@spartacus/storefront. UseProductVariantColorSelectorComponentfrom@spartacus/product/variants/componentsinstead.VariantColorSelectorModulewas removed from@spartacus/storefront. UseProductVariantColorSelectorModulefrom@spartacus/product/variants/componentsinstead.VariantSizeSelectorComponentwas removed from@spartacus/storefront. UseProductVariantSizeSelectorComponentfrom@spartacus/product/variants/componentsinstead.VariantSizeSelectorModulewas removed from@spartacus/storefront. UseProductVariantSizeSelectorModulefrom@spartacus/product/variants/componentsinstead.VariantStyleSelectorComponentwas removed from@spartacus/storefront. UseProductVariantStyleSelectorComponentfrom@spartacus/product/variants/componentsinstead.VariantStyleSelectorModulewas removed from@spartacus/storefront. UseProductVariantStyleSelectorModulefrom@spartacus/product/variants/componentsinstead.VariantStyleIconsComponentwas removed from@spartacus/storefront. UseProductVariantStyleIconsComponentfrom@spartacus/product/variants/rootinstead.ProductVariantStyleIconsComponentwas moved from@spartacus/product/variants/componentsto@spartacus/product/variants/rootinstead.VariantStyleIconsModulewas removed from@spartacus/storefront. UseProductVariantStyleIconsModulefrom@spartacus/product/variants/rootinstead.ProductVariantStyleIconsModulewas moved from@spartacus/product/variants/componentsto@spartacus/product/variants/rootinstead.ProductVariantGuardwas removed from@spartacus/storefront. UseProductVariantsGuardfrom@spartacus/product/variants/componentsinstead. Additionally, thefindVariantmethod was renamed tofindPurchasableProductCode.AuthHttpHeaderServicenow requiresAuthRedirectService.AsmAuthHttpHeaderServicenow requiresAuthRedirectService.AuthRedirectServicenow requiresAuthFlowRoutesService.RoutingServicenow requiresLocationfrom@angular/common.ProtectedRoutesServicenow requiresUrlParsingService.EventServiceno longer usesFeatureConfigService.PageEventModulewas removed. Instead, useNavigationEventModulefrom@spartacus/storefront.PageEventBuilderwas removed. Instead, useNavigationEventBuilderfrom@spartacus/storefront.CartPageEventBuilderno longer usesActionsSubjectandFeatureConfigServiceHomePageEventBuilderno longer usesFeatureConfigService.ProductPageEventBuilderno longer usesFeatureConfigService.PageEventno longer contains thecontext,semanticRoute,urlandparamsproperties. These are now contained in thePageEvent.navigationobject.EventsModulewas removed. Use individual imports instead (for example,CartPageEventModule,ProductPageEventModule, and so on).
Product Variants i18n
- The
varianttranslation namespace was removed from@spartacus/assets. Use theproductVariantsnamespace that can be imported withproductVariantsTranslationsandproductVariantsTranslationChunksConfigfrom@spartacus/product/variants/assetsinstead. Translation keys from this namespace did not changed.
Product Variants Endpoint Scope
- The
variantsscope was removed fromdefaultOccProductConfig. It is now provided byProductVariantsOccModuleunder@spartacus/product/variants/occinstead. Additionally, the endpoint now uses theorgProductsAPI instead ofproducts.
ProductVariantStyleIconsComponent
ProductVariantStyleIconsComponentchanged its constructor dependency fromProductListItemContextSourcetoProductListItemContext.
Product Variants Styles
- Styles for
cx-product-variantswere removed from@spartacus/styles. Use the@spartacus/product/variantsimport instead.
Feature Keys for Product Configurators
The feature keys that are used to lazy load the product configurator libraries in app.module.ts were available as rulebased and productConfiguratorRulebased from 3.1 onwards (respective textfield and productConfiguratorTextfield for the textfield template configurator).
In 4.0, only the longer versions productConfiguratorRulebased and productConfiguratorTextfield are possible.
The following is an example of a configuration for Spartacus prior to 4.0:
featureModules: {
rulebased: {
module: () => import('@spartacus/product-configurator/rulebased').then(
(m) => m.RulebasedConfiguratorModule
),
},
}
With Spartacus 4.0, the configuration needs to appear as follows:
featureModules: {
productConfiguratorRulebased: {
module: () => import('@spartacus/product-configurator/rulebased').then(
(m) => m.RulebasedConfiguratorModule
),
},
}
Translations (i18n) changed
- The
asm.standardSessionInProgresskey was removed. - The
pageMetaResolver.checkout.title_plurarkey was removed. - The value of
pageMetaResolver.checkout.titlehas been changed toCheckout.
Storage Sync Mechanism
In version 4.0, the storage sync mechanism that was deprecated in version 3.0 has now been removed. In the previous major release, Spartacus provided a more powerful mechanism based on StatePersistenceService, which can cover all use cases for synchronizing data to and from the browser storage (such as localStorage and sessionStorage), and it does this better than the removed storage sync.
The following was removed:
- The core of the mechanism (reducer)
- The configuration (
storageSyncfromStateConfig) - The default config and default keys (
defaultStateConfig,DEFAULT_LOCAL_STORAGE_KEYandDEFAULT_SESSION_STORAGE_KEY)
DefaultScrollConfig
- The
defaultScrollConfigwas renamed todefaultViewConfig
BaseSiteService
- The
BaseSiteService.initializemethod was removed. UseBaseSiteServiceInitializer.initializeinstead. - A
BaseSiteService.isInitializedmethod was added.
LanguageService
- The
LanguageService.initializemethod was removed. UseLanguageInitializer.initializeinstead. - A
LanguageService.isInitializedmethod was added. LanguageServiceno longer usesWindowRef. The language initialization from the state was moved toLanguageInitializer.LanguageServicenow validates the value passed to thesetActive()method against the ISO codes listed in the Spartacuscontextconfig, before setting the actual value in the NgRx store.- The initialization of the site context is scheduled a bit earlier than it was before (now it is run in an observable stream instead of a Promise’s callback). It is a very slight change, but might have side effects in some custom implementations.
- The active language is now persisted in the Local Storage instead of the Session Storage.
CurrencyService
- The
CurrencyService.initializemethod was removed. UseCurrencyInitializer.initializeinstead. - A
CurrencyService.isInitializedmethod was added. CurrencyServiceno longer usesWindowRef. The currency initialization from the state was moved toCurrencyInitializer.CurrencyServicenow validates the value passed to thesetActive()method against the ISO codes listed in the Spartacuscontextconfig, before setting the actual value in the RgRx store.- The initialization of the site context is scheduled a bit earlier than it was before (now it is run in an observable stream instead of a Promise’s callback). It is a very slight change, but might have side effects in some custom implementations.
- The active currency is now persisted in the LocalStorage instead of the Session Storage.
Page Resolvers
In 3.1 and 3.2, Spartacus introduced a few changes on how page meta data is collected. The resolvers are now configurable, and you can also configure whether the resolvers render on the client (CSR) or server (SSR). By default, description, image, robots and canonical URL are resolved only in SSR. A few resolvers have been changed or added, since most data is now configurable in the back end (such as description and robots). The robot information that was previously hardcoded in some resolvers is now driven by back end data.
Resolving the canonical URL has been enabled by default in 4.0. If you want to opt-out, change the Spartacus configuration of pageMeta.resolvers.
A new feature has been added to the product and category resolvers for the canonical URL.
The BasePageMetaResolver is leveraged to compose most of the generic page meta data. Most page resolvers now use the page data to create the description and robot tags. The changes affect the following resolver classes:
- The
PageMetaServicehas a dependency onUnifiedInjector,PageMetaConfigand theplatformId. - The
ContentPageMetaResolverdepends only on theBasePageMetaResolver. - The
BasePageMetaResolverrequires theRouterandPageLinkServiceto add canonical links to the page meta. - The
ProductPageMetaResolverrequires theBasePageMetaResolverandPageLinkService. - The
CategoryPageMetaResolverrequires theBasePageMetaResolver. - The
SearchPageMetaResolverrequires theBasePageMetaResolver. - The
CheckoutPageMetaResolveruses theBasePageMetaResolver. - The
OrganizationPageMetaResolverno longer uses theBasePageMetaResolver. - The
RoutingServiceuses theRouterto resolve the full URL (used to resolve the canonical URL in the page meta resolvers)
The CmsPageTitleModule is renamed to PageMetaModule.
The CartPageMetaResolver is removed because all content is resolved by the generic ContentPageMetaResolver.
The following properties where removed in 4.0:
- The
ContentPageMetaResolverno longer supports thehomeBreadcrumb$,breadcrumb$,title$andcms$because the content is resolved by theBasePageMetaResolver. - The
resolverMethodsproperty on thePageMetaServicehas changed toresolvers$because the resolvers are read from the configuration stream.
SelectiveCartService
- The
getLoadedmethod was removed. Use theisStablemethod instead.
DynamicAttributeService
- The
DynamicAttributeServicedoes not depend anymore on theSmartEditService, but only on theUnifiedInjector. - The
addDynamicAttributesmethod was removed. Use theaddAttributesToComponentoraddAttributesToSlotfunctions instead.
SearchBoxComponentService
- The
SearchBoxComponentServicenow also requires theEventService.
CartListItemComponent
- The
FeatureConfigServicewas removed from the constructor and theUserIdServiceandMultiCartServicewere added to the constructor. - The
form: FormGroupproperty is now initialized on component creation instead of in thecreateForm()method. - The
ngOnInit()method has been modified to fix an issue with rendering items. - The
[class.is-changed]template attribute on<div>tag now depends on thecontrol.get('quantity').disabledmethod.
Models
- The
Iteminterface was removed. UseOrderEntryinstead. sortCodewas removed from theTableHeaderinterface.
SearchBoxComponent
- The
RoutingServiceis a new, required constructor dependency. cx-icon[type.iconTypes.RESET]has been changed tobutton>cx-icon[type.iconTypes.Reset]cx-icon[type.iconstypes.SEARCH]has been changed todiv>cx-icon[type.iconstypes.SEARCH]with the rest of the attributes removed. The button is for presentation purpose only.div.suggestionshas been changed toul>li>afor better a11y supportdiv.productshas been changed toul>li>afor better a11y supportwinRef.document.querySelectorAll('.products > a, .suggestions > a')has been changed towinRef.document.querySelectorAll('.products > li a, .suggestions > li a')
Organization Administration Breaking Changes
CardComponent (Administration)
- The
displayCloseButtonproperty in thecxPopoverOptionsattribute of thebutton.hint-popoverelement has been set totrue.
ListComponent
- The
displayCloseButtonproperty in thecxPopoverOptionsattribute of thebutton.hint-popoverelement has been set totrue. ng-selectfor sort has been wrapped bylabelandspanhas been added before.
UserGroupUserListComponent
- The
MessageServicewas removed from the constructor.
ToggleStatusComponent
- The
FeatureConfigServicewas removed from the constructor. - The
DisableInfoServicewas added to the constructor.
DeleteItemComponent
- The
FeatureConfigServicewas removed from the constructor.
UnitChildrenComponent
- The
CurrentUnitServiceis now a required parameter in the component constructor.
UnitCostCenterListComponent
- The
CurrentUnitServiceis now a required parameter in the component constructor.
UnitUserListComponent
- The
CurrentUnitServiceis now a required parameter in the component constructor.
UnitFormComponent
- The
formGroupproperty was renamed toform. - The
form$property was removed.
OrganizationTableType
- The unused
UNIT_ASSIGNED_ROLESproperty was removed from the enum.
HttpErrorModel
- The
errorproperty was removed from the interface.
Organization Related Translations (i18n) Changes
The contents of the following were changed:
orgBudget.messages.deactivateorgCostCenter.messages.deactivateorgPurchaseLimit.messages.deactivateorgUnit.messages.deactivateorgUnitAddress.messages.deleteorgUserGroup.messages.deleteorgUser.messages.deactivate
The following unused keys were removed:
orgBudget.messages.deactivateBodyorgBudget.byNameorgBudget.byUnitNameorgBudget.byCodeorgBudget.byValueorgCostCenter.messages.deactivateBodyorgCostCenter.byNameorgCostCenter.byCodeorgCostCenter.byUnitNameorgPurchaseLimit.messages.deactivateBodyorgPurchaseLimit.byNameorgPurchaseLimit.byUnitNameorgUnit.messages.deactivateBodyorgUnitAddress.messages.deleteBodyorgUserGroup.messages.deleteBodyorgUserGroup.byNameorgUserGroup.byUnitNameorgUserGroup.byGroupIDorgUser.messages.deactivateBodyorgUser.byNameorgUser.byUnitName
Dependencies Changes
- The
i18next-xhr-backendpeer dependency package was replaced withi18next-http-backend. - The
i18nextpeer dependency package was upgraded to version20.2.2
CmsFeaturesService
- The
CmsComponentsServiceconstructor is now usingCmsFeaturesService(replacingFeatureModulesService) andConfigInitializerService. - The
FeatureModulesServicewas removed. It is replaced by theCmsFeaturesService.
ConfigInitializerService
- The
getStableConfigmethod was removed. Use the new equivalentgetStablemethod instead.
CartItemComponent
The CartItemComponent now also requires CartItemContextSource. Furthermore, a customized version of this component now also should provide CartItemContextSource and CartItemContext locally as follows:
@Component({
providers: [
CartItemContextSource,
{ provide: CartItemContext, useExisting: CartItemContextSource },
],
/* ... */
})
ProductListItemComponent and ProductGridItemComponent
The ProductListItemComponent and ProductGridItemComponent now require ProductListItemContextSource. Furthermore, customized versions of those components now also should provide ProductListItemContextSource and ProductListItemContext locally as follows:
@Component({
providers: [
ProductListItemContextSource,
{ provide: ProductListItemContext, useExisting: ProductListItemContextSource },
],
/* ... */
})
CartItemContext and CartItemContextSource
- The
promotionLocation$property has been removed. Uselocation$instead.
User Lib Changes
CMS Components
-
The following modules were moved to
@spartacus/user/profile/components:CloseAccountModuleForgotPasswordModuleRegisterComponentModuleResetPasswordModuleUpdateEmailModuleUpdatePasswordModuleUpdateProfileModule
-
The following modules were moved to
@spartacus/user/account/components:LoginModuleLoginFormModuleLoginRegisterModule
- The
ResetPasswordFormComponentcomponent was renamed toResetPasswordComponentand can now be used from@spartacus/user/profile/components. The logic for this component was also changed. See below for more information. - The
UpdateEmailFormComponentcomponent was removed. UseUpdateEmailComponentfrom@spartacus/user/profile/componentsinstead. - The
UpdatePasswordFormComponentcomponent was removed. UseUpdatePasswordComponentfrom@spartacus/user/profile/componentsinstead. - The
UpdateProfileFormComponentcomponent was removed. UseUpdateProfileComponentfrom@spartacus/user/profile/componentsinstead. - The
CloseAccountComponent,CloseAccountModalComponent,ForgotPasswordComponent,RegisterComponent,UpdateEmailComponent,UpdatePasswordComponent, andUpdateProfileComponentcomponents were moved to@spartacus/user/profile/components. The logic for these components was also changed. See below for more information. - The
LoginComponentandLoginFormComponentcomponents were moved to@spartacus/user/account/components. The logic for these components was also changed. See below for more information. - The
LoginRegisterComponentcomponent was moved to@spartacus/user/account/components.
CloseAccountModalComponent
- All services used in the constructor have been changed to
protected. - The component no longer uses the
UserService. - The
UserProfileFacadewas introduced. - The component no longer uses the
Subscriptionproperty. - The
ngOnDestroymethod was removed.
ForgotPasswordComponent
- The
forgotPasswordFormproperty was renamed toform. - A new observable
isUpdating$property was added. - The
ngOnInitandrequestForgotPasswordEmailmethods were removed. A newonSubmitmethod was added. - The
FormBuilder,UserService,RoutingService, andAuthConfigServiceservices are no longer used directly in the component file. A newForgotPasswordComponentServiceservice was added and is used in the constructor. - The change detection strategy for this component was set to
OnPush. - There were slight changes in the component template. A spinner component was added which relies on the
isUpdating$property. Also, the form is now using theonSubmitmethod for form submit events.
RegisterComponent
- The component no longer uses
UserService. - The
UserRegisterFacadewas introduced. - The
loading$property was changed toisLoading$and the type was changed fromObservable<boolean>toBehaviorSubject<boolean>. - The
registerUserProcessInitmethod was removed.
ResetPasswordComponent (Previously ResetPasswordFormComponent)
- The
subscriptionproperty was removed. - The type of the
tokenproperty was changed fromstringtoObservable<string>. - The
resetPasswordFormproperty was renamed toform. - A new observable
isUpdating$property was added. - The
ngOnInit,resetPassword, andngOnDestroymethods were removed. - A new
onSubmitmethod was added. - The
FormBuilder,UserService, andRoutingServiceservices are no longer used directly in the component file. A newResetPasswordComponentServiceservice was added and is used in the constructor. - The change detection strategy for this component was set to
OnPush. - The component template was adapted to the new logic.
- A spinner component was added which relies on the
isUpdating$property.
LoginComponent
- The component no longer uses
UserService. - The
UserAccountFacadewas introduced. - The
userproperty type was changed fromObservable<User>toObservable<User | undefined>.
LoginFormComponent
- The
AuthService,GlobalMessageService,FormBuilder, andWindowRefservices are no longer used directly in the component file. A newLoginFormComponentServiceservice was added and is used in the constructor. - The
ngOnInit,submitForm, andloginUsermethods were removed from the component file. - New
formandisUpdating$properties were added. - New
onSubmitmethod was added. - The change detection strategy for this component was set to
OnPush. - A spinner component was added to the template which relies on the
isUpdating$property.
UpdateEmailComponent
- The
subscription,newUid, andisLoading$properties were removed. - The
ngOnInit,onCancel,onSuccess, andngOnDestroymethods were removed from the component file. - The
GlobalMessageService,UserService,RoutingService, andAuthServiceservices are no longer used directly in the component file. A newUpdateEmailComponentServiceservice was added and is used in the constructor. - The logic for the
onSubmitmethod was changed. Now this method has no parameters. - New
formandisUpdating$properties were added. - There were important change in the component template. Because the
UpdateEmailFormComponentwas removed, theUpdateEmailComponentnow contains the template for the update email form itself. - The change detection strategy for this component was set to
OnPush. - A spinner component was added to the template which relies on the
isUpdating$property.
UpdateEmailComponentService
- The
UpdateEmailComponentServicenow also requires theAuthRedirectService.
UpdatePasswordComponent
- The
subscriptionandloading$properties were removed. - The
ngOnInit,onCancel,onSuccess, andngOnDestroymethods were removed from the component file. - The
RoutingService,UserService, andGlobalMessageServiceservices are no longer used directly in the component file. A newUpdatePasswordComponentServiceservice was added and is used in the constructor. - The logic for the
onSubmitmethod was changed. Now this method has no parameters. - New
formandisUpdating$properties were added. - There were important change in the component template. Because the
UpdatePasswordFormComponentwas removed, theUpdatePasswordComponentnow contains the template for the update password form itself. - The change detection strategy for this component was set to
OnPush. - A spinner component was added to the template which relies on the
isUpdating$property.
UpdateProfileComponent
- THe
user$andloading$properties were removed. - The
ngOnInit,onCancel,onSuccess, andngOnDestroymethods were removed from the component file. - The
RoutingService,UserService, andGlobalMessageServiceservices are no longer used directly in the component file. A newUpdateProfileComponentServiceservice was added and is used in the constructor. - The logic for the
onSubmitmethod was changed. Now this method has no parameters. - New
formandisUpdating$properties were added. - There were important change in the component template. Because the
UpdateProfileFormComponentwas removed, theUpdateProfileComponentnow contains the template for the update profile form itself. - The change detection strategy for this component was set to
OnPush. - A spinner component was added to the template which relies on the
isUpdating$property.
MyCouponsComponent
- The
divthat wrapped thecx-sortingcomponent has been changed tolabelwith aspanadded before.
OccUserAdapter
- The
OccUserAdapterwas removed. Use theOccUserAccountAdapterfrom@spartacus/user/account/occand theOccUserProfileAdapterfrom@spartacus/user/profile/occinstead. - The
removemethod was removed. Use theclosemethod instead.
UserAdapter
- The
UserAdapterwas removed. Use theUserAccountAdapterfrom@spartacus/user/account/coreand theUserProfileAdapterfrom@spartacus/user/profile/coreinstead. - The
removemethod was removed. Use theclosemethod instead.
UserConnector
- The
UserConnectorwas removed. Use theUserAccountConnectorfrom@spartacus/user/account/coreand theUserProfileConnectorfrom@spartacus/user/profile/coreinstead. - The
removemethod now returns theclosemethod from the adapter (name change).
OccEndpoints
- The
userendpoint was removed from the declaration in@spartacus/core. It is now provided through module augmentation from@spartacus/user/account/occ. The default value is also provided from this new entry point. - The
titles,userRegister,userForgotPassword,userResetPassword,userUpdateLoginId,userUpdatePassword,userUpdateProfile, anduserCloseAccountendpoints were removed from the declaration in@spartacus/core. These endpoints are now provided through module augmentation from@spartacus/user/profile. Default values are also provided from this new entry point.
UserService
- The
getmethod was changed, and now fully relies onUserAccountFacade.get()from@spartacus/user. - The
loadmethod was removed. UseUserAccountFacade.get()from@spartacus/userinstead. - The
registermethod was removed. UseUserRegisterFacade.register()from@spartacus/userinstead. - The
registerGuestmethod was removed. UseUserRegisterFacade.registerGuest()from@spartacus/userinstead. - The
getRegisterUserResultLoadingmethod was removed. Instead, subscribe toUserRegisterFacade.register()from@spartacus/userto get the loading state. - The
getRegisterUserResultSuccessmethod was removed. Instead, subscribe toUserRegisterFacade.register()from@spartacus/userto get the success state. - The
getRegisterUserResultErrormethod was removed. Instead, subscribe toUserRegisterFacade.register()from@spartacus/userto get the error state. - The
resetRegisterUserProcessStatemethod was removed and is no longer needed ifUserRegisterFacade.register()from@spartacus/userwas used. - The
removemethod was removed. UseUserProfileFacade.close()from@spartacus/userinstead. - The
loadTitlesmethod was removed. UseUserProfileFacade.getTitles()from@spartacus/userinstead. - The
getRemoveUserResultLoadingmethod was removed. Instead, subscribe toUserProfileFacade.close()from@spartacus/userto get the loading state. - The
getRemoveUserResultSuccessmethod was removed. Instead, subscribe toUserProfileFacade.close()from@spartacus/userto get the success state. - The
getRemoveUserResultErrormethod was removed. Instead, subscribe toUserProfileFacade.close()from@spartacus/userto get the error state. - The
resetRemoveUserProcessStatemethod was removed and is no longer needed ifUserProfileFacade.close()from@spartacus/userwas used. - The
isPasswordResetmethod was removed. Instead, subscribe toUserPasswordFacade.reset()from@spartacus/userto get the success state. - The
updatePersonalDetailsmethod was removed. UseUserProfileFacade.update()from@spartacus/userinstead. - The
getUpdatePersonalDetailsResultLoadingmethod was removed. Instead, subscribe toUserProfileFacade.update()from@spartacus/userto get the loading state. - The
getUpdatePersonalDetailsResultErrormethod was removed. Instead, subscribe toUserProfileFacade.update()from@spartacus/userto get the error state. - The
getUpdatePersonalDetailsResultSuccessmethod was removed. Instead, subscribe toUserProfileFacade.update()from@spartacus/userto get the success state. - The
resetUpdatePersonalDetailsProcessingStatemethod was removed and is no longer needed ifUserProfileFacade.update()from@spartacus/userwas used. - The
resetPasswordmethod was removed. UseUserPasswordFacade.reset()from@spartacus/userinstead. - The
requestForgotPasswordEmailmethod was removed. UseUserPasswordFacade.requestForgotPasswordEmail()from@spartacus/userinstead. - The
updateEmailmethod was removed. UseUserEmailFacade.update()from@spartacus/userinstead. - The
getUpdateEmailResultLoadingmethod was removed. Instead, subscribe toUserEmailFacade.update()from@spartacus/userto get the loading state. - The
getUpdateEmailResultSuccessmethod was removed. Instead, subscribe toUserEmailFacade.update()from@spartacus/userto get the success state. - The
getUpdateEmailResultErrormethod was removed. Instead, subscribe toUserEmailFacade.update()from@spartacus/userto get the error state. - The
resetUpdateEmailResultStatemethod was removed and is no longer needed ifUserEmailFacade.update()from@spartacus/userwas used. - The
updatePasswordmethod was removed. UseUserPasswordFacade.update()from@spartacus/userinstead. - The
getUpdatePasswordResultLoadingmethod was removed. Instead, subscribe toUserPasswordFacade.update()from@spartacus/userto get the loading state. - The
getUpdatePasswordResultErrormethod was removed. Instead, subscribe toUserPasswordFacade.update()from@spartacus/userto get the error state. - The
getUpdatePasswordResultSuccessmethod was removed. Instead, subscribe toUserPasswordFacade.update()from@spartacus/userto get the success state. - The
resetUpdatePasswordProcessStatemethod was removed and is no longer needed ifUserPasswordFacade.update()from@spartacus/userwas used.
UserModule
- The
UserModulewas removed. The main modules currently areUserAccountModulein@spartacus/user/accountandUserProfileModulein@spartacus/user/profile.
Occ Endpoint Models
- The
UserSignUpmodel was moved to the@spartacus/user/profilelibrary.
NgRx State of the User Feature
The 'account', 'titles', and 'resetPassword' branches of the NgRx state for the User feature were removed. Please use the new approach with Queries and Commands that is defined in the new facades in @spartacus/user the library, as follows:
UserAccountFacadefrom'@spartacus/user/account/root'UserEmailFacadefrom'@spartacus/user/profile/root'UserPasswordFacadefrom'@spartacus/user/profile/root'UserProfileFacadefrom'@spartacus/user/profile/root'UserRegisterFacadefrom'@spartacus/user/profile/root'
The following items related to the NgRx state were removed from @spartacus/core:
- Actions:
ForgotPasswordEmailRequestForgotPasswordEmailRequestFailForgotPasswordEmailRequestSuccessResetPasswordResetPasswordFailResetPasswordSuccessLoadTitlesLoadTitlesFailLoadTitlesSuccessUpdateEmailActionUpdateEmailSuccessActionUpdateEmailErrorActionResetUpdateEmailActionUpdatePasswordUpdatePasswordFailUpdatePasswordSuccessUpdatePasswordResetLoadUserDetailsLoadUserDetailsFailLoadUserDetailsSuccessUpdateUserDetailsUpdateUserDetailsFailUpdateUserDetailsSuccessResetUpdateUserDetailsRegisterUserRegisterUserFailRegisterUserSuccessResetRegisterUserProcessRegisterGuestRegisterGuestFailRegisterGuestSuccessRemoveUserRemoveUserFailRemoveUserSuccessRemoveUserReset
- Effects:
ForgotPasswordEffectsResetPasswordEffectsTitlesEffectsUpdateEmailEffectsUpdatePasswordEffectsUserDetailsEffectsUserRegisterEffects
- Selectors:
getResetPasswordgetDetailsStategetDetailsgetTitlesStategetTitlesEntitesgetAllTitlestitleSelectorFactory
- Reducers for the
account,titles, andresetPasswordstates were removed.
Connectors
TITLE_NORMALIZERwas moved to@spartacus/user/profile.USER_SIGN_UP_SERIALIZERwas moved to@spartacus/user/profile.USER_SERIALIZERwas removed. UseUSER_ACCOUNT_SERIALIZERfrom@spartacus/user/accountandUSER_PROFILE_SERIALIZERfrom@spartacus/user/profileinstead.USER_NORMALIZERwas removed. UseUSER_ACCOUNT_NORMALIZERfrom@spartacus/user/accountandUSER_PROFILE_NORMALIZERfrom@spartacus/user/profileinstead.
StoreFinderListItemComponent
- The
div[class.cx-store-name]element was changed toh2[class.cx-store-name].
StoreFinderStoresCountComponent
- The
div[class.cx-title]element was changed toh2[class.cx-title].
StoreFinderListItemComponent
- The
div[class.cx-total]element was changed toh4[class.cx-total].
CartItemComponent
- The `` element was changed to
<h2></h2>.
OrderSummaryComponent
- The
<h4>orderCost.orderSummary</h4>element was changed to<h3>orderCost.orderSummary</h3>.
DeliveryModeComponent
- The
h3[class.cx-checkout-title]element was changed toh2[class.cx-checkout-title].
PaymentMethodComponent
- The
h3[class.cx-checkout-title]element was changed toh2[class.cx-checkout-title].
ReviewSubmitComponent
- The
h3[class.cx-review-title]element was changed toh2[class.cx-review-title]. - The
div[class.cx-review-cart-total]element was changed toh4[class.cx-review-cart-total].
ShippingAddressComponent
- The
h3[class.cx-checkout-title]element was changed toh2[class.cx-checkout-title].
CmsPageTitleComponent
- A new interface has been created.
CmsBreadcrumbsComponent
- The
CmsBreadcrumbsComponentnow extends theCmsPageTitleComponent. - The
containerproperty has been moved to theCmsPageTitleComponent.
BreadcrumbComponent
- The
BreadcrumbComponentnow extends thePageTitleComponent. - The
setTitle()function has been moved to thePageTitleComponent.
PageTitleComponent
- The
PageTitleComponentis a new component that sets the page title if there is not one set by default.
NavigationUiComponent
- The
<h5><cx-icon ...></h5>element was changed to<span><cx-icon ...></span>. - The
h5[attr.aria-label]="node.title"element was changed tospan[attr.aria-label]="node.title".
ProductCarouselComponent
- The
<h4></h4>element was changed to<h3></h3>.
WishListItemComponent
- The
<a></a>element was changed to<a><h2></h2></a>.
CardComponent
- The
h4[class.cx-card-title]element was changed toh3[class.cx-card-title].
CarouselComponent
- The
<h3 *ngIf="title"></h3>element was changed to<h2 *ngIf="title"></h2>.
AddedToCartDialogComponent
- The
[attr.aria-label]="'common.close' | cxTranslate"element was changed toattr.aria-label="addToCart.closeModal".
Translations (i18n) changes
- The
miniLogin.userGreetingkey was moved to a separate library. It is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
miniLogin.signInRegisterkey was moved to the separate@spartacus/userlibrary. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.signInkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.registerkey was moved to a separate library. It is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.dontHaveAccountkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.guestCheckoutkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.emailAddress.labelkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.emailAddress.placeholderkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.password.labelkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.password.placeholderkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.wrongEmailFormatkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
loginForm.forgotPasswordkey was moved to a separate library. Is is now a part ofuserAccountTranslations,userAccountTranslationChunksConfigfrom@spartacus/user/account/assets. - The
updateEmailForm.newEmailAddress.labelkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.newEmailAddress.placeholderkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.confirmNewEmailAddress.labelkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.confirmNewEmailAddress.placeholderkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.enterValidEmailkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.bothEmailMustMatchkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.password.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.password.placeholderkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.pleaseInputPasswordkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
updateEmailForm.emailUpdateSuccesskey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.resetPasswordkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.enterEmailAddressAssociatedWithYourAccountkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.emailAddress.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.emailAddress.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.enterValidEmailkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.passwordResetEmailSentkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
forgottenPassword.passwordResetSuccesskey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.confirmPassword.actionkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.confirmPassword.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.confirmPassword.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.managementInMyAccountkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.termsAndConditionskey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.signInkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.registerkey was moved to a separate library. Is is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.confirmNewPasswordkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.resetPasswordkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.createAccountkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.titlekey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.firstName.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.firstName.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.lastName.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.lastName.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.emailAddress.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.emailAddress.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.password.labelkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.password.placeholderkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.newPasswordkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.emailMarketingkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.confirmThatReadkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.selectTitlekey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.passwordMinRequirementskey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.bothPasswordMustMatchkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.titleRequiredkey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
register.postRegisterMessagekey was moved to a separate library. It is now a part ofuserProfileTranslations,userProfileTranslationChunksConfigfrom@spartacus/user/profile/assets. - The
myCoupons.sortByMostRecentkey has been removed. UsemyCoupons.sortByinstead. - The
myInterests.sortByMostRecentkey has been removed. UsemyInterests.sortByinstead. - The
orderHistory.sortByMostRecentkey has been removed. UseorderHistory.sortByinstead. - The
returnRequestList.sortByMostRecentkey has been removed. UsereturnRequestList.sortByinstead. - The
productList.sortByMostRecentkey has been removed. UseproductList.sortByinstead.
Default Routing Configuration for the My Company Feature
The default routing configuration for the My Company pages was moved from various modules in @spartacus/organization/administration/components to OrganizationAdministrationRootModule in @spartacus/organization/administration/root. As a result, the default configuration is now provided eagerly, so it is available early on app start (but not only after the feature is lazy loaded). Also, the following objects were renamed and moved to @spartacus/organization/administration/root:
budgetRoutingConfigwas renamed todefaultBudgetRoutingConfigcostCenterRoutingConfigwas renamed todefaultCostCenterRoutingConfigpermissionRoutingConfigwas renamed todefaultPermissionRoutingConfigunitsRoutingConfigwas renamed todefaultUnitsRoutingConfiguserGroupRoutingConfigwas renamed todefaultUserGroupRoutingConfiguserRoutingConfigwas renamed todefaultUserRoutingConfig
Checkout-Related Translations (i18n) Changes
The checkout-related translation keys were moved to @spartacus/checkout/assets. If you use any checkout-related labels outside of checkout and the checkout library is not used, you will need to use alternate translation labels.
- The
checkoutAddress.verifyYourAddresskey is moved toaddressSuggestion.verifyYourAddress. - The
checkoutAddress.ensureAccuracySuggestChangekey is moved toaddressSuggestion.ensureAccuracySuggestChange. - The
checkoutAddress.chooseAddressToUsekey is moved toaddressSuggestion.chooseAddressToUse. - The
checkoutAddress.suggestedAddresskey is moved toaddressSuggestion.suggestedAddress. - The
checkoutAddress.enteredAddresskey is moved toaddressSuggestion.enteredAddress. - The
checkoutAddress.editAddresskey is moved toaddressSuggestion.editAddress. - The
checkoutAddress.saveAddresskey is moved toaddressSuggestion.saveAddress. - The
checkoutOrderConfirmation.replenishmentNumberkey is removed. You can use `` instead. - The
checkoutOrderConfirmation.placedOnkey is removed. You can useorderDetails.placedOninstead. - The
checkoutOrderConfirmation.statuskey is removed. You can useorderDetails.statusinstead. - The
checkoutOrderConfirmation.activekey is removed. You can useorderDetails.activeinstead. - The
checkoutOrderConfirmation.cancelledkey is removed. You can useorderDetails.cancelledinstead. - The
checkoutOrderConfirmation.frequencykey is removed. You can useorderDetails.frequencyinstead. - The
checkoutOrderConfirmation.nextOrderDatekey is removed. You can useorderDetails.nextOrderDateinstead. - The
checkoutOrderConfirmation.orderNumberkey is removed. You can useorderDetails.orderNumberinstead.
Changes in Styles
-
The styles for the following selectors were moved from
@spartacus/stylesto@spartacus/user/profile/styles:cx-close-account-modalcx-close-accountcx-forgot-passwordcx-registercx-update-password-formcx-user-form
-
The styles for the following selectors were moved from
@spartacus/stylesto@spartacus/user/account/styles:cx-logincx-login-form
LogoutGuard
AuthRedirectServiceis a new, required constructor dependency.
RoutingService
- The
RoutingService.gosignature was changed. Prior to 4.0, an object with query params could be passed in the second argument. Now, the second argument is an AngularNavigationExtrasobject (with a'queryParams'property). - The
RoutingService.navigatesignature was changed. Prior to 4.0, an object with query params could be passed in the second argument. Now, the second argument is an AngularNavigationExtrasobject (with a'queryParams'property).
RoutingActions RgRx
The following NgRx actions have been removed:
RoutingActions.RouteGo(andRoutingActions.ROUTER_GO). Use thego()method of the theRoutingServiceinstead.RoutingActions.RouteGoByUrlAction(andRoutingActions.ROUTER_GO_BY_URL). Use thegoByUrl()method of the theRoutingServiceinstead.RoutingActions.RouteBackAction(andRoutingActions.ROUTER_BACK). Use theback()method of the theRoutingServiceinstead.RoutingActions.RouteForwardAction(andRoutingActions.ROUTER_FORWARD). Use theforward()method of the theRoutingServiceinstead.
AuthRedirectService
- The
#reportNotAuthGuardmethod is not needed anymore. Every visited URL is now remembered automatically as a redirect URL on aNavigationEndevent. - The
#reportAuthGuardmethod is deprecated. Use the new#saveCurrentNavigationUrlmethod instead. It remembers the anticipated page when being invoked during the navigation.
OccEndpointsService
- The
getEndpointmethod was removed. UsebuildUrlinstead, with theendpointstring and thepropertiesToOmitmatching your desired URL. - The
getOccEndpointmethod was removed. UsebuildUrlinstead, with theendpointstring and thepropertiesToOmitmatching your desired URL. - The
getBaseEndpointmethod was removed. UsebuildUrlmethod instead, with configurable endpoints or thegetBaseUrlmethod. - The
getUrlmethod was removed. Use thebuildUrlmethod instead. ThebuildUrlmethod has the same first parameter asgetUrl. The second, third and fourth parameters ofgetUrlare merged into the second argument object ofbuildUrlwith theurlParams,queryParamsandscopeproperties. - The
getRawEndpointmethod was removed. UsebuildUrlwith configurable endpoints or thegetRawEndpointValuemethod instead.
Modal Service
- The
FeatureConfigServicewas removed from the constructor. ApplicationRefis a new, required constructor dependency.
ExternalJsFileLoader
- The service was removed from
@spartacus/core. UseScriptLoaderinstead.
CxApi
-
The following public members of
CxApiwere removed:CheckoutServiceCheckoutDeliveryServiceCheckoutPaymentService
TabParagraphContainerComponent
WindowRefandBreakpointServiceare now required parameters in the constructor.- All services used in constructor have been changed to
protected.
b2cLayoutConfig
b2cLayoutConfigwas removed from@spartacus/storefront. Use the layout from the corresponding feature library instead.
UnitAddressFormService
- The
UserServiceparam that was imported from@spartacus/corewas removed from the constructor. Instead, a newUserAddressServiceparam from@spartacus/user/profile/rootwas added.
GuestRegisterFormComponent
- The
UserServiceparam that was imported from@spartacus/corewas removed from the constructor. Instead, a newUserRegisterFacadeparam from@spartacus/user/profile/rootwas added.
UserIdService
- The
invokeWithUserIdmethod was removed. UsetakeUserIdinstead.
PopoverDirective
- The
PopoverDirectiveclass now implementsngOnInit. - The
PositioningServicewas removed from the constructor. - The
openPopoverandclosePopoverevent emitters are no longer optional. - A new
eventSubject: Subject<PopoverEvent>property was added. - The
handleOpenandtogglemethods were removed. - The following new methods were added:
handleEscapehandleClickhandlePresshandleTab
PopoverService
- The
eventargument of thegetFocusConfigmethod changed type fromEventtoPopoverEvent.
PopoverComponent
- The
insideClickedproperty was removed. button.closehas been moved into adiv.cx-close-row
OnNavigateFocusService
- The
documentinjection param was removed from the constructor. - The
WindowRefparam was added into the constructor.
Facade Factories Are Now Inlined
- Facade factories are now inlined into an
@Injectabledecorator. The following symbols are not needed anymore and were removed:userAccountFacadeFactoryUserEmailFacadeFactoryUserPasswordFacadeFactoryUserProfileFacadeFactoryUserRegisterFacadeFactorysavedCartFacadeFactorycdcAuthFacadeFactory