Atomic web development - Combining the power of npm, Browserify, Rework and more to build small, fully encapsulated client side modules
hi guys,
following scenario:
my-component module:
package.json:
{style: main.less}
main.less:
import 'my-mixins' //works well
import 'another-component' //works well
import 'path/to/a/3rd-party/css/file.css'
app-module:
main.less:
import 'my-components'
atomify-config:
css: {
entry: 'src/main.less',
alias: 'src/app.css',
transforms: ['partialify'],
assets: {
prefix: '/temp/fonts/',
dest: 'temp/fonts'
}
}...
what happens here is that the 'file.css' import is not bundled/reworked into my output.css...
So, in general I would like to use atomify with the builtin npm-less but I have also to be able to import/bundle css-files like done with rework-npm.
Any ideas?
cheers, jan
Typed Web Component
(if that makes sense)
calendar
, a pinterest wall
and a todo list
, they could all be visual grids in the DOM, that support pagination, filtering, searching, sorting and dozens of other features. But a todo item
looks different from a pinterest card
looks different from a calendar day
. So I came up with example code i'd like to write...
var container=document.body, arr=require('data.json'), grid=require('typegrid'), elem=require('arrElem'); var API=grid(container, arr, elem);
grid
knows it's css/htmljs
and so does the elem
.grid(...)
, where one elem(...)
per item in the array is added.
var calendarAPI = grid(container, array, dayComponent), pinterestAPI = grid(container, array, pictureComponent), todoAPI = grid(container, array, todoComponent);
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