• Stars
    star
    292
  • Rank 142,152 (Top 3 %)
  • Language
    JavaScript
  • Created almost 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

fast websites, by default

rakt

[work in progress. come back when it's done!]

a framework, without any framework. for react/dialects. in a box.

usage

npm install rakt -g

quick start

make a script, say index.js

export default App = () => 
  <div>hello world</div>

then run

$ rakt index.js   

the big idea

one addition to react-router's <Route/> api

import { Route } from 'react-router'
- import User from './user.js'

<Route path='/user/:id'
-  component={User}
+  module='./user.js'
/>

behind the scenes, rakt handles code splitting + SSR + resource loading

optionally, use render/children as you normally would

<Route path='/user/:id'
  module='./user.js'
  render={ ({ Module }) => Module ? 
    <Module.Profile /> : 
    <span>loading...</span> )}
/>

defer

you can prevent ssr for a <Route/> with the defer attribute. great for starting apps faster, and offloading some work to the browser. rakt manages efficiently preloading code and/or data for the same.

<Route path='/user/:id' module='./user.js' defer />

todo - <Defer/>

leaf

[todo]

preserve

[todo]

data fetching

rakt takes data-fetching to the next level, by letting you colocate actual server side code alongside your component

import { initial } from 'rakt'

@initial(({ req, done }) => {    
  let db = require('mongo')(3111)
  db.get('users', req.params.id, done)  
  // gets removed from client side bundle(!)
})
export default class User {
  render(){
    return <div>
      {this.props.data || 'loading data'}
    </div>  
  }  
}

// augment this with your own solutions - relay, redux, etc

rakt will take care of efficiently fetching, hydration(for ssr), caching, etc

  • todo - @get, @post, @put, @del
  • todo - @socket, @sse, @memory, etc
  • todo - cache keys / idents

css

[todo]

rakt lets you write 'inline' css via glamor

<div css={{ color: 'red' }}>
  bloody valentine
</div>

prpl ootb

[todo]

rakt apps should conform to the prpl pattern without any extra work

cli

[todo]

rakt <script> <options>

rakt build <script> path/to/folder

options

  • ssr - server side rendering - default true
  • splits - code splits - default true
  • production - production mode - default false
  • css - 'inline' css - default true

integrating with other apps/frameworks

[todo]

you can take pieces from rakt and use them in your own app sans the rakt stack.

  • babel/webpack pipeline
  • <Layout/>
  • api server
  • route-aware data fetcher

implementation

[todo]

constraints

  • module must be a string literal
  • when using module, path must be a string literal
  • might overfetch data for some edge cases

todo -

  • prefetch links
  • websockets?
  • work with aliased modules
  • sw-precache, etc
  • use named exports (incl data fetches)
  • manifest and such
  • progressive css
  • leaf nodes / wc-like behavior
  • cache keys for @initial
  • react-native?
  • in-house <Route/>, <Link/>, etc
  • optimistic updates
  • rhl
  • fonts and icons and svgs and images and such

More Repositories

1

glamor

inline css for react et al
JavaScript
3,661
star
2

markdown-in-js

inline markdown for react/jsx
JavaScript
788
star
3

react-act-examples

Notes and examples on ReactTestUtils.act(...)
JavaScript
517
star
4

glam

crazy good css in your js
JavaScript
507
star
5

css-suspense

css loading for react
JavaScript
310
star
6

ratpack

ready. set. go!
JavaScript
198
star
7

freezus

magic component for transitions between screens
JavaScript
188
star
8

bs-nice

css-in-reason
OCaml
182
star
9

react-modules

code splitting as a component
JavaScript
171
star
10

react-springs

react+rebound
JavaScript
91
star
11

react-tpl

abusing the platform
JavaScript
81
star
12

favre

jsx -> favicon
JavaScript
75
star
13

react-lazy-ssr-workers

react 18's streams running on cloudflare workers
JavaScript
67
star
14

react-redux-saga

react components for redux-saga
JavaScript
67
star
15

disto

mildly opinionated flux
JavaScript
65
star
16

react-ease

animations for react
JavaScript
53
star
17

glamor-stream

streaming inline glamor for your html
JavaScript
50
star
18

esjest-transform

A fast jest transform
JavaScript
45
star
19

y-workers

A Yjs backend on Cloudflare Workers
CSS
36
star
20

react-state

localized react state component
JavaScript
34
star
21

es-grid-kiss

es6 tagged literals + css grids
JavaScript
33
star
22

jsxn

jsx notation for json trees
JavaScript
32
star
23

require.import

sync-friendly code splits for webpack
JavaScript
26
star
24

react-superagent

universal ajax as a react component
JavaScript
26
star
25

react-loadscript

script tag as a react component
JavaScript
25
star
26

kv

a fast, immutable key-value store
JavaScript
24
star
27

durable-chat

Chat, with Durable Objects
TypeScript
23
star
28

routah

yet another router for react
JavaScript
22
star
29

iso-gol

conway's game of life, projected onto isometric 3d space in css
JavaScript
21
star
30

vite-plugin-react-jsx

A Vite plugin that enhances jsx transformation for React
TypeScript
18
star
31

glamor-inline

inlined css in your html
JavaScript
15
star
32

hotrod

JavaScript
12
star
33

babel-macros

macros for babel. I think.
12
star
34

react-router-modules

react-modules + react-router + 🌈
JavaScript
12
star
35

pretty.fly

yet another async thing
JavaScript
12
star
36

proposal-error-assert

Error.assert() proposal for ECMAScript
TypeScript
11
star
37

oia

yet another lisp that compiles to javascript
JavaScript
9
star
38

xen

jsx+generators+p5.js
JavaScript
9
star
39

react-animated-web-bootleg

JavaScript
9
star
40

asyncstorage-mock

a mock for react-native's asyncstorage api. useful for testing.
JavaScript
9
star
41

falcro

falcor + react. hype!
JavaScript
7
star
42

built-devtools

chrome's devtools frontend, built.
JavaScript
7
star
43

react-debounce

debounce as a component
JavaScript
7
star
44

itree

trees with immutable.js
JavaScript
7
star
45

css-in-js-workshop

css, in your js, in your head, in your heart
JavaScript
6
star
46

max-payge

for max, because he asked
JavaScript
6
star
47

remixflare

A starterkit for remix + cloudflare oauth
TypeScript
6
star
48

vite-jest

A configuration for runing jest tests inside vite
TypeScript
5
star
49

threepointone

VALUE
JavaScript
5
star
50

durable-crons-example

Durable Crons?
TypeScript
5
star
51

react-timing

timing as a component
JavaScript
4
star
52

twain

dynamic tweening engine
JavaScript
4
star
53

dahi

kefir, for js-csp
HTML
4
star
54

react-act-example

For Jason - https://twitter.com/CarrickJason/status/1171156605234077696
JavaScript
4
star
55

myxtape

content management systems for the new world
JavaScript
4
star
56

genno

async transforms / flow control with js-csp
JavaScript
3
star
57

riki

evil markup for documents
JavaScript
3
star
58

k

build systems, revisited
JavaScript
3
star
59

disto-example

disto examples, with hot loading of stores/views
CSS
3
star
60

prpl-with-react-example

whatevs dawg
JavaScript
2
star
61

progress

progress bar, alΓ‘ youtube
JavaScript
2
star
62

shuffle

do the dom shuffle
JavaScript
2
star
63

react-metronome

tick-tock as a component
CSS
2
star
64

bus

global event bus
JavaScript
2
star
65

vure

2
star
66

disto-hot-loader

hot load disto/flux stores
JavaScript
2
star
67

fn

tiny lib of functional helpers for personal projects
JavaScript
2
star
68

traced

JavaScript
2
star
69

times

functional times/map.
JavaScript
1
star
70

sandbox

sandboxed modules, ala YUI
JavaScript
1
star
71

iso

isometric math helpers
JavaScript
1
star
72

rust_project

Rust
1
star
73

braid

experiments in clojurescript
JavaScript
1
star
74

lepton-labs-multiplayer

TypeScript
1
star
75

iso-grid

JavaScript
1
star
76

game-of-life

generic game of life algorithm implementation in javascript
JavaScript
1
star
77

beam

funky get/set styles. WORK IN PROGRESS.
JavaScript
1
star
78

glamor-perf

HTML
1
star
79

async-act-test-21-11

Created with CodeSandbox
JavaScript
1
star
80

react-redux-optimist

react bindings for redux-optimist
JavaScript
1
star
81

zoui

HTML
1
star
82

Sangam

Static asset package generation and management
JavaScript
1
star
83

native-markup

JavaScript
1
star
84

scripts

useful (to me)
Ruby
1
star
85

oiarepl

a repl for oia
JavaScript
1
star
86

claw

css transforms without the heartache
JavaScript
1
star
87

next-repro-react-dupe

repro to show duplicated react in next's edge-chunk
TypeScript
1
star
88

test-partysocket-reconnect

TypeScript
1
star
89

workers-ai-provider

A Workers AI provider for the vercel AI SDK
TypeScript
1
star