All Projects → insin → Isomorphic Lab

insin / Isomorphic Lab

Isomorphic React experimentation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Isomorphic Lab

Arc
React starter kit based on Atomic Design
Stars: ✭ 2,780 (+1830.56%)
Mutual labels:  universal, isomorphic, react-router
React Router Form
<Form> is to <form> as <Link> is to <a>
Stars: ✭ 58 (-59.72%)
Mutual labels:  experiment, forms, react-router
Isomorphic React
A simple but powerful React application built on a standards-compliant back-end
Stars: ✭ 318 (+120.83%)
Mutual labels:  universal, isomorphic, react-router
React Redux Styled Hot Universal
react boilerplate used best practices and focus on performance
Stars: ✭ 147 (+2.08%)
Mutual labels:  universal, isomorphic, react-router
react-ssr-spa
Server side rendered single page app using reactjs official libraries.
Stars: ✭ 30 (-79.17%)
Mutual labels:  isomorphic, react-router, universal
FlipED
A LMS built specifically for Thailand's Education 4.0 system.
Stars: ✭ 24 (-83.33%)
Mutual labels:  isomorphic, react-router, universal
Universal React Tutorial
📓 How to build universal web apps with React.
Stars: ✭ 136 (-5.56%)
Mutual labels:  universal, isomorphic, react-router
Isomorphic Relay Router
Adds server side rendering support to react-router-relay
Stars: ✭ 141 (-2.08%)
Mutual labels:  isomorphic, react-router
Simple Universal React Redux
The simplest possible Async Universal React & Redux Boilerplate app, that works on both Mac and Windows
Stars: ✭ 58 (-59.72%)
Mutual labels:  universal, react-router
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (-2.08%)
Mutual labels:  isomorphic, react-router
Preact Redux Isomorphic
preact-redux-isomorphic PWA SPA SSR best practices and libraries in under 80kB page size (for live demo click the link below)
Stars: ✭ 85 (-40.97%)
Mutual labels:  isomorphic, react-router
Universal React Demo
ES6 demo of a simple but scalable React app with react-router, code splitting, server side rendering, and tree shaking.
Stars: ✭ 50 (-65.28%)
Mutual labels:  universal, isomorphic
Jose
Universal "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK with no dependencies
Stars: ✭ 1,029 (+614.58%)
Mutual labels:  universal, isomorphic
Webpack Isomorphic Dev Middleware
The webpack-dev-middleware, but for isomorphic applications
Stars: ✭ 38 (-73.61%)
Mutual labels:  universal, isomorphic
Danf
Danf is a Node.js full-stack isomorphic OOP framework allowing to code the same way on both client and server sides. It helps you to make deep architectures and handle asynchronous flows in order to help in producing scalable, maintainable, testable and performant applications.
Stars: ✭ 58 (-59.72%)
Mutual labels:  universal, isomorphic
React Redux Saucepan
A minimal and universal react redux starter project. With hot reloading, linting and server-side rendering
Stars: ✭ 86 (-40.28%)
Mutual labels:  universal, react-router
Push Starter
React Redux Starter with SSR 🤖
Stars: ✭ 43 (-70.14%)
Mutual labels:  universal, isomorphic
React Base
atSistemas React/Redux Isomorphic Platform
Stars: ✭ 82 (-43.06%)
Mutual labels:  universal, isomorphic
Koa React Universal
lightweight React-Koa2 universal boilerplate, only what is essential
Stars: ✭ 112 (-22.22%)
Mutual labels:  universal, isomorphic
React Lessons
Tool for creating and taking interactive React tutorials
Stars: ✭ 103 (-28.47%)
Mutual labels:  experiment, react-app

Isomorphic Lab

logo

This repo is being used to experiment with writing isomorphic JavaScript apps with React 0.13.X, React Router 1.0.0-betaX and express.

It uses newforms for form display and validation on both ends - this could be done manually with any component which can populate its form fields and display error messages based on its props and state, though.

Functionality

Data fetching

React Router's experimental AsyncProps is used to fetch data, with route components defining a static loadProps(params, callback(err, data)) function, which will be called when their route is matched against the current URL.

Title generation (source)

Route components can define a static title attribute or a synchronous getTitle(props, params) function, which will be called when the route is matched against the current URL.

Any async props which will be passed to the component when it's rendered will be passed as the first first argument to getTitle().

Each handler should only define or return its own portion of the URL. e.g. the top-level component might define the site name as a static title, while a nested blog post component might define a static getTitle(props) which returns the title of the post.

By default, these title parts will be reversed and joined with a mid-dot to form the final title to be included in a <title> element or set on document.title depending on the environment - this is configurable.

Client rehydration

The initial render will make use of AsyncProps.rehydrate() with initial async props provided via a window.__PROPS__ variable when running on the client.

Express middleware (source)

Usage:

var reactRouter = require('./react-router-middleware')

app.use(reactRouter(routes[, options]))

options.title

An object to be passed as options to getTitle() - available options are:

reverse (true) - should title parts be reversed into most-specific-first order before joining?

join (' · ') - string to be used to join title parts.

defaultTitle ('(undefined)') - default title to use if none of the matched route components provide title parts.

Response handling

In addition to performing the common functionality described above, the express middleware handles the following scenarios:

Successful rendering

For a regular, successful Handler render, a 'react' view will be rendered with the following locals:

title - generated document title

html - rendered component output

props - props which were used to render the component, serialised to a JSON string.

Non-GET requests

Non-GET request bodies will be set on the Router's location state as a body property.

The request method will also be available as a method property.

Redirecting

If transition.to() is used in an onEnter() hook, this will be turned into an HTTP 303 Redirect response...

Re-rendering

...unless the redirect location has been given some state. In this case, the middleware will create a new redirect location and run routing on it.

This can be used to render another route back to the user as a response, e.g. rendering a form with user input and validation errors in response to a POST request which contained an invalid body.

Errors

If an error is detected at any time, the middleware will call its next() callback with the error to allow whatever error handling middleware is configured elsewhere to pick it up.

MIT Licensed

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].