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

Splitting up 8Ball and building/sharing components

Splitting up 8Ball and building/sharing components

Mark Stuart

February 19, 2015
Tweet

More Decks by Mark Stuart

Other Decks in Programming

Transcript

  1. Split up the app. Create more server-side modules. Package up

    flows, dynamic and static components.
  2. Remove the noise. Write small, focused modules. Better code, better

    docs, better tests. Easier ramp up time for new devs.
  3. It’s hard to change a monolith. It’s easy to change

    a small app. Easier to experiment.
  4. No consistent UI platform. Difficult to share code with teams.

    No Kraken for the UI. No consistent component APIs.
  5. The Good Parts (tm) Super old and works everywhere. Easy

    to implement. Server-side or Client-side rendered. Encapsulated. UI platform agnostic. Communication via postMessage.
  6. The Bad Parts You can’t pick what you want, you

    get it all. Multiple versions of jQuery, etc. Could have performance implications.
  7. <script src=“loader.js?path=/myaccount/transfer” /> 1. Fetches and loads loader.js 2. loader.js

    scrapes off “path” from itself 3. Creates an iframe 4. Sets the iframe’s URL to the “path”
  8. Great part is this is super re-usable. <script src=“loader.js?path=/myaccount/transfer/send” />

    <script src=“loader.js?path=/myaccount/wallet/bank/add” /> <script src=“loader.js?path=/myaccount/settings/address” /> …
  9. paypal.com/myaccount/transfer?redirectUrl=/merchant/home 1. Store redirectUrl in session. 2. /myaccount/transfer is rendered.

    3. If the user exits, redirect to redirectUrl. 4. If the user completes, redirect to redirectUrl.
  10. Next steps Split out as many apps as possible. Keep

    building server-side modules. Build UI components for dust/Backbone. Hopefully within 2-3 months =)