Coder Social home page Coder Social logo

tommyteavee / keystone-with-react-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laurenskling/keystone-with-react-engine

0.0 1.0 0.0 1.07 MB

KeystoneJS CMS with React Engine as rendering engine, so we can render backend .jsx templates

JavaScript 87.53% CSS 12.47%

keystone-with-react-engine's Introduction

keystone-with-react-engine

KeystoneJS CMS with React Engine as rendering engine, so we can render backend .jsx templates

KeystoneJS

I've used the 'yo keystone' command, to create a default KeystoneJS project, rewrote it to JSX templates and added React Engine as the view engine.

React

Webpack creates a bundle that can mount from the backend rendered html, including props. (thanks to React Engine boot)

Result

now you can write serverside pages with serverside data in JSX templating (bye bye Jade or Handlebars) and simultaniously write the user interaction in those files. onClick will work after mounting the frontend.

Possible extensions

  • React Engine supports React Router, if you like to not define your routes in express.
  • We can add hotloading at the express routes.

What I am not aiming at

This setup renders one page and allows interactions. It does not render a full SPA. If you will navigate to a next page in JS, you will not have your data prepared. I am not aiming at fixing that. This setup aims to give a better DX in creating a paged CMS-driven website.

Known bugs

  • the canAccessKeystone virtual doesn't work from props. Probably since the props is a JSON copy from the model. I've directly requested it in the middleware now to make it available.

keystone-with-react-engine's People

Contributors

laurenskling avatar

Watchers

 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.