SuperScript

SuperScript offers a means of declaring assets in one part of a .NET web solution and have them emitted somewhere else.

What Does It Do?

SuperScript has been built as a flexible, modular set of libraries, each offering slightly different functionality, often building on top of other SuperScript modules. Consequently, the easiest way to explain what SuperScript does is to use some examples.

SuperScript has two aspects:

Declarations

A declaration refers to a type of object which you describe to SuperScript, and which you will later ask SuperScript to return in a different form.

Some examples might include

  • JavaScript variables or function calls declared in server-side code, or a <script> block on a WebForms .aspx file or an MVC Razor view
  • HTML templates declared in server-side code, or a <script> block on a WebForms .aspx file or an MVC Razor view

The base declaration is easily extendable to cover any other concerns.

For example, supposing a developer plans to write their entire CSS in the webpage's <head> section, yet the selecters were declared throughout their server-side application: a declaration could be derived which allows the developer to programmatically (or using a container control) declare their CSS selecters to SuperScript, thus gathering up all these selecters into a single collection.

Emissions

An emitter is an object which renders one or more declarations in a pre-determined way and in a specific location.

For example

  • Placing all JavaScript declarations at an optimal location on a webpage
  • Moving declarations into an external file and writing a <script> tag on the webpage

The emitting of declarations is the act of rendering specific declarations, groups of similarly-processed declarations, or all declarations in an optimal place.

For example, by declaring JavaScript variables against a JavaScript-specific emitter, all JavaScript variables may be emitted in a specific location, typically immediately before the </body> tag.

Furthermore, emitters also offer processing functionality which offers opportunities for modifying the collection of declarations, or per-compiling HTML templates.

Read more about emitters here, though you should probably read about the core concepts first.

Where Next?

SuperScript offers a variety of functionality and consequently consists of multiple, optional libraries. This page lists each of the current projects along with a brief explanationof the functionality offered.

View the current projects

Although SuperScript's functionality is divided across multiple libraries, the fundamentals are common to each. This page explains the core concepts behind SuperScript.

Read an explanation of the core concepts