There's so much I like about React: new ECMAScript features, declarative program structure, patchy yet sufficient documentation. Okay, the only React-specific thing there is the declarative program structure - automatic view rendering based on the relation between state and props. You can use ESnext wherever you want to set up babel (becoming less and less necessary) and webpack, and lots of projects have good documentation. But my point is, I have drunk the React kool-aid. So far, I've only skimmed over the docs for Vue.js, and if that ends up taking over, I'm fine with that. It seems similar enough to React at first glance.
Recently I used a new project I'm developing as an opportunity to try out the new create-react-app utility, which I was skeptical about, but had incorrectly thought that's now the recommended way to work with React applications, so I will just go with the flow. I was annoyed that the commands to start, test, and build my application were all delegated to a react-scripts tool that didn't provide any help, info, or flexibility. I also led myself into a roadblock when trying to develop my React app within Django: Where is bundle.js on the filesystem?
Fortunately, you can
from the create-react-app way, which removes the
react-scripts dependency from your package.json and adds
all the dependencies and configuration files that
react-scripts uses to your project, so you can make
changes more directly. I was really satisfied with this
and was able to start developing in React/Django quickly
after copying the
prod webpack config
making some small changes to remove prod references and
filename hashes, and making an
npm run dev command:
"dev": "webpack -d --watch --config config/webpack.config.dev.js",
So now, the workflow I used once for Mediathread becomes more standard as I try it on a new project:
cd djangoapp rm media/djangoapp/bundle.js ln -s ~/public_html/reactapp/build/bundle.js media/djangoapp/bundle.js make runserver
I would invite you to comment below, but my disqus code was injecting malware. I just removed it instead of bothering to fix it. My email's on the main page here.