4.0.0-alpha.121 • Published 10 months ago

@c11/engine.cli v4.0.0-alpha.121

Weekly downloads
53
License
MIT
Repository
-
Last release
10 months ago

Code11 Engine

Engine is a meta-framework for creating web applications.

Engine keenly focuses on developer productivity while allowing creating robust web applications with unprecedented simplicity.

Goals

Engine strives to build applications with

  • Small codebase. Less code, less bugs, more hairs still on head
  • Less work for computer. Only compute what is needed for faster applications
  • Less work for developer. Minimal API which gets out of developers' way. Allows focusing on business problems, not Engine problems

You can read more about the principles behind Engine and more on Engine Documentation site.

Run

Engine provides a convenient CLI to work with engine apps.

npm i -g @c11/engine.cli
engine create my-app
cd my-app
npm start

Build

Engine react applications are pretty much written like any other React application, with few differences:

  1. Only functional react components can become Engine views
  2. React components need to be labeled with view macro
  3. State dependencies of a view are declared in its arguments (also called "header" of the view)

For example:

import React from "react";
import { view, observe, update, producer } from "@c11/engine.macro";

const greeter: producer = ({
  name = observe.name,
  updateGreeting = update.greeting
}) => {
  if (!name) {
    updateGreeting.set("Bye bye");
  } else {
    updateGreeting.set("Hello");
  }
};

const App: view = ({
  name = observe.name,
  greeting = observe.greeting,
  updateName = update.name
}) => {
  return (
    <>
      <h1 className="App-header">
        {greeting} {name}
      </h1>
      <input
        value={name}
        onChange={e => updateName.set(e.currentTarget.value)}
      />
    </>
  );
};

(App as any).producers = [greeter];

export default App;

This tiny example demonstrates pretty much all the Engine concepts needed to use it!

Components labeled as view can observe anything from state, and update anything in the state.

Functions labeled as producer behave pretty much the same way as views, but don't render anything on screen. Producers are where the business logic should live.

Head over to the React Quick start tutorial for a more involved introduction to building an Engine React app.

4.0.0-alpha.121

10 months ago

4.0.0-alpha.120

10 months ago

4.0.0-alpha.118

1 year ago

4.0.0-alpha.117

2 years ago

4.0.0-alpha.116

2 years ago

4.0.0-alpha.115

2 years ago

4.0.0-alpha.103

2 years ago

4.0.0-alpha.104

2 years ago

4.0.0-alpha.107

2 years ago

4.0.0-alpha.111

2 years ago

4.0.0-alpha.113

2 years ago

4.0.0-alpha.102

2 years ago

4.0.0-alpha.99

2 years ago

4.0.0-alpha.101

2 years ago

4.0.0-alpha.97

2 years ago

4.0.0-alpha.96

2 years ago

4.0.0-alpha.98

2 years ago

4.0.0-alpha.90

2 years ago

4.0.0-alpha.86

2 years ago

4.0.0-alpha.85

2 years ago

4.0.0-alpha.84

2 years ago

4.0.0-alpha.83

2 years ago

4.0.0-alpha.89

2 years ago

4.0.0-alpha.87

2 years ago

4.0.0-alpha.82

3 years ago

4.0.0-alpha.81

3 years ago

4.0.0-alpha.80

3 years ago

4.0.0-alpha.79

3 years ago

4.0.0-alpha.78

3 years ago

4.0.0-alpha.77

3 years ago

4.0.0-alpha.76

3 years ago

4.0.0-alpha.75

3 years ago

4.0.0-alpha.73

3 years ago

4.0.0-alpha.72

3 years ago

4.0.0-alpha.70

3 years ago

4.0.0-alpha.69

3 years ago

4.0.0-alpha.68

3 years ago

4.0.0-alpha.67

3 years ago

4.0.0-alpha.66

3 years ago

4.0.0-alpha.64

3 years ago

4.0.0-alpha.63

3 years ago

4.0.0-alpha.62

3 years ago

4.0.0-alpha.61

3 years ago

4.0.0-alpha.59

3 years ago

4.0.0-alpha.58

3 years ago

4.0.0-alpha.57

3 years ago

4.0.0-alpha.51

3 years ago

4.0.0-alpha.49

3 years ago

4.0.0-alpha.45

3 years ago

4.0.0-alpha.43

3 years ago

4.0.0-alpha.42

3 years ago

4.0.0-alpha.41

3 years ago

4.0.0-alpha.39

3 years ago

4.0.0-alpha.40

3 years ago

4.0.0-alpha.38

3 years ago

4.0.0-alpha.37

3 years ago

4.0.0-alpha.36

3 years ago

4.0.0-alpha.35

3 years ago

4.0.0-alpha.34

3 years ago

4.0.0-alpha.33

3 years ago

4.0.0-alpha.32

3 years ago

4.0.0-alpha.31

3 years ago

4.0.0-alpha.30

3 years ago

4.0.0-alpha.28

3 years ago

4.0.0-alpha.29

3 years ago

4.0.0-alpha.27

3 years ago

4.0.0-alpha.26

3 years ago

4.0.0-alpha.25

3 years ago

4.0.0-alpha.24

3 years ago

4.0.0-alpha.23

3 years ago

4.0.0-alpha.22

3 years ago

4.0.0-alpha.20

3 years ago

4.0.0-alpha.21

3 years ago

4.0.0-alpha.19

3 years ago

4.0.0-alpha.17

3 years ago

4.0.0-alpha.18

3 years ago

4.0.0-alpha.15

3 years ago

4.0.0-alpha.14

3 years ago

4.0.0-alpha.10

3 years ago

4.0.0-alpha.9

3 years ago

4.0.0-alpha.8

3 years ago

4.0.0-alpha.7

3 years ago

4.0.0-alpha.6

3 years ago