react-starter icon indicating copy to clipboard operation
react-starter copied to clipboard

Confused on what is happening on your configs

Open joeyhipolito opened this issue 10 years ago • 5 comments

Some are straight forward, but some are not, especially on production, I don't know where is the index file.. I have to resort to reading source code for learning, waaah, I hope the react-starter will improve.

Was there anyway, that you don't have to build then deploy? I can see that you have to run a command, followed by another?

Also, if I weren't using express-node for launching server, wouldn't it be good, if on production, there's a dist file, were index.html lives there, along with its resources?

joeyhipolito avatar Jan 20 '15 18:01 joeyhipolito

I'm in agreement. I'm more in favor of removing the dynamic features from these configs. There should be one default config and each derivation directly overrides the configuration options.

It just takes forever to read and understand what's going on.

maletor avatar Mar 05 '15 18:03 maletor

Does this HowStuffWorks.md file help? https://github.com/webpack/react-starter/pull/51

I agree the config files are a beast. But i also consider this the ultimate webpack example, by the webpack author actually. I'd rather learn from it than have it "dumbed down". There are plenty of simple webpack examples.

barrystaes avatar Apr 15 '15 10:04 barrystaes

:+1: Code duplication in config files is absolutely normal. Much more better than imperative instructions. Configs are meant to be compared with diff tools to inspect the difference. Here we have basically 3 presets: prod, dev and prerender squashed in one imperative obscure chunk of code. Funny thing, when I replaced all imperative statements with declarative "duplication" the overall size didn't extended too much, but transparency raised in a factor of 10. There is definitely much to learn but I bet everyone here started to learn by refactoring :laughing:

ivan-kleshnin avatar Apr 17 '15 08:04 ivan-kleshnin

@ivan-kleshnin Care to share your refactor?

pikeas avatar Jun 12 '15 20:06 pikeas

@pikeas sure, here is raw a version https://github.com/Paqmind/starter. Just correct retranslation of imperative syntax to declarative.

A newer variation of it is used here https://github.com/Paqmind/react-ultimate It do not have isomorphic rendering working and some other things are disabled because of 3-rd party limitations and bugs but it should be good as a starting point anyway.

ivan-kleshnin avatar Jun 13 '15 07:06 ivan-kleshnin