Git Product home page Git Product logo

relational-theory's Introduction

About

These are some experiments with using React and Relay for both server and client side rendering.

Setup

$ npm install yarn -g
$ yarn install

Then start the development server with:

$ yarn start

To run storybooks:

$ yarn run storybooks

Development environment

  • Rather than restart the full server process, which is often done with tools like nodemon, this project only reloads the files in ./app when FS changes occur.

  • In addition, webpack is configured to dynamically host client sources, meaning that these will also automatically be recompiled when FS changes occur.

  • Finally, webpack is configured to notify the client of changes to sources which then fetches the updated sources and triggers a re-render of the React components that are on screen.

This setup is largely based on https://github.com/glenjamin/ultimate-hot-reloading-example.

TODO

  • Take a look at react-native-web, how well it works, and if it would make sharing our components across platforms possible out of the box.

Notes

  • In order for react-hot-loader to be able to reload components and maintain their current state, rather than a page reload, the components have to be exported themselves, not just the Relay wrapper container (more info). E.g.
export class Artist extends React.component {
  ...
}

export default Relay.createContainer(Artist, {
  ...
})

Examples

Hot Loader in Action

hot loader in action

Hot Loader Syntax Error Overlay

hot loader syntax error

relational-theory's People

Contributors

alloy avatar orta avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.