GithubHelp home page GithubHelp logo

garryyao / react-px-seed Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 211 KB

React app mix-and-match with Polymer Predix UI (Px)

Home Page: https://predix-ui.com

License: Other

JavaScript 23.77% CSS 2.57% HTML 73.66%

react-px-seed's Introduction

React Px Seed

An React-Redux based Predix Seed App mix and match with Predix UI (Polymer) web components.

Features

  • ✓ Polymer Web Component in form of high-order React Component, use props like native React Component.
  • ✓ Passing down props directly to the web component as properties instead of attributes, it's faster and safer, if you really need to pass attributes add a dollar sign ($) just like in Polymer.
  • Props in, events out, use Polymer's change notification events for up-ward data flow, fully respect React's unidirectional data-flow.
  • ✓ Support content distribution to web component via this.props.children.
  • ✓ Work with the standard ref API for accessing the rendered custom DOM element.
  • ✓ Work with Hot Module Replacement (HMR) /w [React Hot Loader](http://gaearon.github
  • ✓ Work with Polymer's tooling to create bundled/unbundled HTML Imports.
  • ▢ Support for Polymer/Web Component lifecycle callbacks.

Examples

Check the React components source for usage examples.

Directory Layout

├── components/                 # Shared or generic UI components
│   ├── WebComponent/                 # Polymer Web Component Adapter
│   ├── Layout/                 # Layout component
│   ├── TimeSeriesCard/                   # Predix Card Component
│   └── ...                     # etc.
├── node_modules/               # 3rd-party libraries and utilities
├── src/                        # Application source code
│   ├── home/                   # Home page
│   ├── history.js              # Handles client-side navigation
│   ├── main.js                 # <== Application entry point <===
│   ├── router.js               # Handles routing and data fetching
│   ├── routes.json             # This list of application routes
│   └── store.js                # Application state manager (Redux)
├── public/                     # Static files such as favicon.ico etc.
│   ├── elements/                   # The folder for pre-built Polymer web components
│   ├── dist/                   # The folder for compiled output
│   ├── favicon.ico             # Application icon to be displayed in bookmarks
│   ├── robots.txt              # Instructions for search engine crawlers
│   └── ...                     # etc.
├── test/                       # Unit and integration tests
├── tools/                      # Utility and helper classes
└── package.json                # The list of project dependencies and NPM scripts

Getting Started

Step 1. Make sure that you have Node.js v6 or newer and Yarn installed on your development machine.

Step 2. Clone this repository

$ cd react-px-seed
$ yarn install                  # Install project dependencies listed in package.json

Step 3. Compile and launch your app by running:

$ yarn start                    # Compiles the app and opens it in a browser with "live reload"

You can also test your app in release (production) mode by running yarn start -- --release or with HMR and React Hot Loader disabled by running yarn start -- --no-hmr. The app should become available at http://localhost:3000/.

How to Test

The unit tests are powered by chai and mocha.

$ yarn lint                     # Check JavaScript and CSS code for potential issues
$ yarn test                     # Run unit tests. Or, `yarn run test:watch`

How to Build and Deploy

If you need to build the project, simply run:

$ yarn build                    # Compiles the app into the /public/dist folder
$ cf push [your-app-name]                    # Push to Predix Cloud Foundry

react-px-seed's People

Contributors

garryyao avatar

Watchers

James Cloos 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.