Atomic web development - Combining the power of npm, Browserify, Rework and more to build small, fully encapsulated client side modules
machinepacks
(but maybe there are alternative and better specs)
var componentAPI = componentName({
container : `domNodeOrSelector`, // maybe it should always be a dom node
options : {/* configuration options */},
data : `modelOrStreamOrEventEmitter`, // to initialize or update stuff
children : [ // this is optional, because maybe the component can use defaults if not provided
{ '__title' : titleComponent },
{ '__list' : listComponent },
{ '__sidebar : sidebarComponent }
]
});
This does say nothing about the Interface
that is returned from a call to any component, like componentName(..)
, titleComponent(..)
, listComponent(..)
or sidebarComponent(..)
.
But I imagine, that it should be possible to somehow formally define an Interface
, so that I can easily write a component that I can inject into an existing component to change it.
Maybe node machines are nice for defining those interfaces, but maybe there are alternatives :-)
What do you guys think of that?
menuComponent
or articleComponent
if i need too, or just build a new website component (by forking the existing one and changing it completely... The goal is to start with simple components and slowly build more complex ones over time