Open szk2s opened 4 years ago
There is a lot of react-apps which is generated by create-react-app. For prototyping purpose, or faster development, it could be better to make single react-app with react-router which contains many prototypes as its components. I think it's more important to focus on the prototyping than to set up react app or maintain the mono-repo structure.
I don't think making every prototype a React app is a good idea because I don't think it's that important for prototype ideas to be an SPA. Sometimes an idea can be done with pure html/css and it's much much faster to add. In most cases, you don't even need React. Please remember that we should always try to keep things as minimal as possible.
The cause of the issue above is purely because of the CRAs scripts which is probably not designed for a monorepo use.
To avoid those dependency collisions, we could hoist the CRA to the root dependency, but I don't think we should do that for the following reasons:
For those reasons, what we should do is to always eject CRA apps.
Totally agree.
If the always eject CRA apps
solution works fine, there will be no problem for the time being.
I just thought it is better to separate react components and non-react prototypes like below.
Or, there should be no need to limit the pages to one index.html
.
<body>
<h1>Prototypes</h1>
<ul>
<li>
<a href="./packages/hello-world/build/index.html">An Example Without React</a>
</li>
<li>
<a href="./packages/easing/dist/index.html">Another Example Without React</a>
</li>
</ul>
<div id="react-container"></div>
</body>
// index.js
ReactDOM.render(<App />, document.getElementById('react-container'));
Cannot run build/start/test scripts
Expected Behavior
Runs build/start/test scripts of react-scripts
Current Behavior
Possible Solution
react-scripts
as deps in root package.jsonSteps to Reproduce
git checkout react-shader
yarn cache clean && yarn
yarn build