To JSS or not to JSS

Sitecore JavaScript Services (JSS) was launched, now a few years back, as Sitecore's solution for meeting the needs of doing headless content mangement on Sitecore using JavaScript, without losing the key capabilities (especially in line editing) which makes Sitecore great. It consisted of JavaScript SDKs that worked with the JSS layout service running on Sitecore. Now renamed the Sitecore JavaScript Rendering SDK, and supporting the JSS services or Experience Edge, this SDK is an important part of delivering JavaScript web apps leveraging Sitecore editing capabilties.

That said, for a lot of front end developers JSS is a skillset that they might not know a lot about. Using it properly requires not only an understanding of how to install and work with the SDKs, but also understand Sitecore concepts such as placeholders. Furthermore not all web use cases, even those that leverage content, benefit from such advanced capabilities.

Benefits and complexities

I see the following pros and cons of using the JavaScript Rendering SDK

  • Benefits
    • Enables Sitecore inline editing tools (Experience Editor/Pages)
    • Supports page composition directly by business usets through support of contetnt placeholders
    • Supports consistent routing to pages based on Sitecore items
  • Complexities
    • Another library and additional concepts for front end developers to understand
    • Not all sites, and not all parts of some sites, benefit from the page composition and inline capabilities offered by enterprise CMS
    • Sometimes not all URL routes in a complex headless app are driven by data/content in Sitecore

Micro front ends and a trade-off

Larger headless solutions in the enterprise will usually benefit from taking a micro-frontends approach to building out the "head". This breaks down the head into a number of sub-components, each usually worked on by different teams. It breaks down what could otherwise become a new monolithic custom application into smaller parts.

The trade off that we have taken in projects for JSS, especially where Sitecore is one component driving the web experience, is to leverage this pattern and only use the Sitecore JavaScript Rendering SDK in those apps which are content centric. This could be apps the drive general content pages, landing pages, articles pages or even the homepage. However other parts of the site such as product detail pages, shopping cart or checkout don't include the JSS SDKs.

Those pages leveraging the JavaScript Rendering SDKs leverage the "JSS" services (layout service for traditional sites, or the GraphQL endpoints for Experience Edge) directly from the SDK. Any pages that aren't driven by the SDK but that still need content leverage the BFF service, which themselves use the Sitecore APIs (REST or GraphQL) to source content, and return it along with data in the call used by the front end. This means that developers of those apps treat content no different to any other data used on the page. They don't need to consider concepts like placehodlers, but need to manage all page layouts as a part of the application (and all changes to e.g. ordering of any modules require developers to change.

Comments

Popular posts from this blog

Cloud hosting Sitecore - High Availability

Setting up TDS to work with Azure DevOps

Sitecore - multi-site or multi-instance?