Widget optimizations

Hello! We just released the update to our widgets! This update does not bring any new features but rather some optimizations and widget size reduction.

CSS code rewrite

We rewrote most of the CSS code in our widgets. It resulted in a much smaller codebase. For instance, the basic 3×3 grid widget code before the changes had a size of 33.3kB. After the changes, the size is 24.7kb. This results in about 25% smaller widget size!

List of the removed classes

Below you will find the list of removed classes from our widgets. If you are using them in the Custom CSS field your code widget might not work as expected.

.lightwidget__posts--click-event-none{}
.lightwidget__column--column-1{}
.lightwidget__column--column-2{}
.lightwidget__column--column-n{}
...
.lightwidget__column--column-10{}
.lightwidget__posts--columns-1{}
.lightwidget__posts--columns-2{}
.lightwidget__posts--columns-n{}
...
.lightwidget__posts--columns-10{}
.lightwidget__posts--hide-tiles{}
.lightwidget__posts--grid-1{}
.lightwidget__posts--grid-2{}
.lightwidget__posts--grid-n{}
...
.lightwidget__posts--grid-10{}

The fix is quite easy since they are only BEM modifiers. The same elements still have .lightwidget__posts and .lightwidget__column classes, so you can use these selectors in your Custom CSS code.

A partial drop of support for IE11

You might be surprised, but we do support Internet Explorer 11 in our widgets. Actually, we supported it, because now the support is limited. IE 11 has been released on October 17, 2013, which makes it a very old browser with a lack of support for the new features.

For widgets to look the same on new browsers and IE11, a lot of hacks are needed, which adds a lot of code. After the rewrite, we removed a lot of backward compatibility code which helped us to reduce the overall size of the widget.

Most of the features will still work and the widgets in most cases should still look OK, but in some cases, they will not display like in other, modern browsers.

We plan to support the IE11 until June 15, 2022. On that date, the support for IE11 is officially ended by Microsoft. After that, we plan to rewrite the widgets one more time and also remove all JS polyfills that are used in our widgets and which will reduce the size of the widgets even more!

Comments (0)

You must be logged in to post comments.