Why FXM should wait for your page to load

Context

Working with FXM, I faced a very interesting sporadic issue: every 10-15 times some of the components were not loading on a page. A response object was identical all the time, no errors in console, no changes in a site code since the last deployments. I think you get the situation.

However, this issue was able to cause a lot of troubles for a client as FXM was used on many legacy sites. So I continued digging…

Continue reading “Why FXM should wait for your page to load”

Why FXM should wait for your page to load

Require JS and CSS for a Sitecore components

Context

According to HTML best practices and guidelines we need to put styles in head (so that they would be applied to html immediately after rendering) and scripts in the end of body (so that they will not block your browser from downloading other content). On the other hand for Sitecore you need to create component, which could require some styles on specific scripts, and put them in a placeholder in the middle of the page.

This results in two common solutions: small scripts and style section spread all over the page, added in each component, or huge styles and scripts files containing all required content and added according to guidelines.

There should be a better way, lets see how it looks.

Continue reading “Require JS and CSS for a Sitecore components”

Require JS and CSS for a Sitecore components