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

FalcorJS and React

FalcorJS and React

Presented at React Rally 2015.

Brian Holt

August 25, 2015
Tweet

More Decks by Brian Holt

Other Decks in Programming

Transcript

  1. FA L C O R
    S I M P L I F Y I N G Y O U R D ATA
    @ H O LT B T
    BoJack Horseman

    View Slide

  2. W H AT I S FA L C O R ?

    View Slide

  3. Thug Life

    View Slide

  4. FA L C O R I S A W E S O M E
    • Let’s you treat your local and remote data the same way
    • Takes care of fetching, caching, and cache invalidating for you
    • Framework / library agnostic (doesn’t have to be React)

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. PAT H S
    • Look just like normal object accessors
    • Ranges
    • "shows[0..2]['plot']"
    • Multiple properties
    • "shows[2]['title','plot']"

    View Slide

  9. FA L C O R A N D R E A C T
    • Allows your components to declare their own data dependencies
    • Alleviates the data tunneling problem

    View Slide

  10. View Slide

  11. MovieList
    Movie
    Title
    Year
    Plot

    View Slide

  12. MovieList
    • Needs list of movies to map over
    • Needs ID for key

    View Slide

  13. Movie
    • Needs nothing of its own

    View Slide

  14. Title
    Year
    Plot
    • Title, Year, and Plot components need the title, year, and plot pieces of
    data respectively
    • Nothing else

    View Slide

  15. S P E N D L E S S T I M E W I R I N G U P T H E A P P

    View Slide

  16. S P E N D M O R E T I M E O N T H E A P P

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. • No black magic
    • No mixins or helpers (other than lodash)
    • You already understand how it works
    • You can still use the components even without the queries
    • Don’t like the way I did it? Hack your own solution. You have all the tools.

    View Slide

  24. View Slide

  25. FA L C O R S E R V E R
    • Aims to be very RESTful in its implementation
    • Best used to retrieve small amounts of data you can paginate over
    • Not terrible to implement

    View Slide

  26. View Slide

  27. View Slide

  28. L O L M I C R O S E R V I C E S

    View Slide

  29. FA L C O R D O E S A L O T O F O T H E R C O O L S T U F F
    • Create, update, and delete are no problem too. Easy even to batch
    multiple actions at once.
    • Smart caching so if you request the same info twice, it will pull from the
    cache.
    • Easy also to send cache invalidating logic from the server

    View Slide

  30. Brian Holt
    @holtbt

    View Slide