-
- Takes advantage of modern browser features where possible (e.g. postMessage and localStorage)
-
-
Continuous Integration for Mobile | LinkedIn Engineering
Help
-
- Modularity and reusability were at the heart of our decision to create Inject. LinkedIn has several dozen front-facing "properties" (pages, sites, products, modules, etc), some with overlapping JavaScript needs and some with unique ones. Before Inject, we would create one "global" JS payload with resources common to all pages, plus a page-specific payload for each property. While this kept the total number of http requests down, it was difficult to manage the dependencies. Moreover, we couldn't load things on demand, which is increasing in importance as we move more logic to the client.
-
-
Refactoring towards testable JavaScript, part 1 | The If Works
-
Organizing a project with JS.Packages | The If Works
-
Black-box criteria | The If Works
So if side-effect-heavy programs cause large API surfaces to be a problem, what should we do about it? The answer comes down to something I think of as ‘avoiding framework-isms’. This means that any time you have a framework or host environment in which user input or third-party code drives your application, the sooner you can dispatch to something you control the better. The classic example of this is the ‘fat model, skinny controller’ mantra popular in the Rails community: rather than dump lots of code in a controller that’s only invoked by the host server and framework, turn the request into calls to models. This way, the bulk of the logic is in objects that you control the interface to, and that are easy to create and manipulate, properties that also make them easy to test.
- So if side-effect-heavy programs cause large API surfaces to be a problem, what should we do about it? The answer comes down to something I think of as ‘avoiding framework-isms’. This means that any time you have a framework or host environment in which user input or third-party code drives your application, the sooner you can dispatch to something you control the better. The classic example of this is the ‘fat model, skinny controller’ mantra popular in the Rails community: rather than dump lots of code in a controller that’s only invoked by the host server and framework, turn the request into calls to models. This way, the bulk of the logic is in objects that you control the interface to, and that are easy to create and manipulate, properties that also make them easy to test.
- It means making sure orthogonal components of a user interface do not talk to each other directly, but publish data changes via a message bus.
- If a static type system helps you with that then have at it, but recognize when it’s a symptom of a deeper problem.
-