Git Product home page Git Product logo

react-bootstrap-webpack-starter's Introduction

React 16+ Bootstrap webpack 4 Babel 7 with Hot Reload STARTER

npm Build Status Coverage Status FOSSA Status

ReactJS + Bootstrap starter with hot reload

Full client and server side in ES6+-ES2015+ using only React 16.3 Context API for state management

Dev bundle connects context to redux devTools (yes you are not dreaming) to feel redux development experience in a pure Context API app. Contrary to a redux based app connecting to devTools is not automatic (you have to specify each pseudo-action you want to trace in devTools state).

Concept behind: this starter is an easy way to understand and ready to use ReactJS (ES6) + bootstrap + webpack starter with:

  • no hard core Webpack config so it is more commonly understandable (they are numerous amazing starters with incredible webpack configs β€” hard core configs aren't bad things at all! β€”. This one is just for easier understanding for people even discovering webpack)
  • with hot reload (ReactJS + webpack => hot reload = WINNER)
  • no flux (yes, to give you freedom to add then since you may want to use something else like observables?)
  • with JWT auth
  • ReactJS Components written with optimization tricks (stateless, pure render...).

preview

Looking for server side rendering? check this project with SSR added here

Detailed Content

Front:

Tool chain:

  • babel 7+
  • eslint
  • hot reload
  • loaders
    • js / jsx
    • css
    • json
    • images formats
    • svg and fonts formats

tests:

  • Jest
  • enzyme

Usage

Install

npm install

bundle dev mode

npm run dev

dev : hot reload mode

npm run start

bundle size analyze

npm run analyze

tests

npm run test

bundle production mode

npm run prod

mini node-express server

with server hot reload (and dev bundle):

npm run serve-dev

without hot reload (and prod bundle):

npm run serve-prod

Donate

Do you use & ❀️ react-bootstrap-webpack-starter but you don’t find a way to show some love? If yes, please consider donating to support this project. Otherwise, no worries, regardless of whether there is support or not, I will keep maintaining this project. Still, if you buy me a cup of coffee I would be more than happy though πŸ˜„

Support via PayPal

License

The MIT License (MIT)

Copyright (c) 2019 Erwan DATIN

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FOSSA Status

react-bootstrap-webpack-starter's People

Contributors

dependabot[bot] avatar fossabot avatar mackentoch avatar norgeous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-bootstrap-webpack-starter's Issues

loadable-components isn't working

After running "npm run prod", it produces just 1 app.js and 1 vendor.js. No different from primitive method without loadable-components. This means It's not working at all.

Build is failing.

Hi @MacKentoch I can take a look at code base and fix build issue and also try to add test cases to make coverage little higher. ;-)

Project not starting up

I have installed the npm and when I try to run I get the following error:

[email protected] serve-dev ~/react-bootstrap-webpack-starter
npm run dev && nodemon ./src/server/server.js

[email protected] predev ~/react-bootstrap-webpack-starter
npm run clean-docs

[email protected] clean-docs ~/react-bootstrap-webpack-starter
rimraf docs/*

[email protected] dev ~/react-bootstrap-webpack-starter
rimraf docs/public/assets && cross-env NODE_ENV=dev webpack --config webpack.dev.config.js

(node:25051) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead
Hash: fc243f1228399a2e497e
Version: webpack 4.16.1
Time: 8144ms
Built at: 07/17/2018 4:26:39 PM
Asset Size Chunks Chunk Names
0.fc243f1228399a2e497e.js.map 3.83 KiB 0 [emitted]
app.fc243f1228399a2e497e.js 117 KiB app [emitted] app
0.fc243f1228399a2e497e.js 10.6 KiB 0 [emitted]
1.fc243f1228399a2e497e.js 4.41 KiB 1 [emitted]
2.fc243f1228399a2e497e.js 4.69 KiB 2 [emitted]
3.fc243f1228399a2e497e.js 5.15 KiB 3 [emitted]
4.fc243f1228399a2e497e.js 4.99 KiB 4 [emitted]
app.fc243f1228399a2e497e.js.map 78.1 KiB app [emitted] app
vendors.fc243f1228399a2e497e.js.map 2.22 MiB vendors [emitted] vendors
vendors.fc243f1228399a2e497e.js 2.17 MiB vendors [emitted] vendors
1.fc243f1228399a2e497e.js.map 1.36 KiB 1 [emitted]
2.fc243f1228399a2e497e.js.map 1.5 KiB 2 [emitted]
3.fc243f1228399a2e497e.js.map 1.58 KiB 3 [emitted]
4.fc243f1228399a2e497e.js.map 2.69 KiB 4 [emitted]
../index.html 882 bytes [emitted]
modernizr-bundle.js 5.37 KiB [emitted]
precache-manifest.fcf700426a295d74d0af362a58754f1b.js 681 bytes [emitted]
sw.js 969 bytes [emitted]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {vendors} [built]
[./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 573 bytes {vendors} [built]
[./src/front/Root.js] 3.28 KiB {app} [built]
[./src/front/contexts/auth/providerComponent/index.js] 4.67 KiB {app} [built]
[./src/front/hoc/withMainLayout/index.js] 78 bytes {app} [built]
[./src/front/hoc/withMainLayout/withMainLayout.js] 5.33 KiB {app} [built]
[./src/front/index.js] 1.73 KiB {app} [built]
[./src/front/pages/about/index.js] 241 bytes {1} [built]
[./src/front/pages/home/index.js] 238 bytes {0} [built]
[./src/front/pages/login/Login.js] 12.7 KiB {app} [built]
[./src/front/pages/login/index.js] 289 bytes {app} [built]
[./src/front/routes/MainRoutes.js] 608 bytes {app} [built]
[./src/front/routes/routes.js] 746 bytes {app} [built]
[./src/front/services/auth/index.js] 8.99 KiB {app} [built]
[./src/front/style/injectGlobalStyles.js] 938 bytes {app} [built]
+ 520 hidden modules
Child html-webpack-plugin for "../index.html":
1 asset
[./node_modules/html-webpack-plugin/lib/loader.js!./src/front/statics/index.html] 923 bytes {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
+ 1 hidden module

[email protected] postdev ~/react-bootstrap-webpack-starter
react-snap

~/react-bootstrap-webpack-starter/node_modules/react-snap/run.js:9
...reactSnap
^^^

SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)

npm ERR! Linux 4.4.0-130-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.14.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postdev: react-snap
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postdev script 'react-snap'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-bootstrap-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-snap

Please help me with this error.

I also tried the following solution but it won't help:
babel/babel-loader#170

Possible authentication enhancement?

hey MacKentoch,

first of all thanks for putting together this great starter. i learned a lot about HOC and other more advanced stuff form your repo.

I am trying to enhance authentication a bit and maybe you could give me a little hint how you would approach this.

  1. I want to avoid that authenticated users can access certain routes like login. Instead they should be redirected to dashboard. But i can't access props from AuthProvider in Root.js. So i tried (in Root.js):
    <Route exact path="/login" render={() => auth.isAuthenticated() ? ( <Redirect to="/dashboard" /> ) : ( <LoadableLogin /> ) } />
    but this killed the RouterHistory withinLogin.js?

  2. Where would you introduce authorization - like differentiating routing between different user roles like user and admin - in this setup? I tried to do this also in Root.js but still i can't get access to the necessary userInfo there.

Am i missing something about how to access contextAPI props in Root.js?

Thanks for your time!
Greetings Kyii

code source

Hi thanks for your projects have been a great help, a question I previously saw that generated all the html code when I was given the source code of the page in the navegator, but now does not show it, there is a way to show the source code?

regards

package.json

git clone and then npm install and npm run start

ENOENT: no such file or directory, open '/Users/x/react-bootstrap-webpack-starter/package.json'

npm --version 6.13.4
node --version v12.16.1

error while run "npm run prod" command

I've done nothing with the code. just download as zip, extract, yarn install at "front" folder, then run "npm run prod" and the error occurred.
the postprod process seems to cause an error as follow:
Screen Shot 2563-04-22 at 16 10 30

Using node 14.0.0 (but also tried 12.16.2 and didn't work either)
yarn 1.22.4

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.