All Projects → siddharthkp → Bae

siddharthkp / Bae

Licence: mit
react made easy

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bae

react-webpack2-skeleton
Get started with React with Webpack2, React-Router, Redux, Code Splitting and Server Rendering
Stars: ✭ 59 (-47.79%)
Mutual labels:  code-splitting, server-rendering
react-server-renderer
Yet another simple React SSR solution inspired by vue-server-render
Stars: ✭ 28 (-75.22%)
Mutual labels:  code-splitting, server-rendering
zedux
⚡ A high-level, declarative, composable form of Redux https://bowheart.github.io/zedux/
Stars: ✭ 43 (-61.95%)
Mutual labels:  code-splitting, zero-configuration
Kit Kat
kit-kat (Toolkit-kat) is a FREE Wireless Capture-card to stream your 3DS screen to your PC!
Stars: ✭ 100 (-11.5%)
Mutual labels:  streaming
Fiflow
flink-sql 在 flink 上运行 sql 和 构建数据流的平台 基于 apache flink 1.10.0
Stars: ✭ 100 (-11.5%)
Mutual labels:  streaming
Net Mdns
Simple multicast DNS
Stars: ✭ 105 (-7.08%)
Mutual labels:  zero-configuration
Create Nw React App
Create NW.js React apps with no build configuration.
Stars: ✭ 111 (-1.77%)
Mutual labels:  zero-configuration
Hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
Stars: ✭ 10,791 (+9449.56%)
Mutual labels:  streaming
Meteor
Meteor, the JavaScript App Platform
Stars: ✭ 42,739 (+37722.12%)
Mutual labels:  zero-configuration
Enime
Desktop application for anime fans :D
Stars: ✭ 104 (-7.96%)
Mutual labels:  streaming
Flixerr
The best free movie torrent streaming app.
Stars: ✭ 103 (-8.85%)
Mutual labels:  streaming
Pulsar Dotpulsar
The official .NET client library for Apache Pulsar
Stars: ✭ 101 (-10.62%)
Mutual labels:  streaming
Pravega
Pravega is 100% open source and community-driven. All components are available under Apache 2 License on GitHub.
Stars: ✭ 1,653 (+1362.83%)
Mutual labels:  streaming
Bigdata Notebook
Stars: ✭ 100 (-11.5%)
Mutual labels:  streaming
React Async Component
Resolve components asynchronously, with support for code splitting and advanced server side rendering use cases.
Stars: ✭ 1,441 (+1175.22%)
Mutual labels:  code-splitting
Node Tcp Streaming Server
Experimental TCP video streaming server written in node.js. Streaming over TCP and redistributing using WebSockets.
Stars: ✭ 100 (-11.5%)
Mutual labels:  streaming
Flink Learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Stars: ✭ 11,378 (+9969.03%)
Mutual labels:  streaming
Twitch Channel Points Miner V2
A simple script that will watch a stream for you and earn the channel points.
Stars: ✭ 100 (-11.5%)
Mutual labels:  streaming
Leafplayer
LeafPlayer is a fast and modern personal music streaming server, easily installable by using Docker.
Stars: ✭ 101 (-10.62%)
Mutual labels:  streaming
Nymphcast
Audio and video casting system with support for custom applications.
Stars: ✭ 2,010 (+1678.76%)
Mutual labels:  streaming



react made easy

 

Build Status

 

minimal setup

npm install bae --save

Add these 2 lines in your package.json

"scripts": {
  "dev": "bae dev",
  "start": "bae"
}

Start the dev server with npm run dev. You just setup server rendering with hot module replacement and hot reload!

 

pages

Make pages like it's the 90s.  

  • pages are routes: pages/about renders /about of your website

  • pages are rendered on the server

  • pages are streamed to the browser for quick time-to-first-byte

  • built in code splitting, each page gets it's own page.js

  • code shared between pages is served as common.js for long term caching

  • pages/home.js renders the homepage /

  • why is this important?

 

import React from 'react'

export default class extends React.Component {
  constructor (props) {
    super(props)
    this.state = {message: 'hello'} // rendered on the server
  }
  componentDidMount () {
    this.setState({message: 'hello world'}) // updated on the browser
  }
  render () {
    return <div>{this.state.message}</div>
  }
}

 

asyncComponentWillMount

React has a lifecycle method that get's called on the server componentWillMount that can be used to set data for server rendering. But, it does not support asynchronous data fetching before rendering the component.

bae introduces a new lifecycle method to pages that runs only on the server.

import React from 'react'

export default class extends React.Component {
  constructor (props) {
    super(props)
    this.state = {username: 'siddharthkp'}
  }
  asyncComponentWillMount () {
    /*
      Return a promise.
      It will get resolved on the server and passed as props to the component.
    */
    return axios.get(`https://api.github.com/users/${this.state.username}`)
  }
  render () {
    return <div>{this.props.bio}</div>
  }
}

 

components

the usual, nothing special here.

 

styling

comes with styled-components which gets rendered on the server.

 

static assets

keep your images, fonts, etc. in a directory named static

 

production

npm start will compile, optimize and serve your app.

 

example

Check out the example applications to see how simple this is.

 

like it?

⭐️ this repo

 

todo

  • init by default
  • easy api for lazy loading components
  • server worker support
  • make first build faster

 

license

 

MIT © siddharthkp

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].