I've been working on and off on a library - actually a collection of libraries - for some time now. Longer than I really should have but the original idea grew arms and legs. It got to a releasable level at the end of last year, and then it took me about 6 weekends to write all the documentation for it.
And after that I was so fed up of looking at it that I tried to forget about it. But then I told myself that unless people hear about it, no-one's going to use it, which would mean that all the work was for nothing.
It's called SuperScript.
At its simplest, a declaration contains a server-side entity which you wish to have transformed into a client-side entity.
I've tried to make it as easy as possible to add declarations from wherever is most convenient for that declaration: from the config file, code-behind, MVC controllers, Razor views, WebForms...
The figure above shows that wherever declarations are made, they are all added to the same collection.
This pipeline then transforms these declarations. And exactly how it transforms them is determined by the modifiers which you have declared for that pipeline. Said pipeline then emits these transformed declarations, which is why the pipelines are actually called emitters.
So just to be clear, you pass it declarations which are then run through a process (a process which is determined by you), with the output being written to the webpage.
And one last technical point: emitters consist of stages, with a transform occurring at each stage.
The above diagram demonstrates the stages inside the emitting process, and how the result from the previous stage is fed directly into the subsequent stage. Each stage offers an opportunity for a slightly different transformation.
- I've tried to offer as many different means as possible of making declarations - in code, in the config file, and on Razor and WebForms views. Each of these permits the developer to specify which emitter should be used for that declaration.
The infrastructure is built in a way which permits you to pass any sort of declaration through the emitter. I've also built modifiers which work with some HTML templating engines.
I won't go into more detail at this point. There's tons more documentation here. It took a lot of time to write so I'd be pleased if someone read it.
I actually built a kind of mini-CMS for the documentation.
All the libraries are on GitHub, and each of the libraries has a NuGet package.
There are currently 14 SuperScript-related projects (a core project and essentially 13 add-ins) on GitHub.
And before you point it out to me, I'm aware that all the configuration stuff will have to be updated for ASP.NET 5. I've got a couple of other little projects I want to do before I add the log icfor parsing the .NET 5 config files. And just getting my head around ASP.NET 5 will be a project in itself.