Chapter 4. Integrating with Client-side Technologies

The previous chapter showed how to serve HTML pages, thus turning your application into a web application. Well, actually, modern web applications also make heavy use of client-side scripting and styling technologies. So, this chapter explains how to serve and process (linting, minification, and concatenation) static assets (images, scripts, and style sheets). It also shows how to manage client-side dependencies from the build system.

The following is the list of topics that will be covered in the chapter:

  • Serving static files from your application
  • Generating the application's URLs from the JavaScript code
  • Linting, minifying, and gzipping CSS and JavaScript assets
  • Running JavaScript tests from sbt
  • Managing JavaScript dependencies

Philosophy of Play regarding client-side technologies

The Play framework essentially focuses on the server-side part of your application and gives you freedom on which client-side technology to use. The advantage is that you can choose whichever technology you are comfortable with, but the drawback is that it gives almost no high-level features such as automatic client-server data binding.

Nevertheless, as explained in the following sections, the build system can help you in several client-side-related tasks such as assets compression and concatenation. Play also comes with a controller that can serve static assets and supports several useful features such as fingerprinting, as explained in the upcoming sections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.247.125