Code Monkey home page Code Monkey logo

frontend-boilerplate's Introduction

__I don't use this anymore, it's unsupported, I'd recommend https://parceljs.org/

Frontend Boilerplate

A boilerplate of things that mostly shouldn't exist.

Contains

Setup

$ npm install

Running

$ npm start

Build

$ npm run build

Note

My personal projects have diverged from this quite a bit, I use browserify now instead etc, but feel free to use this if it fits your needs! I won't be updating it a ton for now unless I have time to update it to match my current workflow.

License

MIT

frontend-boilerplate's People

Contributors

alanrsoares avatar conorhastings avatar cridenour avatar epilande avatar gwokae avatar hew avatar iduuck avatar jamiebuilds avatar jwinn avatar jychao avatar lenaten avatar madyankin avatar restuta avatar roth1002 avatar sorrycc avatar superraytin avatar tj avatar tonyspiro avatar yurovant avatar zirho 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  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

frontend-boilerplate's Issues

Better example

Remove the todojs stuff or port the css properly, no need for Object.assign() etc.

An error about classnames

// client/components/TodoItem/index.js
const classes = classnames({
      [style.completed]: todo.completed,
      [style.normal]: !this.state.editing,
      [style.editing]: this.state.editing
 })
// style.editing will be 'editing___[hash:base64:5] normol___[hash:base64:5]'

If you encounter the same mistake, you may try the following way:

// client/components/TodoItem/index.js
const classBind = classnames.bind(style)
const classes = classBind({
  completed: todo.completed,
  normal: !this.state.editing,
  editing: this.state.editing
})
// now editing will be 'editing___[hash:base64:5]'

I don't know how this error is triggered, but it looks like the postcss error

npm build doesn't work

It seems that npm build doesn't work. Maybe is better to have a different config file for production like: webpack.production.config.js and split css modules and jsx/js modules into 2 different files so it's even possible to avoid the orrible glitch while loading component before style is fully loaded.

Async Actions

How about add async actions. Is there any boilerplate?

Better example

  • More than a single route to show more containers
  • More than one type of "model" so there's multiple types of action creators etc
  • Auth0/Oauth would be cool in the example for middleware
  • Other middleware / redux-effects
  • Show more connect() usage, when you'd filter down the state etc

Insert favicon

I can't figure out how to insert favicons into index.html. 😕

Linting with Webpack

Ability to check file structure with JavaScript and CSS linters would be useful for many.

Linting in Webpack –guide has details on how to setup those to Webpack –based project.

  • ESLint with Webpack.
  • JSCS with jscs-loader for Webpack support.
  • stylelint allows to lint CSS and can be used with Webpack through postcss-loader.

Also:

  • EditorConfig allows you to maintain a consistent coding style across different IDEs and editors.

Getting errors when making a change in any file

I've tried using node 0.* , 4., 5. and i still get the error.

I'm just adding a simple code change like a console.log anywhere in the code and when i save the edited file i'm getting this notification https://i.imgur.com/7QuncHe.png and also this in the console https://i.imgur.com/xbuP0qL.png

So when i try to add a todo i cannot, redux doesn't work anymore and i need to full page refresh.

I'm using Chrome Canary but it's the same behaviour in regular chrome. What's going on?

Functions as constants

I'd be curious what you think about this. I've been overriding Function.prototype.toString so that I don't need to create a separate set of constants, which somewhat significantly reduces the headache of creating new actions. I have made a small utility for doing it:

create-action

Throws without devTools extension installed

Without redux-devtools-extension, window.devToolsExtension will be undefined, which causes compose() to throw an error:

Uncaught TypeError: Cannot read property 'apply' of undefined   compose.js:33
  v @ compose.js:33
  createStore @ createStore.js:65
  configure @ index.js?bdd4:14
  (anonymous function) @ index.js?2645:11
  (anonymous function) @ bundle.js:136

This issue is introduced by this pr 07e6658 , reverting to 98101d5 fixes it.

FYI, compose() src:
https://github.com/reactjs/redux/blob/master/src/compose.js#L21

Browserify

I know this repo represents your personal preferences, but I'm curious on why the choice of webpack over browserify.

  • browserify can do hot module replacement via browserify-hmr and it's pretty easy. no need for an external dev server like webpack-dev-server.
  • postcss is supported via browserify-postcss, but why bother adding your css into your js files when they can be compiled as .css files?
  • vendor.bundle.js can be done via factor-bundle
  • babel is supported via babelify

using browserify would probably reduce 60 lines of webpack.config.js into just ~10 lines inside package.json, and is much simpler to boot.

Redux dev tool not showing?

When running npm start and dev server launches, the redux dev tool window isn't really showing. Is it just me?

btw really good repo with clear architecture, good job!

Tests

Any plans to include tests?

npm start dosen't work

I cloned this repository,and I followed your Readme.md's step,but when I type command"npm start",it doesn't work

Editorconfig?

I propose to add .edittorconfig to this boilerplate. @tj what do you think?

Tweak `localIdentName` for much simpler classes

In the webpack.config.js you are using the localIdentName like following:

localIdentName=[name]__[local]___[hash:base64:5]

which is resulting in css classes like: style__teaser___2snRC. But since your concept looks like you are using an index.js and and style.css for each component and container you are writing, this would be redundant and it would make much more sense to just use the following to achieve a simpler class name like teaser___2snRC:

localIdentName=[local]___[hash:base64:5]

:shipit: Pull request #84

Hot reloading reducers not supported?

Hi,
I'm changing todos 'add todo' reducer to set completed to true on creation and I get:

[HMR] Cannot apply update. Need to do a full reload!
dev-server.js:19 [HMR] Error: Expected the reducer to be a function. Instead got an object with a "default" field. Did you pass a module instead of the default export? Try passing require(...).default instead.

Tested on unmodified Todo app,
Any ideas?

<noscript data-reactid=".0"></noscript>

I am trying to create a production build but after I run 'npm run build' and open the static dir on localhost in my browser. I see a blank index page with these elements.

<div id="root"><noscript data-reactid=".0"></noscript></div>

What am I doing wrong?

Webpack 2.x?

I guess this has changed as well, no clue what's new, hopefully less confusing than 1.x.

Update redux-simple-router

I think it's outdated already :(, not seeing syncReduxAndRouter in the docs, need to update react-router too I think..

Background image issues

I found multiple threads about this topic, but nothing really solved my problem:
I have used the frontend-boilerplate for a new project I am working on and I am stuck with simple background-image's in my CSS files. I use the loader that was shipped with the boilerplate, but the background-image is not applied to the element, because of the blobs webpack is writing to the DOM.

How to fix this?

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.