3. Compile styles and scripts
2. Handle multiple languages
3. Compile scripts and styles
4. Abstract data by type
For both scripts and styles, EAF adopts a similar approach. URLs include a filepath that is a timestamp of the most recent edit. This ensures the browser requests a new file when necessary rather than continuing with the older, locally cached version. The web application’s .htaccess file redirects all requests for CSS and JS files to a processor which serves up the required content.
From here the paths for scripts and style diverge.
- We can choose whether or not to minify each included file.
CSS files are compiled from a combination of LESS source files and CSS atoms using Leaf Corcoran’s lessc parser class. As with Jspp, we’ve enhanced this class to accommodate our core + custom file structure.
The result of this approach is that a developer can deploy changes to the ElseApps Framework knowing that the user will always be served up the most recent version of all JS and CSS files.
In the next lesson from EAF we’ll discuss abstracting data by type.