PRODUCTION CLOJURESCRIPT · PRODUCTION CLOJURESCRIPT Paul deGrandis [email protected] @ohpauleez...
Transcript of PRODUCTION CLOJURESCRIPT · PRODUCTION CLOJURESCRIPT Paul deGrandis [email protected] @ohpauleez...
PRODUCTION CLOJURESCRIPT
Paul [email protected]
@ohpauleez
ClojureNYC meetup:: June 20, 2012
Thursday, June 21, 12
A BIT OF HISTORYpartial renders and choosing ClojureScript
•New business model,new tooling
• Evaluation andproving ground
• Constraints andtradeoffs
Kent Beck
Thursday, June 21, 12
CONSTRAINTS
•Never trust the client
•Design for complete failure
• SEO makes us money
• Take “engineering” out ofcontent related tasks
•No pointless infrastructure;DB took most person-hours
https://github.com/ohpauleez/se_checklist
Thursday, June 21, 12
SHORELEAVE
• C/Unix fashion - built in parallel with apps
• Lisp fashion - bottom-up utilities
• Security, idiomatic interfaces, HTML5 capabilities, CLJS advantages
Thursday, June 21, 12
SHORELEAVE• CLJS’ process problem
• publish/subscribe - functions, atoms, storage, workers can be topics
events, callbacks, the DOM
Thursday, June 21, 12
SHORELEAVE• All calls to between server-client are CSRF-protected
• “I can go anywhere”
exposing server-side namespaces
Client
ServerThursday, June 21, 12
CLJS:ONE COMPARISON
• Events - (fire ...) (react-to ...)
• Tightly coupled to “bus”; Are predicates useful?
• Event logic gets littered in functions
• App structure is similar, wiring an application is similar
• Less browser support, less remote support
•Much better documentation/learning; More eyes; More hands
Thursday, June 21, 12
BUILDING AN APPLICATION
• main.cljs - set history, brepl, .-onload, hook up pubsub
• controllers.cljs - join library, API, and DOM tweaks
• listeners.cljs - attach all DOM listeners
• render.cljs - define all DOM actions
• VERB.cljs - additional libraries, `search.cljs`
structure
Thursday, June 21, 12
BUILDING AN APPLICATIONstructure
Thursday, June 21, 12
QUICK DEMOS
Thursday, June 21, 12
Paul [email protected]
@ohpauleez
PRODUCTION CLOJURESCRIPT
Comments, Questions, Concerns
Thursday, June 21, 12