@integralist @charlierevett
Config driven page construction
https://github.com/BBC-News/composition-example
Sinatra
Multi-threaded component aggregation (Typhoeus)
Template interpolation via Mustache
Implemented as a reusable Gem
Static assets use BBC Spindle in production
Service level config:
config.ru
require "composition"
cache = nil
config = {
:base_url_env => "",
:debug => "true",
:indices => "home_page",
:local_static_asset_path => "./public",
:page_config_base_path => "./config/page/base.yaml",
:page_config_defaults_path => "./config/page/default.yaml",
:page_config_path => "./config/page",
:site_root => "news",
:static_asset_path => "/",
:timeout => "4"
}
run Composition.create(config, cache)
Page level config:
home_page.yaml
components:
- id: "title" # passed with broker URL when requesting components
page_location: "header" # correlates to value defined inside mustache template
mandatory: true # defaults to false
opts:
foo: "bar" # static query string options added to base_url
dynamic_options: true # add runtime query string params as part of service URL
Page level config:
base.yaml
base_url: "https://some_s3_location.com/bucket/object/path"
components:
- id: "head"
page_location: "orb_meta"
mandatory: true
- id: "bodylast"
page_location: "orb_footer"
mandatory: true
- id: "bodyfirst"
page_location: "orb_header"
mandatory: true
Asset Pipeline
Node is more familiar
It is just JS after all
Node has questionable stability/reliability at peak load
We should have a tech spike to justify our decision