stylesuxx / generator-react-webpack-redux

React Webpack Generator including Redux support
Other
552 stars 85 forks source link

Client.js vs Index.js #56

Closed motleydev closed 7 years ago

motleydev commented 7 years ago

I'm not sure what the concept is behind having a client.js (as entry for dev and dist) and index.js (entry for base) in the webpack settings? Index.js uses a container and client uses components. Maybe you can shed light on how that's supposed to work? Thanks!

stylesuxx commented 7 years ago

This has been changed in the latest version of the template and is client.js instead of index.js the entry in base.js might be a fragment, since the entry if overwritten by either base dev, dist or test config from what I can see.

motleydev commented 7 years ago

but client.js doesn't use the default container then? Or am I missing something? client grabs component/App where as index grabs container/App

stylesuxx commented 7 years ago

Uh, OK, this could be a problem in this gen then, when both files are available. will look into this.

motleydev commented 7 years ago

seems to me that the issue comes from the base generator too as that's where client.js is created. Since it doesn't use Redux it doesn't point to a container. The index.js file which is added by THIS generator does point to a container correctly. But webpack sources client.js

aprowe commented 7 years ago

I'm having trouble getting the hot loader working with the index.js entry. I noticed the index.js file also doesn't have the AppContainer from react-hot-loader. Should it use the AppContainer like in client.js?

obsidianart commented 7 years ago

client.js points to ./components/App index.js points to './containers/App' Myabe I'm missing something but it feels like there's something wrong

obsidianart commented 7 years ago

My main problem currently is that client.js doesn't user the provider/store and the expected architecture is unclear

fabdrol commented 7 years ago

Anyone found a solution?

keithriver commented 7 years ago

@fabdrol Well, it seems a solution is to either change the entry point in ./conf/webpack/Dev ./conf/webpack/Dist ./conf/webpack/Test files to ./index.js, or... to ditch subgenerators altogether (not really a solution, just for my project they don't work anyway). In any case subgens seem to be bound to /containers/App.js which loads everything else, if you want to use them, you need to include that file in one way or another.

stylesuxx commented 7 years ago

Hey guys, I will update this as soon as I can find some spare time and some concentration. The whole base has been updated and there is quite a bit to adjust. Sorry for the delay.

stylesuxx commented 7 years ago

Alright, this is fixed in 1.1.0 - feel free to re-open if problem persists.