I'm currently working on a Single Page Application library. I have always wondered what a perfect front end architecture would look like from a performance standpoint. Over the past few months I have been gradually improving upon a prototype that tries to be just that and I will soon release an alpha version with an open source license.

In fact, this portfolio is built with an early version of the library.

The library will allow you to efficiently fetch data while navigating across pages. Usual, navigation will behave similar to this:

  1. interpret a pathname as a corresponding entrypoint component
  2. load its data
    • load the component (if it's not cached)
    • load all of its dependencies (if any are not cached)
    • load the entrypoint component's context (data hash)
  3. cache them client-side with an expiry date
  4. render the entrypoint component with its context to the DOM

What it will be opinionated about:

  • componentizing everything
  • seperation of components and contexts
  • components' dependencies must be predictable
  • caching components clientside with expiry
  • not ever bundling/concatenating components

What it will not be opinionated about:

  • the way you choose to render html
  • the way you choose to add interactivity to the page
  • the templating engine you use
  • the way you choose to store data
  • what can be a component

What it will do:

  • fetch components and contexts for you
  • be efficient
  • introduce a client-side cache for components with expiry
  • handle pushstate
  • give you hooks to interact with that
    • page transitions
    • custom rendering
    • custom parsing

I hope this could give you an idea of what the library will be trying to accomplish. I really need to come up with a good name.