Building Front-End Web Apps that Scale talk from FED London at Yahoo! London.
Concepts and practices that fed into the workflows and application architecture that was core to the BladeRunnerJS toolkit.
7. Caplin Trader
• SDK:
• ~1,000 JavaScript files
• ~131,000 LoC
• ~131 lines per file
• ~650 test files
• ~95,000 test LoC
• Typical Apps:
• ~425 JavaScript files
• ~50,000 LoC
• ~117 lines per file
• ~200 test files
• ~21,000 test LoC
35. What is a service?
• Use services to access shared resources
• In-app inter-component messaging
• Persistence Service
• RESTful Service
• Realtime Service
36. Services are a Contract/Protocol/Interface
https://www.youtube.com/watch?v=JjqKQ8ezwKQ
41. Using Services
• Use a unique identifier for each service
• Register (code or config). Code example:
• Get
http://martinfowler.com/articles/injection.html#ADynamicServiceLocator
var chatService = require( ‘!chat.service’ );
42. Why use services?
• Modular architecture
• Features should not directly communicate
• Easily change implementation
• Implementations can be injected for different scenarios:
• Workbench / Test / App
50. End-to-End Module Testing
• Testing features in isolation
• Change view model and assert against mocked Service
• Inject fake service, make calls and assert View Model
51.
52. Need Proof?
Our full suite Caplin Trader testing time
went from
>8 Hours
< 30 minutes
Much less for a single feature
http://j.mp/jsscale