DEV Community

Tarun Saini
Tarun Saini

Posted on

Things to Avoid While Working on SAP Spartacus

Copying Spartacus source code

Most internet commerce developers might have experience in working with SAP Business Accelerators and they also might want to utilize it while working with Spartacus. Although this knowledge is valuable and helps generally in most situations, it might lead to a large problem.

It might be tempting to repeat Spartacus’ source code and improve it to your needs, as was the case with Accelerators. Although this kind of approach would work, it could break Spartacus’ upgradability. Instead, you should use Spartacus as libraries and alter its habits using another means (e. g. addiction injection, component umschlüsselung, outlets).

Substantial outlets usage

Making use of outlets is one means to personalize sap spartacus training. It’s fast and simple but it has a long listing of drawbacks simultaneously. The particular list includes:

  • Outlets are not editable with the CMS
  • These may cause performance issues
  • They might business lead to dirty computer code
  • Might be hard to maintain and error-prone I’m not stating you shall not use outlets at all. These are in Spartacus for a reason. Just think of their limitations and consider other options like component umschlüsselung.

Making use of the wrong formula component

Spartacus provides so-called recipe quests. B2cStorefrontModule is presently the most popular. It possesses a base setup for a B2C store and most examples obtainable on the internet use it. It is a perfect installing if you’re planning to implement a simple store and you may re-use the majority of the built-in functionality. Nevertheless , if you plan to have further customizations, you should think about using another module like StorefrontModule or even StorefrontFoundationModule. Choosing an appropriate recipe component can lead to performance improvements, more control of the codebase, and a cleanser code.

Failing to remember about SSR

Any time you start establishing your front conclusion, it is simple not to take Storage space Side Rendering into consideration. The problem is that if you would like to turn SSR on later in the expansion, it transforms out that it doesn’t work well. The reason is that we may have developed components that break SSR. Right after doing so, it is difficult to find which they are. I suggest looking at the Server Side Object rendering Coding Guidelines and at least indicate parts of computer code that might influence SSR.

Reinventing the wheel

Prior to you start employing a feature, it will be worth checking whether Spartacus supports it out of the box or they have it on the roadmap. The less code you maintain by yourself the better. Documentation has some gaps rather than everything is noted but, fortunately, there is a Spartacus community slack channel to can ask questions. Alternatively, you can e mail us directly and schedule a appointment.

Top comments (0)