by petercrona · 2y ago · 0 comments
Not sure if I fully get your idea about having a configuration file and templates. Would it be a convenient and concise way to create "simple" pages basically? Pages that are "generic", e.g. all just displaying some content? So you would only need to create more complex pages outside the config, e.g. those that are interactive?
Part of the motivation is to optimize the developer experience for any given app, with the observation that all UI apps, at least within a specific context like the DOM/HTML/REST, can be fully abstracted away. Development would then become mostly about specifying the unique information for that stack and context, i.e. server endpoint url, response data structure, html structure, and event processing hooks. In other words, it's supplying only the minimum required amount of information to build arbitrarily complex applications. "Minimal" here is not necessarily simple, it could still be something complex, it would just be unique to that app.
I didn't get much working with PureScript, as I was still exploring some existing frameworks that might already achieve this, but as a quick example, it would be something like:
import models // contains pure functions for data mapping / normalization
import views // contains templates and styles
import controllers // contains event mappings
export {
view: view1,
"component_name": {
model: model1,
views: [ view2, view3 ],
controllers: [ controller 1 ]
options: { ... }
},
}