Core Concepts

Coralite is built on a "Native Web" philosophy. We believe that the most performant and maintainable web applications are those that embrace standard DOM APIs and minimize framework abstraction layers like the Virtual DOM.

Smart State, Dumb Template #

In Coralite, we follow a strict separation of concerns called Smart State, Dumb Template. This approach eliminates the "Virtual DOM tax" by performing direct token replacement during rendering.

The Reactivity Engine #

Coralite's reactivity is powered by a sophisticated Proxy-based system that manages the flow of data between your server-side data, your derived logic, and your client-side interactions.

text
Code copied!

    +-------------------+           +-------------------+
    |    Attributes     |           |   Server State    |
    | (HTML Attributes) |           |  (Async Fetching) |
    +---------+---------+           +---------+---------+
              |                               |
              +---------------+---------------+
                              |
                     +--------v--------+
                     |  Unified State  | <-----------+
                     | (Reactive Proxy)|             |
                     +--------+--------+             |
                              |                      |
              +---------------+---------------+      | (triggers)
              |                               |      |
      +-------v-------+               +-------^------+-------+
      |   Template    |               |       Getters        |
      | (Static HTML) |               | (Derived, Read-Only) |
      +---------------+               +----------------------+
              |
              | (imperative control)
              |
      +-------v-------+
      |    Client     |
      | (Read / Write)| -- (mutates state) --> [Unified State]
      +---------------+
    

There are two primary ways to interact with state:

Lazy Deep Reactivity #

A common performance bottleneck in modern frameworks is the cost of making large objects or arrays reactive. Coralite solves this with Lazy Deep Reactivity.

Instead of recursively walking your entire data structure the moment it's assigned, Coralite only wraps nested objects in a Proxy the exact moment they are accessed. If your component has a list of 1,000 users but only renders the first 10, you only pay the reactivity cost for those 10 users. This makes Coralite exceptionally efficient for data-heavy applications.

Native Web Standards #

Coralite doesn't invent new ways to solve old problems. We lean on the platform:

Pages as Consumers #

A fundamental architectural principle in Coralite is that Pages are consumers, not controllers. This means:

Start Building with Coralite!

Use the scaffolding script to get jump started into your next project with Coralite

Copied commandline!