Giter Club home page Giter Club logo

react-jss-hmr's Introduction

JSS Documentation site

http://cssinjs.org

Site generator features

  • Designed for multi-repo projects.
  • Loads versions using github API, allows users to select the version.
  • Renders everything at runtime.
  • Has SSR.
  • Doesn't need prepared .md files locally, loads everything via XHR from github.

Todo

Move the site engine to a separate repo. It can be actually used for any projects.

Issues

File a bug against cssinjs/jss prefixed with [site].

react-jss-hmr's People

Contributors

felthy avatar raghav-maheshwari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-jss-hmr's Issues

Few Questions

I have a few questions about the code.

Do we need this check, because the user should only add the plugin in the dev config anyway? This should remove the need for the ternary.

Is using the name here a good idea? Because when two components have the same name, we got a problem.

Also, I'm not a fan of the inline function in the ternary.

Plugin could not be registered at 'described-resolve'. Hook was not found.

Hi !

I tried this plugin as I said on the react-jss repo. I first tried your fix/hmr branch on the main repo and it works flawlessly.

I revert to the master branch and added this plugin to my webpack config, but it seems not working with webpack-dev-server
Here is the stack :

Error: Plugin could not be registered at 'described-resolve'. Hook was not found.
BREAKING CHANGE: There need to exist a hook at 'this.hooks'. To create a compatiblity l
ayer for this hook, hook into 'this._pluginCompat'.
    at Compiler.plugin (/Users/thomas/Dev/react-ssr/node_modules/tapable/lib/Tapable.js:63:9)
    at Compiler.deprecated [as plugin] (internal/util.js:70:15)
    at ReactJssHmrPlugin.apply (/Users/thomas/Dev/react-ssr/node_modules/react-jss-hmr/lib/ReactJssHmrPlugin.js:39:16)
    at webpack (/Users/thomas/Dev/react-ssr/node_modules/webpack/lib/webpack.js:37:12)
    at startDevServer (/Users/thomas/Dev/react-ssr/node_modules/webpack-dev-server/bin/webpack-dev-server.js:379:16)
    at portfinder.getPort (/Users/thomas/Dev/react-ssr/node_modules/webpack-dev-server/bin/webpack-dev-server.js:369:5)
    at /Users/thomas/Dev/react-ssr/node_modules/portfinder/lib/portfinder.js:160:14
    at /Users/thomas/Dev/react-ssr/node_modules/async/lib/async.js:52:16
    at /Users/thomas/Dev/react-ssr/node_modules/async/lib/async.js:269:32
    at /Users/thomas/Dev/react-ssr/node_modules/async/lib/async.js:44:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev:client: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev:client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/thomas/.npm/_logs/2018-07-10T07_07_21_439Z-debug.log
ERROR: "dev:client" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `npm-run-all --parallel dev:*`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Here is my webpack.config.js:

const path = require("path")
const HtmlWebPackPlugin = require("html-webpack-plugin")
const ReactJssHmrPlugin = require("react-jss-hmr/webpack")

module.exports = {
  entry: "./src/client/client.js",
  mode: "development",
  output: {
    path: path.resolve(__dirname),
    filename: "bundle.js"
  },
  devServer: {
    overlay: true,
    proxy: {
      "/api": {
        target: "http://localhost:3000"
      }
    }
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: "babel-loader"
      }
    ]
  },
  plugins: [
    new HtmlWebPackPlugin({
      template: "./src/client/index.html"
    }),
    new ReactJssHmrPlugin()
  ]
}

and my npm scripts

"scripts": {
    "dev:server": "nodemon src/server/server.js",
    "dev:client": "webpack-dev-server --hot",
    "dev": "npm-run-all --parallel dev:*"
  }

Any tips ?

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.