by proc0 · 2y ago · 0 comments
> For instance, a to-do item will only "run" once, and any additional updates will need to happen via calls using its controller, or by it itself listening to events and reacting to them
Additionally, I think another feature of this framework would be using a configuration file as context, which uses some form of template files, and this way unless an abstract feature is needed, you can create entire apps by creating templates and one config file. I think TS might be a better choice than PureScript which I have not checked if it is even maintained anymore.
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: { ... }
},
}