Deploy reactjs by electron for creating desktop app - reactjs

I know my question is obvious but I want to find best practice for that. How can we deploy a reactjs project by electron in lowest size of package? Can we deploy the built reactjs project by electron? I use create-react-app and I don't want to eject that.

Related

Trying to make build of Electron using "electron-build", but not generating

I'm trying to make build of my electron app using electron-builder but it is building for development only not for production, can anyone guide me how to make a production build?

React Native PWA with react-native-view-pager

I'm developing a React Native application with Expo, after a few weeks of development I wanted to check my app on the browser by running: expo start --web
The Expo project is starting without any issues, however when I navigate to the local address where the app is being served I get a nasty error:
This is my first React Native app and I'm not sure if the react-native-pager-view simply cannot be run in the browser or I just need to add some webpack configuration for it to succeed.
Any help would be much appreciated.
React native is not meant to work as PWA.
PWA is just a web application that depends on chrome features to look and feel as mobile app. But they are not such smoothly experience as with a react-native or android/ios app.
If you are trying to test this on the web, be sure that you are following the steps in the official docs of react native. And check the example app from react-native-pager-view that works, you could start from there

How do I prepare a CRA app to deploy to heroku, do I still have to build as for a fullstack CRA app?

I have a simple create-react-app app that I want to deploy to heroku but I'm not sure about the right wat to deplay or what files exactly. Do I need to npm run build as in the case of a mern fullstack app? I repeat, this is only react, no server. Thank you.
Instead of using Heroku to deploy just the React part, no server, you can use other easier solutions like:
Netlify and Vercel.
What you need need to do that, is just have a GitHub/GitLab repository, register on the platform, choose your repository and wait :)
It will automatically build and serve your React application.
Another cool thing is: Any new commit will generate a new build, so your app will be always updated.

How to deploy create react app on my website?

So I have a website and I want to deploy some of my projects on my portfolio website like mywebsite.com/first-project.html
I already ran npm run build so I have a build version with the static files and I put it on my website but the react index.html isn't return anything the div id of root is empty.
I have seen tutorial of deploying them through surge and github pages. I don't want to do that, I want it on my own website. How can I achieve this?
Edit:- I forgot to mention the projects I created are through the npm create-react-app method and I have run the static build through serve -s build on my local computer. I just want to do the same on my website.
Edit2:- In the future if I am creating a react based website with the intention of hosting on my own domain, what kind of groundwork should I lay to make it easier? Any node packages or routing or set up? Also would you recommend create-react-app for this purpose if not what method would you recommend?

What does "ejecting CRNA app is not reversible" really mean?

I've read some docs that says that ejecting a Create React Native App (CRNA) is irreversible. Im not sure what this means exactly.
Will I not be able to build my apps again for App Store, Play Store? Is it just a 1-time feature?
Will I lose files/ code that prevents me from ejecting a second time?
I'm trying to dig a little deeper into this. If anybody could share links to relevant blogs or forums, that would be great.
Ejecting is irreversible in the sense that if you modify the ejected project, you cannot convert it back into a CRNA project (except by creating a new CRNA project and copy/pasting all your code)
You can build for the App Store/Play store from a CRNA or an ejected project. For CRNA you would usually use exp:build and for ejected apps you could build from XCode. If you're only ejecting to get a standalone app, don't do it! Check out Expo's building standalone apps.
If you're worried about ejecting and losing you're original CRNA project, I recommend duplicating it before ejecting.
There's no reason to eject more than once. If you've ejected you can continue working on the ejected project.

Resources