Giter VIP home page Giter VIP logo

mackentoch / react-redux-bootstrap-webpack-starter Goto Github PK

View Code? Open in Web Editor NEW
141.0 11.0 47.0 21.17 MB

React 16.14 + Typescript + React-Router 5 + Redux + Bootstrap 4 + Hot Reload + redux-devtools-extension + Webpack 5 + styled-components STARTER

JavaScript 3.43% HTML 83.53% TypeScript 12.24% CSS 0.80%
redux-devtools reactjs router bootstrap webpack redux react-hot-reload enzyme react-router-v4 webpack4

react-redux-bootstrap-webpack-starter's Introduction

React 16.14 (Typescript) React-Router 5 + Redux + Bootstrap + Webpack 5 with Hot Reload and redux-devtools-extension STARTER

license Build Status Coverage Status

My best React + redux project starter.

  • webpack is as simple as possible
  • ReactJS is written with optimization tricks (stateless, hooks, pure render, PureComponent...).
  • pure front-end = server independant (use whatever you want as server: NodeJS, Rails, .NET...)
  • SPA but SEO and/or PWA friendly since use of dynamic imports and application snapshot.

Concept behind: same as react-bootstrap-webpack-starter but added Redux and amazing and helpful redux-devtools-extension.

preview FOSSA Status

Detailed Content

Front:

  • Typescript
  • React JS (16.14 - github πŸ”—)
    • NOTE: React 17+ is not really developer friendly "yet" considering react-refresh (= hot reload replacement: RIP my friend) to be not fully stable
  • Redux (as you application grows managing state will be a serious concern, save pain with Redux)
  • React-Redux (Redux is not specific to ReactJS, you could easily use it with Angular2 for instance)
  • redux-devtools-extension (github πŸ”—)
  • react-router (4.x- github πŸ”—)
  • Bootstrap (4.x - github πŸ”—)
  • reactstrap (github πŸ”—)
  • loadable-components - work with reactsnap for better static website performance - (stuck to pre v2.2.3+ breakings changes, waiting for a new solution see PR)
  • font-awesome (github πŸ”—)
  • animate.css (github πŸ”—)
  • classnames (github πŸ”—)
  • react-motion (github πŸ”—)
  • Webpack 4.x (github πŸ”—)
  • axios (github πŸ”— Why: simple, complete, isomorphic ...)

Tool chain:

  • Typescript
  • eslint
  • webpack 5
  • hot reload
  • loaders
    • ts / tsx
    • css
    • json
    • images formats
    • svg and fonts formats

tests:

  • Jest
  • @testing-library/react

Changelog

Here

Usage

You can run development React SPA application with hot reload or run the production bundles served through NodeJS server.

NOTE: You don't need to worry about installing anything, just sit down keep cool and type any of these needed command.

Front developement (with hot reload)

# from root directory:
npm run front-dev

Application will be served at http://localhost:3001/ (just click me!)

Front unit tests

# from root directory:
npm run front-test

Front production bundle analyze

# from root directory:
npm run front-bundle-analyze

Bundle analyzer will launch on its own in your default browser

Serve production bundled application (front and NodeJS server)

# from root directory:
npm run start

Application will be served at http://localhost:8082/ (just click me!)

License

The MIT License (MIT)

Copyright (c) 2022 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-redux-bootstrap-webpack-starter's People

Contributors

dependabot[bot] avatar fossabot avatar mackentoch avatar roytruelove 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  avatar

react-redux-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 chucks presented. and the overall bundle size is huge ~700kb which freak me out.

couldn't require image

tried to include an image in the page by
<img src={require('../../../../preview/preview.png')}/>
but it doesn't work in "npm run serve-dev mode" and "npm run serve-prod mode".
The output path is wrong.

npm run dev has erros

D:\developtool\nodework\react-redux-bootstrap-webpack-starter-master>npm run dev

[email protected] dev D:\developtool\nodework\react-redux-bootstrap-webpack-starter-master
NODE_ENV=dev webpack

'NODE_ENV' δΈζ˜―ε†…ιƒ¨ζˆ–ε€–ιƒ¨ε‘½δ»€οΌŒδΉŸδΈζ˜―ε―θΏθ‘Œηš„η¨‹εΊ
ζˆ–ζ‰Ήε€„η†ζ–‡δ»Άγ€‚

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "D:\developtool\tools\nodejs\node.exe" "D:\developtool\tools\nodejs\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: NODE_ENV=dev webpack
npm ERR! Exit status 1

I has do
setx NODE_ENV=dev
or set NODE_ENV=dev

16.0

When updated to react 16?

Error on production when using aws-sdk

First of all, thank you very much for sharing this boilerplate. It's great

I just confirmed by cloning a fresh copy of this repo and only installing aws-sdk that npm run serve-prod will throw an error: TypeError: Cannot set property 'createCredentials' of undefined

I've been able to track it down to the crypo package ([email protected]) that aws-sdk uses as a dependency, but I haven't been able to solve it just yet.

I'm creating this issue so that other people know about this block and how to solve it (when solved...)

Add proxy

Hi,

I'm using your project. But I'm having some difficulties in adding the proxy in hot reload mode.

Already added:
devServer: { proxy: { "hot": true, "/api": { target: "http://localhost:8000/api" } } }
Can you help me?

Hot reload not working

Hi

I'm facing an issue. Hot reload is not working. not sure whats the issue.

Clone the project. yarn install then run 'yarn run start' .

I changed Home.js but nothing is reflected. webpack is restarted, however the changes are not reflected in the browser. Even i refresh nothing happens.

operating system - Ubuntu

Any clue ...

Thanks
Sesh

PageNotFound file name case inconsistent

npm run dev fails with:

ERROR in ./src/app/views/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./pageNotFound/PageNotFound in /home/roy/src/react-redux-bootstrap-webpack-starter/src/app/views
 @ ./src/app/views/index.js 20:20-58

Will have a PR in a minute

CSS Modules Enabled

Firstly, wanted to say thanks for the hard work you put in making this repo. It's exactly what I was looking for and got tired of finding starter templates that we're either way bloated or too simple. Also really nice to see the redux implementation as well. Great work!

This isn't really an issue it's a feature enhancement and maybe I'm just trying to incorporate it incorrectly but I'd like to have css-modules enabled. I've gone into the webpack.dev.config.js and added
modules: true
inside of the css and scss loaders, like so

      {
        test: /\.css$/,
        use:  SPLIT_STYLE 
          ? ExtractTextPlugin.extract({
            fallback: 'style-loader',
            use: [
              {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
              'postcss-loader'
            ]
          })
          : [
            'style-loader',
            {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
            'postcss-loader'
          ]
      },
      {
        test: /\.scss$/,
        use:  SPLIT_STYLE 
        ? ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: [
            {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
            'postcss-loader',
            'sass-loader'
          ]
        })
        : [
          'style-loader',
          {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
          'postcss-loader',
          'sass-loader'
        ]
      },

Then I run npm start in terminal and it's not picking up an imported style, for instance
import { base } from './home.scss'; but when console.log it's giving undefined.

I then thought to go into the webpack.hot.reload.config.js file and add modules: true like so

      {
        test: /\.css$/,
        use:  [
          'style-loader',
          {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
          'postcss-loader'
        ]
      },
      {
        test:  /\.scss$/,
        use:  [
          'style-loader',
          {loader: 'css-loader', options: { importLoaders: 1, modules: true, localIdentName: '[hash:base64:5]' }},
          'postcss-loader',
          'sass-loader'
        ]
      },

I go into console and log base and it's giving me what I'm looking for but the page is rendering pretty off.
screen shot 2017-06-08 at 10 09 47 am

Could not start app

Not sure what is the issue

$ yarn run dev
yarn run v1.16.0
$ npm run clean-docs

[email protected] clean-docs C:\Users\C64491\ExperimentProjects\react-redux-bootstrap-webpack-starter
rimraf docs/*

$ cross-env NODE_ENV=dev webpack --config webpack.dev.config.js
(node:16788) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead
Hash: 6a50b9a42b4a266bf8a2
Version: webpack 4.35.3
Time: 7782ms
Built at: 07/18/2019 10:22:54 AM
Asset Size Chunks Chunk Names
0.6a50b9a42b4a266bf8a2.js 12.3 KiB 0 [emitted]
0.6a50b9a42b4a266bf8a2.js.map 6.03 KiB 0 [emitted]
1.6a50b9a42b4a266bf8a2.js 6.61 KiB 1 [emitted]
1.6a50b9a42b4a266bf8a2.js.map 3.76 KiB 1 [emitted]
2.6a50b9a42b4a266bf8a2.js 17 KiB 2 [emitted]
2.6a50b9a42b4a266bf8a2.js.map 12.7 KiB 2 [emitted]
3.6a50b9a42b4a266bf8a2.js 6.71 KiB 3 [emitted]
3.6a50b9a42b4a266bf8a2.js.map 3.29 KiB 3 [emitted]
4.6a50b9a42b4a266bf8a2.js 6.27 KiB 4 [emitted]
4.6a50b9a42b4a266bf8a2.js.map 3.17 KiB 4 [emitted]
app.6a50b9a42b4a266bf8a2.js 113 KiB app [emitted] app
app.6a50b9a42b4a266bf8a2.js.map 96.4 KiB app [emitted] app
index.html 879 bytes [emitted]
modernizr-bundle.js 5.48 KiB [emitted]
precache-manifest.8e023edf17ea87325457270b9f314e7d.js 624 bytes [emitted]
sw.js 963 bytes [emitted]
vendors.6a50b9a42b4a266bf8a2.js 2.72 MiB vendors [emitted] vendors
vendors.6a50b9a42b4a266bf8a2.js.map 2.81 MiB vendors [emitted] vendors
Entrypoint app = vendors.6a50b9a42b4a266bf8a2.js vendors.6a50b9a42b4a266bf8a2.js.map app.6a50b9a42b4a266bf8a2.js app.6a50b9a42b4a266bf8a2.js.map
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {vendors} [built]
[./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 573 bytes {vendors} [built]
[./src/front/Root.tsx] 3.39 KiB {app} [built] [2 errors]
[./src/front/config/appConfig.js] 259 bytes {app} [built]
[./src/front/index.js] 1.66 KiB {app} [built]
[./src/front/layout/MainLayout/MainLayout.js] 2.03 KiB {app} [built]
[./src/front/layout/MainLayout/index.js] 65 bytes {app} [built]
[./src/front/mock/userInfosMock.json] 491 bytes {app} [built]
[./src/front/pages/about/index.js] 463 bytes {1} [built]
[./src/front/pages/home/index.js] 460 bytes {0} [built]
[./src/front/redux/modules/userAuth/index.js] 11.4 KiB {app} [built]
[./src/front/redux/store/configureStore.ts] 329 bytes {app} [built]
[./src/front/routes/MainRoutes.js] 855 bytes {app} [built]
[./src/front/routes/routes.js] 826 bytes {app} [built]
[./src/front/style/GlobalStyles.ts] 1.05 KiB {app} [built]
+ 710 hidden modules

ERROR in C:\Users\C64491\ExperimentProjects\react-redux-bootstrap-webpack-starter\src\front\Root.tsx
./src/front/Root.tsx
[tsl] ERROR in C:\Users\C64491\ExperimentProjects\react-redux-bootstrap-webpack-starter\src\front\Root.tsx(7,8)
TS7034: Variable 'configureStore' implicitly has type 'any' in some locations where its type cannot be determined.

ERROR in C:\Users\C64491\ExperimentProjects\react-redux-bootstrap-webpack-starter\src\front\Root.tsx
./src/front/Root.tsx
[tsl] ERROR in C:\Users\C64491\ExperimentProjects\react-redux-bootstrap-webpack-starter\src\front\Root.tsx(8,10)
TS2305: Module '"../../../../../../Users/C64491/ExperimentProjects/react-redux-bootstrap-webpack-starter/src/front/redux/store/configureStore"' has no exported member 'history'.
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/front/index.html] 950 bytes {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
+ 1 hidden module
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

npm install error

206160 verbose stack Error: [email protected] install: node install.js
206160 verbose stack Exit status 1
206160 verbose stack at EventEmitter. (D:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:245:16)
206160 verbose stack at emitTwo (events.js:106:13)
206160 verbose stack at EventEmitter.emit (events.js:191:7)
206160 verbose stack at ChildProcess. (D:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
206160 verbose stack at emitTwo (events.js:106:13)
206160 verbose stack at ChildProcess.emit (events.js:191:7)
206160 verbose stack at maybeClose (internal/child_process.js:850:16)
206160 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
206161 verbose pkgid [email protected]
206162 verbose cwd D:\nodejsworkspace\reactspace\react-redux-bootstrap-webpack-starter
206163 error Windows_NT 6.1.7601
206164 error argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
206165 error node v6.2.0
206166 error npm v3.8.9
206167 error code ELIFECYCLE
206168 error [email protected] install: node install.js
206168 error Exit status 1
206169 error Failed at the [email protected] install script 'node install.js'.
206169 error Make sure you have the latest version of node.js and npm installed.
206169 error If you do, this is most likely a problem with the puppeteer package,
206169 error not with npm itself.
206169 error Tell the author that this fails on your system:
206169 error node install.js
206169 error You can get information on how to open an issue for this project with:
206169 error npm bugs puppeteer
206169 error Or if that isn't available, you can get their info via:
206169 error npm owner ls puppeteer
206169 error There is likely additional logging output above.
206170 verbose exit [ 1, true ]

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.