Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building your Webapp Muscles with Lift

Building your Webapp Muscles with Lift

6aaa707270e134bb72a4c2852f088e22?s=128

Matt Farmer

May 06, 2015
Tweet

Transcript

  1. Building your Web Application Muscles with Lift Matt Farmer May

    6th, 2015
  2. Sorry, I was sick.

  3. Tonight’s Demonstration • A site for submitting and voting on

    puns. • URL: http://punerator.frmr.me • Source: https://github.com/farmdawgnation/punerator
  4. Lift is a bit different.

  5. The Seven Things 1. Lazy Loading 2. Parallel Page Rendering

    3. Comet and AJAX 4. Wiring 5. Designer-friendly Templates 6. Wizard 7. Security
  6. The Seven Things 1. Lazy Loading 2. Parallel Page Rendering

    3. Comet and AJAX 4. Wiring 5. Designer-friendly Templates 6. Wizard 7. Security
  7. Designer-friendly Templates

  8. None
  9. Lift is not an MVC framework.

  10. Lift is not an MVC framework. No, I’m not insane.

  11. Lift is not an MVC framework. No, I’m not insane.

    Well, maybe a little but not completely.
  12. View First

  13. MVC vs. View First

  14. MVC vs. View First Typical MVC Framework User Framework Controller

    View
  15. MVC vs. View First Typical MVC Framework User Framework Controller

    View Lift User Framework View Snippet Snippet Snippet
  16. View First Snippet (NodeSeq) => NodeSeq

  17. View First Snippet (NodeSeq) => NodeSeq CSS Transforms

  18. View First Snippet (NodeSeq) => NodeSeq CSS Transforms

  19. View First Snippet (NodeSeq) => NodeSeq CSS Transforms

  20. View First Snippet (NodeSeq) => NodeSeq CSS Transforms Magic

  21. View First Snippet (NodeSeq) => NodeSeq CSS Transforms Magic DSL

    (Domain Specific Language)
  22. View First Snippet (NodeSeq) => NodeSeq CSS Transforms Magic DSL

    (Domain Specific Language) “.date *” #> invoice.date
  23. View First Snippet (NodeSeq) => NodeSeq CSS Transforms Magic DSL

    (Domain Specific Language) “.date *” #> invoice.date CSS Selector
  24. View First Snippet (NodeSeq) => NodeSeq CSS Transforms Magic DSL

    (Domain Specific Language) “.date *” #> invoice.date CSS Selector Content
  25. View first

  26. View first • Lift templates are just HTML.

  27. View first • Lift templates are just HTML. • Lift

    finds things to change using CSS selectors.
  28. View first • Lift templates are just HTML. • Lift

    finds things to change using CSS selectors. • Any designer who understands HTML and CSS can make changes relatively safely.
  29. Let’s see some code.

  30. None
  31. Push to the Browser

  32. COMETS!

  33. Why not WebSockets? https://groups.google.com/d/msg/liftweb/ 1fa3rolbnvI/enV5CFm2Rd4J

  34. Push to the Browser

  35. Push to the Browser • What if we could represent

    the page a user’s browser is viewing as an actor?
  36. Push to the Browser • What if we could represent

    the page a user’s browser is viewing as an actor? CometActor
  37. Actors, but for pages Browser CometActor

  38. Actors, but for pages Browser CometActor

  39. Actors, but for pages Browser CometActor Render HTML.

  40. Actors, but for pages Browser CometActor Render HTML. Push JavaScript.

  41. Actors, but for pages Browser CometActor Render HTML. Push JavaScript.

    Session
  42. Actors, but for pages Browser CometActor Render HTML. Push JavaScript.

    Session SessionVar
  43. Actors, but for pages Browser CometActor Render HTML. Push JavaScript.

    Session SessionVar LiftActor Snippets
  44. Lift handles the magic

  45. Lift handles the magic • Loading the relevant client side

    bits.
  46. Lift handles the magic • Loading the relevant client side

    bits. • Detecting when a CometActor isn’t needed.
  47. Lift handles the magic • Loading the relevant client side

    bits. • Detecting when a CometActor isn’t needed. • Handling connectivity issues.
  48. Let’s see some code.

  49. None
  50. Further reading • The Lift Website http://liftweb.net • Lift Template

    Projects https://github.com/lift/lift_26_sbt • The mailing list http://groups.google.com/group/liftweb • The Seven Things: http://seventhings.liftweb.net • The Lift Cookbook: http://cookbook.liftweb.net
  51. Thank you. @farmdawgnation / farmdawgnation.com matt@frmr.me

  52. Creative Commons Attributions • “Big Weight” https://www.flickr.com/photos/ennuidesign/ 2715836520 • “Are

    your eyeballs running?” https://flic.kr/p/4HbQj2 • “Comet Panstarrs March 2nd 2013” https://flic.kr/p/ dZdD7k