anorudes / redux-easy-boilerplate

React redux easy boilerplate
MIT License
633 stars 123 forks source link

Changed binds to use ES6 arrow function #27

Closed oltsa closed 8 years ago

oltsa commented 8 years ago

Moved binding from constructor to the function itself using ES6 arrow functions, with babel it will also handle the unbinding

anorudes commented 8 years ago

This (es6 arrow function in Class) is an experimental feature and maybe will not work in future.

anorudes commented 8 years ago

https://stackoverflow.com/questions/31362292/can-i-use-es6-fat-arrow-in-class-methods But today maybe all changed )

oltsa commented 8 years ago

stage-0 preset is in use

I'm currently updating the babel 6 confs and adding lifecycle detection (and seperating the react-transform hot reloader from webpack conf to .babelrc). in .babelrc you could bring in those features as individual dependencies to ensure you have access to the in future

2016-01-05 11:52 GMT+02:00 anorudes notifications@github.com:

This (es6 arrow function in Class) is an experimental feature and maybe will not work in future. Also "render" will create new function everytime.

— Reply to this email directly or view it on GitHub https://github.com/anorudes/redux-easy-boilerplate/pull/27#issuecomment-168953126 .

anorudes commented 8 years ago

I just saw this comment 4 month ago :)

I wouldn't recommend using the arrow syntax. That is a feature that may never come to javascript. It is a stage 0 proposal right now, meaning it will probably not be in ES 2016 and probably change dramatically before it becomes valid JS syntax.
oltsa commented 8 years ago

I read as a rule of thumb "never touch the 0-stage preset", but a lot of people are using the arrow functions specially now that react went with the es class stuff :) but i get your reasoning.

I'm still going to update the react-transform-hmr and .babelrc - right now it loads the hot loaders into the production as well, so I'm going to split the webpack into 3 files common, dev and prod which

.babelrc will have all the stuff needed for transforms (dropping out babel-hot-loader from webpack and have babel import it) :) or atleast that's the plan :)

2016-01-05 11:59 GMT+02:00 anorudes notifications@github.com:

I just saw this comment 4 month ago :)

I wouldn't recommend using the arrow syntax. That is a feature that may never come to javascript. It is a stage 0 proposal right now, meaning it will probably not be in ES 2016 and probably change dramatically before it becomes valid JS syntax. ``

— Reply to this email directly or view it on GitHub https://github.com/anorudes/redux-easy-boilerplate/pull/27#issuecomment-168957236 .

anorudes commented 8 years ago

I don't know how to make better) In last project i used "bind in counstructor" syntax, but "() =>" in Class is awesome, you are right. This boilerplate very small and we can change "bind to constructor" to "arrow function in class". Big thanks for helping project. Today the boilerplate not have server-side rendering. this is very bad =( I tried to add https://github.com/bdefore/universal-redux but got many errors

oltsa commented 8 years ago

I pretty much use this boilerplate as a start off point :) so thank you for making it.

I will look into initial rendering with server-side, already have some test stuff going.

Also the picture files you are using in this boilerplate are huge, could maybe compress them a little bit :)

2016-01-05 12:13 GMT+02:00 anorudes notifications@github.com:

I don't know how to make better) In last project i used "bind in counstructor" syntax, but "() =>" in Class is awesome, you are right. This boilerplate very small and we can change "change bind to constructor" to "arrow function in class". Big thanks for helping project. Today the boilerplate not have server-side rendering. this is very bad =( I tried to add (redux-universal) but got many errors

— Reply to this email directly or view it on GitHub https://github.com/anorudes/redux-easy-boilerplate/pull/27#issuecomment-168963352 .

anorudes commented 8 years ago

Thanks, i will wait =)