Server rendering

Akili is not isomorphic, but we implemented the server rendering possibility. Use nodejs library akili-connect. It is based on jsdom. So you are limited only by the capabilities of this library.

On the client side, you don't need to do anything extra. There is only one feature:

class MyComponent extends Akili.Component {
  compiled() {
    return new Promise((res) => {
      setTimeout(res, 1000);
    });
  }

  resolved() {
    return new Promise((res) => {
      setTimeout(res, 1000);
    });
  }
}

So server will be waiting for resolving of the promises in this methods before rendering. You can do anything you want, just don't forget return promise in all necessary components.

As for the server side, please read the documentation of our library to make a few simple steps.

At the moment, rendering takes place twice: on the client and on the server, including all async requests. This solution is suitable only if you really need rendering for SEO. We will try to improve it in the future.