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 commented on pull request koala-framework/kwc-newsletter#5

@nsams
nsams commented on pull request koala-framework/kwc-newsletter#5
Feb 22, 2018

bitte um abstimmung bin benjamin damit die bundles gleich strukturiert sind https://gitlab.vivid-planet.com/vivid/kwf-carlog-auth

nsams commented on issue koala-framework/koala-framework#736

@nsams
Feb 20, 2018

Yes, that is the correct fix, ajax requests timeout after 30 seconds by default. Now why the request is that slow is a completely different topic, …

nsams starred ionic-team/stencil

@nsams
Feb 19, 2018
ionic-team/stencil

A simple, reusable web component compiler

TypeScript 2.3k 5 issues need help Updated Feb 19

nsams commented on pull request koala-framework/koala-framework#728

@nsams
nsams commented on pull request koala-framework/koala-framework#728
Feb 15, 2018

des funktioniert dann nicht mehr

nsams commented on pull request koala-framework/kwc-newsletter#2

@nsams
nsams commented on pull request koala-framework/kwc-newsletter#2
Feb 15, 2018

bitte da keine leerzeile