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
provideConfig
function changed type fromany
toConfig
. - The first parameter of the
provideDefaultConfig
function changed type fromany
toConfig
.
ConfigModule
- The parameter of the
withConfig
method changed type fromobject
toConfig
. - The parameter of the
forRoot
method changed type fromany
toConfig
.
Config Injection Tokens
- The
Config
injection token was replaced with an injectableConfig
abstract class. - The
ConfigChunk
injection token changed type fromobject[]
toConfig[]
. - The
DefaultConfigChunk
injection 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
getStable
method’s return signature has changed fromObservable<any>
toObservable<Config>
. - The
getStableConfig
method’s return signature has changed fromPromise<any>
toPromise<Config>
.
Config Validators
- The
ConfigValidator
type changed from(config: any) => string | void
to(config: Config) => string | void
. - The first parameter of the
validateConfig
function changed fromany
toConfig
.
ConfigInitializer
- The
ConfigInitializer.configFactory
signature changed from() => Promise<any>
to() => Promise<Config>
.
ConfigurationService
- The
unifiedConfig$
type changed fromObservable<any>
toObservable<Config>
. - The
config
type changed fromany
toConfig
. -
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
isFeatureLevel
changed fromunknown
toConfig
. - The first parameter type of
isFeatureEnabled
changed fromunknown
toConfig
.
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
getMedia
method now supports therole
attribute
ModalService
- The
ModalService
no longer depends on theFeatureConfigService
, but theApplicationRef
is now a new required dependency.
Product Configurator Configuration
- The
productConfigurator
configuration option is now optional (theupdateDebounceTime
andcpq
properties from this option are now also optional). - The
backend.cpq
configuration option is now optional.
SmartEditConfig
- The
smartEdit
property is optional. - The
smartEdit.storefrontPreviewRoute
property is optional. - The
smartEdit.allowOrigin
property is optional.
PersonalizationConfig
- The
personalization
property is optional.
CmsStructureConfig
- The
cmsStructure
property 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
.
CheckoutCostCenterFacade
should be used instead ofCheckoutCostCenterService
.CheckoutDeliveryFacade
should be used instead ofCheckoutDeliveryService
.CheckoutPaymentFacade
should be used instead ofCheckoutPaymentService
.CheckoutFacade
should be used instead ofCheckoutService
.PaymentTypeFacade
should be used instead ofPaymentTypeService
.ClearCheckoutFacade
should be used instead ofClearCheckoutService
.
ExpressCheckoutService
- The service moved from the
@spartacus/storefront
entry point to@spartacus/checkout/components
. - The
CheckoutDeliveryService
constructor parameter is replaced with theCheckoutDeliveryFacade
from@spartacus/checkout/root
. - The
CheckoutPaymentService
constructor parameter is replaced with theCheckoutPaymentFacade
from@spartacus/checkout/root
. - The
CheckoutDetailsService
constructor parameter is now imported from@spartacus/checkout/components
. - The
CheckoutConfigService
constructor parameter is now imported from@spartacus/checkout/components
. - The
ClearCheckoutService
constructor parameter is replaced with the requiredClearCheckoutFacade
from@spartacus/checkout/root
. - The
resetCheckoutProcesses
method was removed. Use theresetCheckoutProcesses
method from theClearCheckoutFacade
instead.
CostCenterComponent
- The constructor parameter changed type from
CheckoutCostCenterService
toCheckoutCostCenterFacade
. - The constructor parameter changed type from
PaymentTypeService
toPaymentTypeFacade
.
DeliveryModeComponent
- The constructor parameter changed type from
CheckoutDeliveryService
toCheckoutDeliveryFacade
.
PaymentMethodComponent
- The constructor parameter changed type from
CheckoutService
toCheckoutFacade
. - The constructor parameter changed type from
CheckoutDeliveryService
toCheckoutDeliveryFacade
. - The constructor parameter changed type from
CheckoutPaymentService
toCheckoutPaymentFacade
.
PaymentFormComponent
- The constructor parameter changed type
CheckoutPaymentService
toCheckoutPaymentFacade
. - The constructor parameter changed type from
CheckoutDeliveryService
toCheckoutDeliveryFacade
. - The
PaymentFormComponent
does not implementOnDestroy
anymore. - The
ngOnDestroy()
method was removed. - Address verification uses a new
UserAddressService.verifyAddress
function instead ofCheckoutDeliveryService.verifyAddress
. - The expiration date has been wrapped to
fieldset
instead oflabel
. Thespan
has been replaced bylegend
and there are newlabel
instead ofdiv
for every form control (expiration month, expiration year).
PaymentTypeComponent
- The constructor parameter changed type from
PaymentTypeService
toPaymentTypeFacade
.
PlaceOrderComponent
- The constructor parameter changed type from
CheckoutService
toCheckoutFacade
.
ReviewSubmitComponent
- The constructor parameter changed type from
CheckoutDeliveryService
toCheckoutDeliveryFacade
. - The constructor parameter changed type from
CheckoutPaymentService
toCheckoutPaymentFacade
. - The constructor parameter changed type from
PaymentTypeService
toPaymentTypeFacade
. - The constructor parameter changed type from
CheckoutCostCenterService
toCheckoutCostCenterFacade
. - The
PromotionService
constructor 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
CheckoutService
toCheckoutFacade
.
ShippingAddressComponent
- The constructor parameter changed type from
CheckoutDeliveryService
toCheckoutDeliveryFacade
. - The constructor parameter changed type from
PaymentTypeService
toPaymentTypeFacade
. - The constructor parameter changed type from
CheckoutCostCenterService
toCheckoutCostCenterFacade
.
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): void
clearAddressVerificationResults(): void
These functions are also not present in the corresponding CheckoutDeliveryFacade
facade.
CheckoutState
- The
addressVerification: AddressVerificationState
property is removed from theCheckoutState
class in the checkout library.
AddressVerificationState
- The
AddressVerificationState
class 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
PromotionService
constructor parameter was removed. - The
orderPromotions$
attribute was removed. - The component gets promotions directly from the order in the HTML template.
OccCheckoutAdapter
- The protected
getEndpoint
method has been removed. - The following are new methods:
getPlaceOrderEndpoint
getRemoveDeliveryAddressEndpoint
getClearDeliveryModeEndpoint
getLoadCheckoutDetailsEndpoint
OccCheckoutPaymentAdapter
- The protected
getCartEndpoint
method has been removed. - The following are new methods:
getCardTypesEndpoint
getCreatePaymentDetailsEndpoint
getPaymentProviderSubInfoEndpoint
getSetPaymentDetailsEndpoint
OccCheckoutCostCenterAdapter
- The protected
getCartEndpoint
method has been removed. - The new method is
getSetCartCostCenterEndpoint
.
OccCheckoutDeliveryAdapter
- The protected
getCartEndpoint
method has been removed. - The following are new methods:
getCreateDeliveryAddressEndpoint
getDeliveryModeEndpoint
getDeliveryModesEndpoint
getSetDeliveryAddressEndpoint
getSetDeliveryModeEndpoint
OccCheckoutPaymentTypeAdapter
- The protected
getCartEndpoint
method has been removed. - The following are new methods:
getPaymentTypesEndpoint
getSetCartPaymentTypeEndpoint
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
platformId
injection 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
StoreDataService
has been replaced by theStoreFinderService
.
StoreFinderListItemComponent
- The
StoreDataService
has been replaced by theStoreFinderService
.
StoreFinderListComponent
- The
StoreDataService
has been replaced by theStoreFinderService
.
StoreFinderStoreDescriptionComponent
- The
StoreDataService
has been replaced by theStoreFinderService
.
GoogleMapRendererService
- The
StoreDataService
has been replaced by theStoreFinderService
. - The
ExternalJsFileLoader
has been replaced by theScriptLoader
.
ScheduleComponent
- The
ngOnChanges()
method has been changed to thengOnInit()
method, along with the corresponding class implementations (for example, implementsOnChanges
toOnInit
). - The
displayDays
variable has been removed. UseweekDays
instead. - The
StoreDataService
has been removed`. - The
getStoreOpeningTime()
,getStoreClosingTime()
, andgetInitialDate()
methods have been removed. UseweekDayOpeningList
fromlocation
instead.
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
ClearCheckoutService
was removed from the constructor.
SavedCartListComponent
- The
ClearCheckoutService
was removed from the constructor.
SavedCartFormDialogComponent
- The
ClearCheckoutService
was 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
PromotionService
constructor parameter was removed. - The
orderPromotions$
attribute was removed. - The component gets promotions directly from the cart in the HTML template.
- The
increment
property was removed. Use thenumberOfEntriesBeforeAdd
property instead.
CartDetailsComponent
- The
PromotionService
constructor parameter was removed. - The
orderPromotions$
andpromotions$
attributes were removed. - The component gets promotions directly from the cart in the HTML template.
CartItemComponent
- The
PromotionService
constructor 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
FeatureConfigService
constructor dependency was removed. - New required constructor dependencies were added:
UserIdService
andMultiCartService
.
OrderDetailItemsComponent
- The
PromotionService
constructor 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.verifyYourAddress
key is replaced byaddressSuggestion.verifyYourAddress
. - The
checkoutAddress.ensureAccuracySuggestChange
key is replaced byaddressSuggestion.ensureAccuracySuggestChange
. - The
checkoutAddress.chooseAddressToUse
key is replaced byaddressSuggestion.chooseAddressToUse
. - The
checkoutAddress.suggestedAddress
key is replaced byaddressSuggestion.suggestedAddress
. - The
checkoutAddress.enteredAddress
key is replaced byaddressSuggestion.enteredAddress
. - The
checkoutAddress.editAddress
key is replaced byaddressSuggestion.editAddress
. - The
checkoutAddress.saveAddress
key is replaced byaddressSuggestion.saveAddress
.
OrderOverviewComponent
The OrderOverviewComponent
uses different translation label keys:
- The
checkoutOrderConfirmation.replenishmentNumber
key is replaced byorderDetails.replenishmentId
. - The
checkoutOrderConfirmation.status
key is replaced byorderDetails.status
. - The
checkoutOrderConfirmation.active
key is replaced byorderDetails.active
. - The
checkoutOrderConfirmation.cancelled
key is replaced byorderDetails.cancelled
. - The
checkoutReview.startOn
key is replaced byorderDetails.startOn
. - The
checkoutOrderConfirmation.frequency
key is replaced byorderDetails.frequency
. - The
checkoutOrderConfirmation.nextOrderDate
key is replaced byorderDetails.nextOrderDate
. - The
checkoutOrderConfirmation.orderNumber
key is replaced byorderDetails.orderNumber
. - The
checkoutOrderConfirmation.placedOn
key is replaced byorderDetails.placedOn
. - The
checkoutReview.poNumber
key is replaced byorderDetails.purchaseOrderNumber
. - The
checkoutPO.noPoNumber
key is replaced byorderDetails.emptyPurchaseOrderId
. - The
checkoutProgress.methodOfPayment
key is replaced byorderDetails.methodOfPayment
. - The
checkoutPO.costCenter
key is replaced byorderDetails.costCenter
. - The
checkoutShipping.shippingMethod
key is replaced byorderDetails.shippingMethod
. - The
getOrderCurrentDateCardContent
method requires theisoDate
parameter. It is no longer optional.
Qualtrics Changes
QualtricsConfig
was removed from the@spartacus/storefrontlib
. Use@spartacus/qualtrics/components
instead.QUALTRICS_EVENT_NAME
was removed from the@spartacus/storefrontlib
. Use@spartacus/qualtrics/components
instead.QualtricsLoaderService
was removed from@spartacus/storefrontlib
. Use@spartacus/qualtrics/components
instead.QualtricsLoaderService
from the feature library no longer requiresRendererFactory2
. It has been replaced byScriptLoader
.QualtricsComponent
was removed from@spartacus/storefrontlib
. Use@spartacus/qualtrics/components
instead.QualtricsModule
was removed from@spartacus/storefrontlib
, and renamedQualtricsComponentsModule
. Use@spartacus/qualtrics/components
instead.
OccConfigLoaderModule
- The
OccConfigLoaderModule
was removed. UseSiteContextConfigInitializer
andI18nConfigInitializer
instead.
OccConfigLoaderService
- The
OccConfigLoaderService
was removed. UseSiteContextConfigInitializer
andI18nConfigInitializer
instead.
OccLoadedConfigConverter
- The
OccLoadedConfigConverter
was removed. UseSiteContextConfigInitializer
andI18nConfigInitializer
instead.
OccLoadedConfig
- The
OccLoadedConfig
was removed. UseSiteContextConfigInitializer
andI18nConfigInitializer
instead.
OccSitesConfigLoader
- The
OccSitesConfigLoader
was removed. UseSiteContextConfigInitializer
andI18nConfigInitializer
instead.
OccEndpoints
The backend.occ.endpoints.baseSitesForConfig
config property has been removed. Use backend.occ.endpoints.baseSites
instead.
NavigationUIComponent
- The
HamburgerMenuService
was 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
B2cStorefrontModule
was removed from@spartacus/storefront
- The
B2bStorefrontModule
was removed from@spartacus/setup
- The
StorefrontModule
was removed from@spartacus/storefront
- The
CmsLibModule
was removed from@spartacus/storefront
- The
MainModule
was removed from@spartacus/storefront
- The
StorefrontFoundationModule
was removed from@spartacus/storefront
- The
OccModule
was removed from@spartacus/core
- The
EventsModule
was 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
EventService
now 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: CheckoutService
constructor parameter type is changed tocheckoutFacade: CheckoutFacade
to adapt to the new checkout library. -
The
cartStore: Store<StateWithMultiCart>
constructor parameter has been removed. -
The
ConfiguratorCartService
now 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
getFirstConflictGroup
method has changed fromConfigurator.Group
toConfigurator.Group | undefined
. - The return parameter of the
getMenuParentGroup
method has changed fromConfigurator.Group
toConfigurator.Group | undefined
. - The return parameter of the
getParentGroup
method has changed fromConfigurator.Group
toConfigurator.Group | undefined
. - The return parameter of the
getNextGroupId
method has changed fromObservable<string>
toObservable<string | undefined>
. - The return parameter of the
getPreviousGroupId
method has changed fromObservable<string>
toObservable<string | undefined>
. - The return parameter of the
getNeighboringGroupId
method has changed fromObservable<string>
toObservable<string | undefined>
.
ConfiguratorUtilsService
- The return parameter of the
getParentGroup
method has changed fromConfigurator.Group
toConfigurator.Group | undefined
.
New and Renamed Dependencies
ConfiguratorCartEntryInfoComponent
now also requiresCommonConfiguratorUtilsService
.ConfiguratorAttributeCheckboxListComponent
now also requiresConfiguratorAttributeQuantityService
.ConfiguratorAttributeDropDownComponent
now also requiresConfiguratorAttributeQuantityService
.ConfiguratorAttributeInputFieldComponent
now also requiresConfiguratorUISettingsConfig
.ConfiguratorAttributeNumericInputFieldComponent
now also requiresConfiguratorUISettingsConfig
.ConfiguratorAttributeRadiButtonComponent
now also requiresConfiguratorAttributeQuantityService
.ConfiguratorGroupMenuComponent
now also requiresConfiguratorGroupMenuService
andDirectionService
.ConfiguratorStorefrontUtilsService
now also requiresWindowRef
andKeyboardFocusService
.ConfiguratorFormComponent
now also requiresConfiguratorStorefrontUtilsService
.ConfiguratorIssuesNotificationComponent
now also requiresCartItemContext
.ConfiguratorOverviewAttributeComponent
now also requiresBreakpointService
.ConfiguratorUpdateMessageComponent
now requiresConfiguratorMessageConfig
instead 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
NgbTabsetModule
import from@ng-bootstrap/ng-bootstrap
has been replaced withNgbNavModule
to 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.nav
to keep the same appearance.
ASM Changes
- The
AsmModule
was removed from@spartacus/storefrontlib
, and renamed toAsmComponentsModule
. Use@spartacus/asm/components
instead. AsmModule
was removed from@spartacus/core
, and renamed toAsmCoreModule
. Use@spartacus/asm/core
instead.AsmOccModule
was removed from@spartacus/core
. Use@spartacus/asm/occ
instead.OccAsmAdapter
was removed from@spartacus/core
. Use@spartacus/asm/occ
instead.AsmConfig
was removed from@spartacus/core
. Use@spartacus/asm/core
.AsmAdapter
was removed. Use@spartacus/asm/core
instead.AsmConnector
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH_PAGE_NORMALIZER
was removed. Use@spartacus/asm/core
instead.AsmService
was removed. Use@spartacus/asm/core
instead.CsAgentAuthService
was removed. Use@spartacus/asm/root
instead.CustomerSearchPage
was removed. Use@spartacus/asm/core
instead.CustomerSearchOptions
was removed. Use@spartacus/asm/core
instead.AsmUi
was removed. Use@spartacus/asm/core
instead.AsmAuthHttpHeaderService
was removed. Use@spartacus/asm/root
instead.TOKEN_TARGET
was removed. Use@spartacus/asm/root
instead.AsmAuthService
was removed. Use@spartacus/asm/root
instead.AsmAuthStorageService
was removed. Use@spartacus/asm/root
instead.SYNCED_ASM_STATE
was removed. Use@spartacus/asm/core
instead.AsmStatePersistenceService
was removed. Use@spartacus/asm/core
instead.ASM_UI_UPDATE
was removed. Use@spartacus/asm/core
instead.AsmUiUpdate
was removed. Use@spartacus/asm/core
instead.AsmUiAction
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH_FAIL
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH_SUCCESS
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH_RESET
was removed. Use@spartacus/asm/core
instead.CustomerSearch
was removed. Use@spartacus/asm/core
instead.CustomerSearchFail
was removed. Use@spartacus/asm/core
instead.CustomerSearchSuccess
was removed. Use@spartacus/asm/core
instead.CustomerSearchReset
was removed. Use@spartacus/asm/core
instead.CustomerAction
was removed. Use@spartacus/asm/core
instead.LOGOUT_CUSTOMER_SUPPORT_AGENT
was removed. Use@spartacus/asm/core
instead.LogoutCustomerSupportAgent
was removed. Use@spartacus/asm/core
instead.ASM_FEATURE
was removed. Use@spartacus/asm/core
instead.CUSTOMER_SEARCH_DATA
was removed. Use@spartacus/asm/core
instead.StateWithAsm
was removed. Use@spartacus/asm/core
instead.AsmState
was removed. Use@spartacus/asm/core
instead.getAsmUi
was removed. Use@spartacus/asm/core
instead.getCustomerSearchResultsLoaderState
was removed. Use@spartacus/asm/core
instead.getCustomerSearchResults
was removed. Use@spartacus/asm/core
instead.getCustomerSearchResultsLoading
was removed. Use@spartacus/asm/core
instead.getAsmState
was removed. Use@spartacus/asm/core
instead.
LaunchDialogService
SavedCartFormLaunchDialogService
- The
SavedCartFormLaunchDialogService
service has been removed. TheopenDialog
method is part of theLaunchDialogService
now.
AddToSavedCartComponent
- The
SavedCartFormLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
SavedCartDetailsActionComponent
- The
SavedCartFormLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
SavedCartDetailsOverviewComponent
- The
SavedCartFormLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
AnonymousConsentLaunchDialogService
- The
AnonymousConsentLaunchDialogService
service has been removed. TheopenDialog
method is part ofLaunchDialogService
now.
AnonymousConsentManagementBannerComponent
- The
AnonymousConsentLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
AnonymousConsentOpenDialogComponent
- The
AnonymousConsentLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
ReplenishmentOrderCancellationLaunchDialogService
- The
ReplenishmentOrderCancellationLaunchDialogService
service has been removed. TheopenDialog
method is part ofLaunchDialogService
now.
ReplenishmentOrderCancellationComponent
- The
ReplenishmentOrderCancellationLaunchDialogService
was removed from the constructor. - The
LaunchDialogService
was added to the constructor.
OrderHistoryComponent
- The
div
that wrapped thecx-sorting
component has been changed tolabel
andspan
was added before field.
OrderReturnRequestListComponent
- The
div
that wrapped thecx-sorting
component has been changed tolabel
andspan
was added before field.
ReplenishmentOrderHistoryComponent
- The
ReplenishmentOrderCancellationLaunchDialogService
was removed from the constructor. - the
LaunchDialogService
was added to the constructor. - The
div
that wrapped thecx-sorting
component has been changed tolabel
andspan
was added before field.
ProductListComponent
- Two
div
elements that wrapped thecx-sorting
component have been merged to onelabel
andspan
was added before field.
SmartEdit
SmartEditModule
was removed. Use@spartacus/smartedit
instead.SmartEditService
was moved to@spartacus/smartedit/core
.
Personalization
PersonalizationModule
was removed. Use@spartacus/tracking/personalization
instead.PersonalizationConfig
was moved to@spartacus/tracking/personalization/root
.PersonalizationContextService
was moved to@spartacus/tracking/personalization/core
.PersonalizationAction
was moved to@spartacus/tracking/personalization/core
.PersonalizationContext
was moved to@spartacus/tracking/personalization/core
.
WindowRef
platformId
is now a required constructor dependency.
ProductListComponentService
ProductListComponentService
now also requiresViewConfig
.- The
defaultPageSize
property was removed. To modify the default page size, useprovideConfig(<ViewConfig>{ view: { defaultPageSize: <your_default_page_size_value }})
in the module.
Product reloading
- The
reload
method was removed fromProductService
. Instead, use the reloading triggers. - The
EventService
from@spartacus/core
was added as a parameter to the constructor for theProductLoadingService
.
Product Variants Changes
Automated Migrations for Version 4.0
ProductVariantsModule
was removed from@spartacus/storefront
. Use the@spartacus/product/variants
feature library instead.ProductVariantsComponent
was removed from@spartacus/storefront
. UseProductVariantsContainerComponent
from@spartacus/product/variants/components
instead.VariantColorSelectorComponent
was removed from@spartacus/storefront
. UseProductVariantColorSelectorComponent
from@spartacus/product/variants/components
instead.VariantColorSelectorModule
was removed from@spartacus/storefront
. UseProductVariantColorSelectorModule
from@spartacus/product/variants/components
instead.VariantSizeSelectorComponent
was removed from@spartacus/storefront
. UseProductVariantSizeSelectorComponent
from@spartacus/product/variants/components
instead.VariantSizeSelectorModule
was removed from@spartacus/storefront
. UseProductVariantSizeSelectorModule
from@spartacus/product/variants/components
instead.VariantStyleSelectorComponent
was removed from@spartacus/storefront
. UseProductVariantStyleSelectorComponent
from@spartacus/product/variants/components
instead.VariantStyleSelectorModule
was removed from@spartacus/storefront
. UseProductVariantStyleSelectorModule
from@spartacus/product/variants/components
instead.VariantStyleIconsComponent
was removed from@spartacus/storefront
. UseProductVariantStyleIconsComponent
from@spartacus/product/variants/root
instead.ProductVariantStyleIconsComponent
was moved from@spartacus/product/variants/components
to@spartacus/product/variants/root
instead.VariantStyleIconsModule
was removed from@spartacus/storefront
. UseProductVariantStyleIconsModule
from@spartacus/product/variants/root
instead.ProductVariantStyleIconsModule
was moved from@spartacus/product/variants/components
to@spartacus/product/variants/root
instead.ProductVariantGuard
was removed from@spartacus/storefront
. UseProductVariantsGuard
from@spartacus/product/variants/components
instead. Additionally, thefindVariant
method was renamed tofindPurchasableProductCode
.AuthHttpHeaderService
now requiresAuthRedirectService
.AsmAuthHttpHeaderService
now requiresAuthRedirectService
.AuthRedirectService
now requiresAuthFlowRoutesService
.RoutingService
now requiresLocation
from@angular/common
.ProtectedRoutesService
now requiresUrlParsingService
.EventService
no longer usesFeatureConfigService
.PageEventModule
was removed. Instead, useNavigationEventModule
from@spartacus/storefront
.PageEventBuilder
was removed. Instead, useNavigationEventBuilder
from@spartacus/storefront
.CartPageEventBuilder
no longer usesActionsSubject
andFeatureConfigService
HomePageEventBuilder
no longer usesFeatureConfigService
.ProductPageEventBuilder
no longer usesFeatureConfigService
.PageEvent
no longer contains thecontext
,semanticRoute
,url
andparams
properties. These are now contained in thePageEvent.navigation
object.EventsModule
was removed. Use individual imports instead (for example,CartPageEventModule
,ProductPageEventModule
, and so on).
Product Variants i18n
- The
variant
translation namespace was removed from@spartacus/assets
. Use theproductVariants
namespace that can be imported withproductVariantsTranslations
andproductVariantsTranslationChunksConfig
from@spartacus/product/variants/assets
instead. Translation keys from this namespace did not changed.
Product Variants Endpoint Scope
- The
variants
scope was removed fromdefaultOccProductConfig
. It is now provided byProductVariantsOccModule
under@spartacus/product/variants/occ
instead. Additionally, the endpoint now uses theorgProducts
API instead ofproducts
.
ProductVariantStyleIconsComponent
ProductVariantStyleIconsComponent
changed its constructor dependency fromProductListItemContextSource
toProductListItemContext
.
Product Variants Styles
- Styles for
cx-product-variants
were removed from@spartacus/styles
. Use the@spartacus/product/variants
import 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.standardSessionInProgress
key was removed. - The
pageMetaResolver.checkout.title_plurar
key was removed. - The value of
pageMetaResolver.checkout.title
has 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 (
storageSync
fromStateConfig
) - The default config and default keys (
defaultStateConfig
,DEFAULT_LOCAL_STORAGE_KEY
andDEFAULT_SESSION_STORAGE_KEY
)
DefaultScrollConfig
- The
defaultScrollConfig
was renamed todefaultViewConfig
BaseSiteService
- The
BaseSiteService.initialize
method was removed. UseBaseSiteServiceInitializer.initialize
instead. - A
BaseSiteService.isInitialized
method was added.
LanguageService
- The
LanguageService.initialize
method was removed. UseLanguageInitializer.initialize
instead. - A
LanguageService.isInitialized
method was added. LanguageService
no longer usesWindowRef
. The language initialization from the state was moved toLanguageInitializer
.LanguageService
now validates the value passed to thesetActive()
method against the ISO codes listed in the Spartacuscontext
config, 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.initialize
method was removed. UseCurrencyInitializer.initialize
instead. - A
CurrencyService.isInitialized
method was added. CurrencyService
no longer usesWindowRef
. The currency initialization from the state was moved toCurrencyInitializer
.CurrencyService
now validates the value passed to thesetActive()
method against the ISO codes listed in the Spartacuscontext
config, 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
PageMetaService
has a dependency onUnifiedInjector
,PageMetaConfig
and theplatformId
. - The
ContentPageMetaResolver
depends only on theBasePageMetaResolver
. - The
BasePageMetaResolver
requires theRouter
andPageLinkService
to add canonical links to the page meta. - The
ProductPageMetaResolver
requires theBasePageMetaResolver
andPageLinkService
. - The
CategoryPageMetaResolver
requires theBasePageMetaResolver
. - The
SearchPageMetaResolver
requires theBasePageMetaResolver
. - The
CheckoutPageMetaResolver
uses theBasePageMetaResolver
. - The
OrganizationPageMetaResolver
no longer uses theBasePageMetaResolver
. - The
RoutingService
uses theRouter
to 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
ContentPageMetaResolver
no longer supports thehomeBreadcrumb$
,breadcrumb$
,title$
andcms$
because the content is resolved by theBasePageMetaResolver
. - The
resolverMethods
property on thePageMetaService
has changed toresolvers$
because the resolvers are read from the configuration stream.
SelectiveCartService
- The
getLoaded
method was removed. Use theisStable
method instead.
DynamicAttributeService
- The
DynamicAttributeService
does not depend anymore on theSmartEditService
, but only on theUnifiedInjector
. - The
addDynamicAttributes
method was removed. Use theaddAttributesToComponent
oraddAttributesToSlot
functions instead.
SearchBoxComponentService
- The
SearchBoxComponentService
now also requires theEventService
.
CartListItemComponent
- The
FeatureConfigService
was removed from the constructor and theUserIdService
andMultiCartService
were added to the constructor. - The
form: FormGroup
property 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').disabled
method.
Models
- The
Item
interface was removed. UseOrderEntry
instead. sortCode
was removed from theTableHeader
interface.
SearchBoxComponent
- The
RoutingService
is 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.suggestions
has been changed toul>li>a
for better a11y supportdiv.products
has been changed toul>li>a
for 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
displayCloseButton
property in thecxPopoverOptions
attribute of thebutton.hint-popover
element has been set totrue
.
ListComponent
- The
displayCloseButton
property in thecxPopoverOptions
attribute of thebutton.hint-popover
element has been set totrue
. ng-select
for sort has been wrapped bylabel
andspan
has been added before.
UserGroupUserListComponent
- The
MessageService
was removed from the constructor.
ToggleStatusComponent
- The
FeatureConfigService
was removed from the constructor. - The
DisableInfoService
was added to the constructor.
DeleteItemComponent
- The
FeatureConfigService
was removed from the constructor.
UnitChildrenComponent
- The
CurrentUnitService
is now a required parameter in the component constructor.
UnitCostCenterListComponent
- The
CurrentUnitService
is now a required parameter in the component constructor.
UnitUserListComponent
- The
CurrentUnitService
is now a required parameter in the component constructor.
UnitFormComponent
- The
formGroup
property was renamed toform
. - The
form$
property was removed.
OrganizationTableType
- The unused
UNIT_ASSIGNED_ROLES
property was removed from the enum.
HttpErrorModel
- The
error
property was removed from the interface.
Organization Related Translations (i18n) Changes
The contents of the following were changed:
orgBudget.messages.deactivate
orgCostCenter.messages.deactivate
orgPurchaseLimit.messages.deactivate
orgUnit.messages.deactivate
orgUnitAddress.messages.delete
orgUserGroup.messages.delete
orgUser.messages.deactivate
The following unused keys were removed:
orgBudget.messages.deactivateBody
orgBudget.byName
orgBudget.byUnitName
orgBudget.byCode
orgBudget.byValue
orgCostCenter.messages.deactivateBody
orgCostCenter.byName
orgCostCenter.byCode
orgCostCenter.byUnitName
orgPurchaseLimit.messages.deactivateBody
orgPurchaseLimit.byName
orgPurchaseLimit.byUnitName
orgUnit.messages.deactivateBody
orgUnitAddress.messages.deleteBody
orgUserGroup.messages.deleteBody
orgUserGroup.byName
orgUserGroup.byUnitName
orgUserGroup.byGroupID
orgUser.messages.deactivateBody
orgUser.byName
orgUser.byUnitName
Dependencies Changes
- The
i18next-xhr-backend
peer dependency package was replaced withi18next-http-backend
. - The
i18next
peer dependency package was upgraded to version20.2.2
CmsFeaturesService
- The
CmsComponentsService
constructor is now usingCmsFeaturesService
(replacingFeatureModulesService
) andConfigInitializerService
. - The
FeatureModulesService
was removed. It is replaced by theCmsFeaturesService
.
ConfigInitializerService
- The
getStableConfig
method was removed. Use the new equivalentgetStable
method 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
:CloseAccountModule
ForgotPasswordModule
RegisterComponentModule
ResetPasswordModule
UpdateEmailModule
UpdatePasswordModule
UpdateProfileModule
-
The following modules were moved to
@spartacus/user/account/components
:LoginModule
LoginFormModule
LoginRegisterModule
- The
ResetPasswordFormComponent
component was renamed toResetPasswordComponent
and can now be used from@spartacus/user/profile/components
. The logic for this component was also changed. See below for more information. - The
UpdateEmailFormComponent
component was removed. UseUpdateEmailComponent
from@spartacus/user/profile/components
instead. - The
UpdatePasswordFormComponent
component was removed. UseUpdatePasswordComponent
from@spartacus/user/profile/components
instead. - The
UpdateProfileFormComponent
component was removed. UseUpdateProfileComponent
from@spartacus/user/profile/components
instead. - The
CloseAccountComponent
,CloseAccountModalComponent
,ForgotPasswordComponent
,RegisterComponent
,UpdateEmailComponent
,UpdatePasswordComponent
, andUpdateProfileComponent
components were moved to@spartacus/user/profile/components
. The logic for these components was also changed. See below for more information. - The
LoginComponent
andLoginFormComponent
components were moved to@spartacus/user/account/components
. The logic for these components was also changed. See below for more information. - The
LoginRegisterComponent
component 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
UserProfileFacade
was introduced. - The component no longer uses the
Subscription
property. - The
ngOnDestroy
method was removed.
ForgotPasswordComponent
- The
forgotPasswordForm
property was renamed toform
. - A new observable
isUpdating$
property was added. - The
ngOnInit
andrequestForgotPasswordEmail
methods were removed. A newonSubmit
method was added. - The
FormBuilder
,UserService
,RoutingService
, andAuthConfigService
services are no longer used directly in the component file. A newForgotPasswordComponentService
service 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 theonSubmit
method for form submit events.
RegisterComponent
- The component no longer uses
UserService
. - The
UserRegisterFacade
was introduced. - The
loading$
property was changed toisLoading$
and the type was changed fromObservable<boolean>
toBehaviorSubject<boolean>
. - The
registerUserProcessInit
method was removed.
ResetPasswordComponent (Previously ResetPasswordFormComponent)
- The
subscription
property was removed. - The type of the
token
property was changed fromstring
toObservable<string>
. - The
resetPasswordForm
property was renamed toform
. - A new observable
isUpdating$
property was added. - The
ngOnInit
,resetPassword
, andngOnDestroy
methods were removed. - A new
onSubmit
method was added. - The
FormBuilder
,UserService
, andRoutingService
services are no longer used directly in the component file. A newResetPasswordComponentService
service 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
UserAccountFacade
was introduced. - The
user
property type was changed fromObservable<User>
toObservable<User | undefined>
.
LoginFormComponent
- The
AuthService
,GlobalMessageService
,FormBuilder
, andWindowRef
services are no longer used directly in the component file. A newLoginFormComponentService
service was added and is used in the constructor. - The
ngOnInit
,submitForm
, andloginUser
methods were removed from the component file. - New
form
andisUpdating$
properties were added. - New
onSubmit
method 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
, andngOnDestroy
methods were removed from the component file. - The
GlobalMessageService
,UserService
,RoutingService
, andAuthService
services are no longer used directly in the component file. A newUpdateEmailComponentService
service was added and is used in the constructor. - The logic for the
onSubmit
method was changed. Now this method has no parameters. - New
form
andisUpdating$
properties were added. - There were important change in the component template. Because the
UpdateEmailFormComponent
was removed, theUpdateEmailComponent
now 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
UpdateEmailComponentService
now also requires theAuthRedirectService
.
UpdatePasswordComponent
- The
subscription
andloading$
properties were removed. - The
ngOnInit
,onCancel
,onSuccess
, andngOnDestroy
methods were removed from the component file. - The
RoutingService
,UserService
, andGlobalMessageService
services are no longer used directly in the component file. A newUpdatePasswordComponentService
service was added and is used in the constructor. - The logic for the
onSubmit
method was changed. Now this method has no parameters. - New
form
andisUpdating$
properties were added. - There were important change in the component template. Because the
UpdatePasswordFormComponent
was removed, theUpdatePasswordComponent
now 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
, andngOnDestroy
methods were removed from the component file. - The
RoutingService
,UserService
, andGlobalMessageService
services are no longer used directly in the component file. A newUpdateProfileComponentService
service was added and is used in the constructor. - The logic for the
onSubmit
method was changed. Now this method has no parameters. - New
form
andisUpdating$
properties were added. - There were important change in the component template. Because the
UpdateProfileFormComponent
was removed, theUpdateProfileComponent
now 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
div
that wrapped thecx-sorting
component has been changed tolabel
with aspan
added before.
OccUserAdapter
- The
OccUserAdapter
was removed. Use theOccUserAccountAdapter
from@spartacus/user/account/occ
and theOccUserProfileAdapter
from@spartacus/user/profile/occ
instead. - The
remove
method was removed. Use theclose
method instead.
UserAdapter
- The
UserAdapter
was removed. Use theUserAccountAdapter
from@spartacus/user/account/core
and theUserProfileAdapter
from@spartacus/user/profile/core
instead. - The
remove
method was removed. Use theclose
method instead.
UserConnector
- The
UserConnector
was removed. Use theUserAccountConnector
from@spartacus/user/account/core
and theUserProfileConnector
from@spartacus/user/profile/core
instead. - The
remove
method now returns theclose
method from the adapter (name change).
OccEndpoints
- The
user
endpoint 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
, anduserCloseAccount
endpoints 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
get
method was changed, and now fully relies onUserAccountFacade.get()
from@spartacus/user
. - The
load
method was removed. UseUserAccountFacade.get()
from@spartacus/user
instead. - The
register
method was removed. UseUserRegisterFacade.register()
from@spartacus/user
instead. - The
registerGuest
method was removed. UseUserRegisterFacade.registerGuest()
from@spartacus/user
instead. - The
getRegisterUserResultLoading
method was removed. Instead, subscribe toUserRegisterFacade.register()
from@spartacus/user
to get the loading state. - The
getRegisterUserResultSuccess
method was removed. Instead, subscribe toUserRegisterFacade.register()
from@spartacus/user
to get the success state. - The
getRegisterUserResultError
method was removed. Instead, subscribe toUserRegisterFacade.register()
from@spartacus/user
to get the error state. - The
resetRegisterUserProcessState
method was removed and is no longer needed ifUserRegisterFacade.register()
from@spartacus/user
was used. - The
remove
method was removed. UseUserProfileFacade.close()
from@spartacus/user
instead. - The
loadTitles
method was removed. UseUserProfileFacade.getTitles()
from@spartacus/user
instead. - The
getRemoveUserResultLoading
method was removed. Instead, subscribe toUserProfileFacade.close()
from@spartacus/user
to get the loading state. - The
getRemoveUserResultSuccess
method was removed. Instead, subscribe toUserProfileFacade.close()
from@spartacus/user
to get the success state. - The
getRemoveUserResultError
method was removed. Instead, subscribe toUserProfileFacade.close()
from@spartacus/user
to get the error state. - The
resetRemoveUserProcessState
method was removed and is no longer needed ifUserProfileFacade.close()
from@spartacus/user
was used. - The
isPasswordReset
method was removed. Instead, subscribe toUserPasswordFacade.reset()
from@spartacus/user
to get the success state. - The
updatePersonalDetails
method was removed. UseUserProfileFacade.update()
from@spartacus/user
instead. - The
getUpdatePersonalDetailsResultLoading
method was removed. Instead, subscribe toUserProfileFacade.update()
from@spartacus/user
to get the loading state. - The
getUpdatePersonalDetailsResultError
method was removed. Instead, subscribe toUserProfileFacade.update()
from@spartacus/user
to get the error state. - The
getUpdatePersonalDetailsResultSuccess
method was removed. Instead, subscribe toUserProfileFacade.update()
from@spartacus/user
to get the success state. - The
resetUpdatePersonalDetailsProcessingState
method was removed and is no longer needed ifUserProfileFacade.update()
from@spartacus/user
was used. - The
resetPassword
method was removed. UseUserPasswordFacade.reset()
from@spartacus/user
instead. - The
requestForgotPasswordEmail
method was removed. UseUserPasswordFacade.requestForgotPasswordEmail()
from@spartacus/user
instead. - The
updateEmail
method was removed. UseUserEmailFacade.update()
from@spartacus/user
instead. - The
getUpdateEmailResultLoading
method was removed. Instead, subscribe toUserEmailFacade.update()
from@spartacus/user
to get the loading state. - The
getUpdateEmailResultSuccess
method was removed. Instead, subscribe toUserEmailFacade.update()
from@spartacus/user
to get the success state. - The
getUpdateEmailResultError
method was removed. Instead, subscribe toUserEmailFacade.update()
from@spartacus/user
to get the error state. - The
resetUpdateEmailResultState
method was removed and is no longer needed ifUserEmailFacade.update()
from@spartacus/user
was used. - The
updatePassword
method was removed. UseUserPasswordFacade.update()
from@spartacus/user
instead. - The
getUpdatePasswordResultLoading
method was removed. Instead, subscribe toUserPasswordFacade.update()
from@spartacus/user
to get the loading state. - The
getUpdatePasswordResultError
method was removed. Instead, subscribe toUserPasswordFacade.update()
from@spartacus/user
to get the error state. - The
getUpdatePasswordResultSuccess
method was removed. Instead, subscribe toUserPasswordFacade.update()
from@spartacus/user
to get the success state. - The
resetUpdatePasswordProcessState
method was removed and is no longer needed ifUserPasswordFacade.update()
from@spartacus/user
was used.
UserModule
- The
UserModule
was removed. The main modules currently areUserAccountModule
in@spartacus/user/account
andUserProfileModule
in@spartacus/user/profile
.
Occ Endpoint Models
- The
UserSignUp
model was moved to the@spartacus/user/profile
library.
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:
UserAccountFacade
from'@spartacus/user/account/root'
UserEmailFacade
from'@spartacus/user/profile/root'
UserPasswordFacade
from'@spartacus/user/profile/root'
UserProfileFacade
from'@spartacus/user/profile/root'
UserRegisterFacade
from'@spartacus/user/profile/root'
The following items related to the NgRx state were removed from @spartacus/core
:
- Actions:
ForgotPasswordEmailRequest
ForgotPasswordEmailRequestFail
ForgotPasswordEmailRequestSuccess
ResetPassword
ResetPasswordFail
ResetPasswordSuccess
LoadTitles
LoadTitlesFail
LoadTitlesSuccess
UpdateEmailAction
UpdateEmailSuccessAction
UpdateEmailErrorAction
ResetUpdateEmailAction
UpdatePassword
UpdatePasswordFail
UpdatePasswordSuccess
UpdatePasswordReset
LoadUserDetails
LoadUserDetailsFail
LoadUserDetailsSuccess
UpdateUserDetails
UpdateUserDetailsFail
UpdateUserDetailsSuccess
ResetUpdateUserDetails
RegisterUser
RegisterUserFail
RegisterUserSuccess
ResetRegisterUserProcess
RegisterGuest
RegisterGuestFail
RegisterGuestSuccess
RemoveUser
RemoveUserFail
RemoveUserSuccess
RemoveUserReset
- Effects:
ForgotPasswordEffects
ResetPasswordEffects
TitlesEffects
UpdateEmailEffects
UpdatePasswordEffects
UserDetailsEffects
UserRegisterEffects
- Selectors:
getResetPassword
getDetailsState
getDetails
getTitlesState
getTitlesEntites
getAllTitles
titleSelectorFactory
- Reducers for the
account
,titles
, andresetPassword
states were removed.
Connectors
TITLE_NORMALIZER
was moved to@spartacus/user/profile
.USER_SIGN_UP_SERIALIZER
was moved to@spartacus/user/profile
.USER_SERIALIZER
was removed. UseUSER_ACCOUNT_SERIALIZER
from@spartacus/user/account
andUSER_PROFILE_SERIALIZER
from@spartacus/user/profile
instead.USER_NORMALIZER
was removed. UseUSER_ACCOUNT_NORMALIZER
from@spartacus/user/account
andUSER_PROFILE_NORMALIZER
from@spartacus/user/profile
instead.
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
CmsBreadcrumbsComponent
now extends theCmsPageTitleComponent
. - The
container
property has been moved to theCmsPageTitleComponent
.
BreadcrumbComponent
- The
BreadcrumbComponent
now extends thePageTitleComponent
. - The
setTitle()
function has been moved to thePageTitleComponent
.
PageTitleComponent
- The
PageTitleComponent
is 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.userGreeting
key was moved to a separate library. It is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
miniLogin.signInRegister
key was moved to the separate@spartacus/user
library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.signIn
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.register
key was moved to a separate library. It is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.dontHaveAccount
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.guestCheckout
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.emailAddress.label
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.emailAddress.placeholder
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.password.label
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.password.placeholder
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.wrongEmailFormat
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
loginForm.forgotPassword
key was moved to a separate library. Is is now a part ofuserAccountTranslations
,userAccountTranslationChunksConfig
from@spartacus/user/account/assets
. - The
updateEmailForm.newEmailAddress.label
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.newEmailAddress.placeholder
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.confirmNewEmailAddress.label
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.confirmNewEmailAddress.placeholder
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.enterValidEmail
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.bothEmailMustMatch
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.password.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.password.placeholder
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.pleaseInputPassword
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
updateEmailForm.emailUpdateSuccess
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.resetPassword
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.enterEmailAddressAssociatedWithYourAccount
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.emailAddress.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.emailAddress.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.enterValidEmail
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.passwordResetEmailSent
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
forgottenPassword.passwordResetSuccess
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.confirmPassword.action
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.confirmPassword.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.confirmPassword.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.managementInMyAccount
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.termsAndConditions
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.signIn
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.register
key was moved to a separate library. Is is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.confirmNewPassword
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.resetPassword
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.createAccount
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.title
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.firstName.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.firstName.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.lastName.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.lastName.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.emailAddress.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.emailAddress.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.password.label
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.password.placeholder
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.newPassword
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.emailMarketing
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.confirmThatRead
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.selectTitle
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.passwordMinRequirements
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.bothPasswordMustMatch
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.titleRequired
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
register.postRegisterMessage
key was moved to a separate library. It is now a part ofuserProfileTranslations
,userProfileTranslationChunksConfig
from@spartacus/user/profile/assets
. - The
myCoupons.sortByMostRecent
key has been removed. UsemyCoupons.sortBy
instead. - The
myInterests.sortByMostRecent
key has been removed. UsemyInterests.sortBy
instead. - The
orderHistory.sortByMostRecent
key has been removed. UseorderHistory.sortBy
instead. - The
returnRequestList.sortByMostRecent
key has been removed. UsereturnRequestList.sortBy
instead. - The
productList.sortByMostRecent
key has been removed. UseproductList.sortBy
instead.
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
:
budgetRoutingConfig
was renamed todefaultBudgetRoutingConfig
costCenterRoutingConfig
was renamed todefaultCostCenterRoutingConfig
permissionRoutingConfig
was renamed todefaultPermissionRoutingConfig
unitsRoutingConfig
was renamed todefaultUnitsRoutingConfig
userGroupRoutingConfig
was renamed todefaultUserGroupRoutingConfig
userRoutingConfig
was 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.verifyYourAddress
key is moved toaddressSuggestion.verifyYourAddress
. - The
checkoutAddress.ensureAccuracySuggestChange
key is moved toaddressSuggestion.ensureAccuracySuggestChange
. - The
checkoutAddress.chooseAddressToUse
key is moved toaddressSuggestion.chooseAddressToUse
. - The
checkoutAddress.suggestedAddress
key is moved toaddressSuggestion.suggestedAddress
. - The
checkoutAddress.enteredAddress
key is moved toaddressSuggestion.enteredAddress
. - The
checkoutAddress.editAddress
key is moved toaddressSuggestion.editAddress
. - The
checkoutAddress.saveAddress
key is moved toaddressSuggestion.saveAddress
. - The
checkoutOrderConfirmation.replenishmentNumber
key is removed. You can use `` instead. - The
checkoutOrderConfirmation.placedOn
key is removed. You can useorderDetails.placedOn
instead. - The
checkoutOrderConfirmation.status
key is removed. You can useorderDetails.status
instead. - The
checkoutOrderConfirmation.active
key is removed. You can useorderDetails.active
instead. - The
checkoutOrderConfirmation.cancelled
key is removed. You can useorderDetails.cancelled
instead. - The
checkoutOrderConfirmation.frequency
key is removed. You can useorderDetails.frequency
instead. - The
checkoutOrderConfirmation.nextOrderDate
key is removed. You can useorderDetails.nextOrderDate
instead. - The
checkoutOrderConfirmation.orderNumber
key is removed. You can useorderDetails.orderNumber
instead.
Changes in Styles
-
The styles for the following selectors were moved from
@spartacus/styles
to@spartacus/user/profile/styles
:cx-close-account-modal
cx-close-account
cx-forgot-password
cx-register
cx-update-password-form
cx-user-form
-
The styles for the following selectors were moved from
@spartacus/styles
to@spartacus/user/account/styles
:cx-login
cx-login-form
LogoutGuard
AuthRedirectService
is a new, required constructor dependency.
RoutingService
- The
RoutingService.go
signature was changed. Prior to 4.0, an object with query params could be passed in the second argument. Now, the second argument is an AngularNavigationExtras
object (with a'queryParams'
property). - The
RoutingService.navigate
signature was changed. Prior to 4.0, an object with query params could be passed in the second argument. Now, the second argument is an AngularNavigationExtras
object (with a'queryParams'
property).
RoutingActions RgRx
The following NgRx actions have been removed:
RoutingActions.RouteGo
(andRoutingActions.ROUTER_GO
). Use thego()
method of the theRoutingService
instead.RoutingActions.RouteGoByUrlAction
(andRoutingActions.ROUTER_GO_BY_URL
). Use thegoByUrl()
method of the theRoutingService
instead.RoutingActions.RouteBackAction
(andRoutingActions.ROUTER_BACK
). Use theback()
method of the theRoutingService
instead.RoutingActions.RouteForwardAction
(andRoutingActions.ROUTER_FORWARD
). Use theforward()
method of the theRoutingService
instead.
AuthRedirectService
- The
#reportNotAuthGuard
method is not needed anymore. Every visited URL is now remembered automatically as a redirect URL on aNavigationEnd
event. - The
#reportAuthGuard
method is deprecated. Use the new#saveCurrentNavigationUrl
method instead. It remembers the anticipated page when being invoked during the navigation.
OccEndpointsService
- The
getEndpoint
method was removed. UsebuildUrl
instead, with theendpoint
string and thepropertiesToOmit
matching your desired URL. - The
getOccEndpoint
method was removed. UsebuildUrl
instead, with theendpoint
string and thepropertiesToOmit
matching your desired URL. - The
getBaseEndpoint
method was removed. UsebuildUrl
method instead, with configurable endpoints or thegetBaseUrl
method. - The
getUrl
method was removed. Use thebuildUrl
method instead. ThebuildUrl
method has the same first parameter asgetUrl
. The second, third and fourth parameters ofgetUrl
are merged into the second argument object ofbuildUrl
with theurlParams
,queryParams
andscope
properties. - The
getRawEndpoint
method was removed. UsebuildUrl
with configurable endpoints or thegetRawEndpointValue
method instead.
Modal Service
- The
FeatureConfigService
was removed from the constructor. ApplicationRef
is a new, required constructor dependency.
ExternalJsFileLoader
- The service was removed from
@spartacus/core
. UseScriptLoader
instead.
CxApi
-
The following public members of
CxApi
were removed:CheckoutService
CheckoutDeliveryService
CheckoutPaymentService
TabParagraphContainerComponent
WindowRef
andBreakpointService
are now required parameters in the constructor.- All services used in constructor have been changed to
protected
.
b2cLayoutConfig
b2cLayoutConfig
was removed from@spartacus/storefront
. Use the layout from the corresponding feature library instead.
UnitAddressFormService
- The
UserService
param that was imported from@spartacus/core
was removed from the constructor. Instead, a newUserAddressService
param from@spartacus/user/profile/root
was added.
GuestRegisterFormComponent
- The
UserService
param that was imported from@spartacus/core
was removed from the constructor. Instead, a newUserRegisterFacade
param from@spartacus/user/profile/root
was added.
UserIdService
- The
invokeWithUserId
method was removed. UsetakeUserId
instead.
PopoverDirective
- The
PopoverDirective
class now implementsngOnInit
. - The
PositioningService
was removed from the constructor. - The
openPopover
andclosePopover
event emitters are no longer optional. - A new
eventSubject: Subject<PopoverEvent>
property was added. - The
handleOpen
andtoggle
methods were removed. - The following new methods were added:
handleEscape
handleClick
handlePress
handleTab
PopoverService
- The
event
argument of thegetFocusConfig
method changed type fromEvent
toPopoverEvent
.
PopoverComponent
- The
insideClicked
property was removed. button.close
has been moved into adiv.cx-close-row
OnNavigateFocusService
- The
document
injection param was removed from the constructor. - The
WindowRef
param was added into the constructor.
Facade Factories Are Now Inlined
- Facade factories are now inlined into an
@Injectable
decorator. The following symbols are not needed anymore and were removed:userAccountFacadeFactory
UserEmailFacadeFactory
UserPasswordFacadeFactory
UserProfileFacadeFactory
UserRegisterFacadeFactory
savedCartFacadeFactory
cdcAuthFacadeFactory