Closed joshreisner closed 5 years ago
This is what I've used in the past for tutorials, it does save a lot of time from mucking about with tool chains.
Well so the problem with this is that it doesn't create a single, predictable js file that people can reference. https://facebook.github.io/create-react-app/docs/production-build
In our README
we instruct users to load our .js file with <script src="https://react.meetingguide.org/app.js" async></script>
@FlipperPA or @mathteacher any ideas on how to make this work, or restructure it so that it's still easy for users to access? are iframe
s a dealbreaker?
My feelings are: a) The ability to run the meeting finder by simply loading a single .js file is really attractive and I think should be preserved if at all possible. b) From my experience doing the React Tutorial (tic-tac-toe), it seems the only improvement that create-react-app has over using Laravel Mix is that it provides the local web server (correct me if I'm wrong though, I could be missing other benefits). I have just been leaving Mamp running in the background (instead of Laravel Valet) and there's thus seemingly been no difference for me from create-react-app, so I would say that if create-react-app can't provide the single app.js file then definitely just stick with Laravel Mix. c) Without honestly having a ton of experience to back up this, I feel we should definitely avoid using an iframe if we can.
@mathteacher yeah i agree, let's just stick with mix for now.
create-react-app has auto-reload, which i think is also something mix can do. other than that, the main benefits (cache-busting, chunking) are working against us.
I had forgotten about the auto-reload feature, which definitely would be useful. I looked it up and it is easy enough to enable that feature in Laravel Mix as well (https://laravel.com/docs/5.8/mix#browsersync-reloading).
It was just a matter of adding the following line to the webpack.config.js file:
mix.browserSync('localhost:8888');
I agree that avoiding iframes at all costs would be good, especially if we want to keep this as mobile friendly as possible. Sounds like Laravel has enough pros that it is worth sticking with. I'm still learning on the fly as well, so conversations like this are very useful!
It's a better fit for the technology that we're using https://facebook.github.io/create-react-app/