First, let’s me be clear that I’m not trying to sell my boilerplate or discredit the current boilerplates, the maintainers are doing pretty good jobs of maintaining them.
[According to the docs], there are 2 recommended ways for creating a new ReasonReact:
bsb -theme react
- reason-scrips (with CRA)
I don’t personally use any of them because I’m used to setting up my own webpack config. But I can list a few limitations
-
bsb -theme react
: not production ready, simplest webpack config that you can find. It promotes a workflow with no server, just open a local index.html and you’re good to go. This is actually a good thing because when you’re getting started and not familiar with webpack and all the crazy Javascript toolings. - reason-scripts: this is a fork of react-scripts from create-react-app. But it currently has bugs that swallow last line of the error message from Bucklescript [1] . There has been some works on making a new version of reason-scripts. Most of development efforts come into this package . What I disagree about reason-scripts is that it hides the complexity of
bsb
.
And now we come to my own boilerplate. It based on bsb -theme react
with a few touches for production ready bundle. I created it mainly because I repeat the same process when I need to make some quick demo (aka throwaways projects). Some folks on Discord discover it and request for react-hot-loader. I added it in this PR [2] but I feels it adds bloats to the boilerplate. I’m looking for feedbacks whether I should merge the PR or not and what you think about this subject?
[1]: If you’re in fixing bs-loader bug of swallowing the last line of bug, you should look here https://github.com/reasonml-community/bs-loader/blob/7512df81fb9ca83236143a131d6f64dcede77c5f/packages/bsb-js/index.js#L18-L21
[2]: https://github.com/thangngoc89/reason-react-boilerplate/pull/1