Skip to content

Latest commit

 

History

History
100 lines (71 loc) · 3 KB

design.rails.md

File metadata and controls

100 lines (71 loc) · 3 KB

Development Toolkit Design

Ruby based system for exposing ruby and js communication system.

Communication via JSON.

Ruby system can be backed by rails. Controllers configured similar to models JS system backed by sereth scripts Utilize Templates Connect communication channels Provide contexts - May be partially stored on server as sessions Template Manager Reat Templates consisting of HTML + JS May slim_assets into these

!! Gets permissions from included scripts

Compile into /app/templates/... /app/templates/manifest.rb = full manifest of the included templates, and metadata /app/templates/raw/namespaces*/name.format - Offer model bindings with file sync /app/templates/compiled/namespaces*/name.js Cache compiled templates Access through controller. Access may require validation through permission system. Permission system implemented through call API

Compilation parses the templates in the raw directory, and generates the compiled + manifest

For development the manifest does not long cache, but recompiles each change

Need separate task to compile templates, since not compiling into asset directory anymore

-- JS access(args*) - Array of arguments saved for the access metadata container for use in the access callback event.

-- Config Cache size. Going over will expire entries and re-query them from disk.

-- Assumptions Root HTML loaded by browser (Including basic content) Initial system configures loaders, template managers, core callbacks, contexts Client configures the desired channels Channel notify of template path (B) Channels load data, and render template Reloads may trigger re-renders though the bound contexts

Views are in a path context Each view is a parent container of an instance of that view Instances of views are bound to instances of channels.

View sub-contexts are down-links to other instances of other views. Super = up

context type = view context data = generated by specific view. view-impl assoc to a generator context struct = utilized sub-components

reusable components through up-assocs

Distribution: Ruby Gem

TemplateManager Parser fills Template Also calls pre-configured callouts based on raw handlers Manifest stores Template Metadata Template points to Raw + Cached + Meta/Callbacks

Ruby

Library Manager: Gem + Bundler Testing: RSpec

Tool Support: Rails

Sprocket engine for template generation

# Parses the first javascript tag to extract stuff
coffee:
  initiate () ->
    ... # Run once when the template is loaded for the first time. Usually populates context
  around_render (args, render) ->
    ... # Run every time the template is rendered. Instantiates context. All args 
    return render(args) # Return the actual result of the render operation
    # The render operation generates HTML from the rest of the template
  before_render (args) ->
  after_render (dom) ->

JS

Library Manager: Bower? Testing: Jasmine Testing

TODO

Multy-system queue to notify updates