Build Step

Koala Framework now has a build/compile/generate step.

This got merged into master recently and will be part of verison 3.8.

Why?

With the build step we can use external tools we don't want to depend on on production locally:

  • libsass (for much faster (10x) sass to css compilation
  • uglifyjs (for proper minification of javascript assets)
  • sourcemaps generation (for sass, minified javascript and concated css & js)

Additionally we don't have to rebuild assets on every clear-cache on production servers which caused a downtime of (depending on the server) several minutes.

And one important point is performance - we now can rely on the existence of build files on production and don't have to lazy generate caches.

What?

Currently part of the build are:

  • asset packages (compiled, minified, concated assets)
  • trl (parsed trl.xml files ready for usage in Kwf_Trl, for improved performance)
  • component settings (all static component settings)
  • component events (event listeners aggregated from all components)

Usage

When running a Koala Framework Application you now need the build subfolder. Run the following command to generate it:

php bootstrap.php build

Dependencies

For a successful build several libraries node packages are required: 

  • node-sass (for compiling scss)
  • uglifyjs (for minifying js)
  • grunt-modernizr (for creating modernizr build)
But don't worry - all are installed automatically using composer-extra-assets.

Deployment to production

The idea behind the build is that you can share the generated files across servers. You should not build on production server, instead the locally build files should be copied to the production server.

Build Server

Creating a build Server is relatively easy as you just have download all dependencies and start the build. No database or local config required.

This entry was posted in Koala Framework by Niko Sams. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

Github Activity

nsams merged a pull request in koala-framework/koala-framework

@nsams
nsams merged a pull request in koala-framework/koala-framework
Nov 20, 2017
deny access to welcome controller to normal users by default #638

Deny welcome contro lelr to normal users per default

+1 -0
1 comment

nsams pushed to 5.0 in koala-framework/koala-framework

@nsams
nsams pushed to 5.0 in koala-framework/koala-framework
Nov 20, 2017

nsams deleted branch symfony-kernel-getinstance at nsams/koala-framework

@nsams
nsams deleted branch symfony-kernel-getinstance at nsams/koala-framework
Nov 20, 2017

nsams pushed to 4.5 in koala-framework/koala-framework

@nsams
nsams pushed to 4.5 in koala-framework/koala-framework
Nov 20, 2017

nsams opened a pull request in koala-framework/koala-framework

@nsams
nsams opened a pull request in koala-framework/koala-framework
Nov 9, 2017
Add getInstance method for symfony kernel #640

this allows us using symfony services everywhere.

+14 -1