New feature: code splitting

We have added code-splitting capabilities on PoP. Code splitting allows to only load the assets which are needed for the requested page and nothing more. We have initially implemented it for javascript (.js) and javascript template (.tmpl) assets, and we will implement it for stylesheets (.css) assets soon.

By not delivering any javascript code that will not be needed immediately, loading the first page in the website gets a significant performance boost, primarily on mobile phones, since their javascript engines are slow and may time significant time parsing javascript code. Additional javascript code is then loaded on demand, when needed.

In order to be able to identify which are the needed assets for each page, we need to create a map of dependencies of all assets in the website, so that loading an asset will also load its dependencies and so on. There are external tools to accomplish this, such as Webpack, however it works on the context of a purely javascript driven application, but not in a framework like PoP, which works on top of WordPress. For this reason, PoP had to implement its own functionality. However, this proved to be an advantage, since PoP can infer the map of dependencies automatically, just from analyzing the javascript codebase. Then, adding code-splitting to a PoP website does not need extra configuration, making it a breeze for the development process.

As usual, enjoy!


Sign up to our newsletter:

Welcome to the PoP framework!
Break the information monopoly

the PoP framework is open source software which aims to decentralize the content flow and break the information monopoly from large internet corporations. Read more.