Skip to content

Instantly share code, notes, and snippets.

@chriswessels
Created December 17, 2015 10:21
Show Gist options
  • Save chriswessels/9d6e7146b76ec463852a to your computer and use it in GitHub Desktop.
Save chriswessels/9d6e7146b76ec463852a to your computer and use it in GitHub Desktop.

App client-side performance plan

Two pronged approach

  1. Create the illusion of speed
  2. Increase speed

Illusion of speed

Instead of issuing UI feedback after the rendering cycle, we should push feedback into the UI immediately and then begin the rendering cycle. This creates the illusion of speed as the satisfied that their input has been received. Patch UI directly with jQuery (no Tracker invalidations). Review Google's RAIL Performance Guidelines: https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail?hl=en

Increase speed

  1. Reduce computation time spent when changing routes
  2. Reduce time spent drawing templates to the screen
  3. Optimise codebase for runtime JIT

Plan

  1. Move subscriptions from routing layer into parent templates (that manage top level data state)
  2. Migrate from iron:router to kadira:flow-router
  3. Start building new UI components in React instead of Blaze
  4. Slowly migrate all UI over to React (have targets for this to ensure it happens)
  5. Use Typescript/Flowtype for JIT compilation optimisation
  6. In the long term, consider ReactNative (at which point we'll be well placed to consider given use of React)

iron -> flow router considerations

  1. Rendering with blaze-layout and react-layout
  2. Largely simple API translation
  3. Biggest challenges will come from lack of reactivity, and the assumptions that were made when building with iron:router

Problems with Blaze

Problems with React

But

  • MDG is building Blaze 2 as a wrapper around React as the rendering engine, so support will only get better
  • Pure React is also an officially supported rendering framework

Interesting links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment