Create-React-App
See original GitHub issueDoes anyone know how to get this working with Create-React-App ? Iβve been struggling all day and I am still nowhere forward π¦
It works if I build the CRA
itself BUT I have to keep doing this every time I change something. Create-REact-App comes with itβs own Dev server that hot reloads and I wanted to be able to plug into it but when I do a console.log(eel)
it always prints undefined.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Create React App
Create React App Β· Less to Learn. You don't need to learn and configure many build tools. Instant reloads help you focus on...
Read more >Create a New React App
Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in...
Read more >facebook/create-react-app - GitHub
Set up a modern web app by running one command. Contribute to facebook/create-react-app development by creating an account on GitHub.
Read more >create-react-app - npm
Create React apps with no build configuration. ... Start using create-react-app in your project by running `npm i create-react-app`.
Read more >How To Set Up a React Project with Create React App
Step 1 β Creating a New Project with Create React App. In this step, you'll create a new application using the npm package...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I played around with this for just a few minutes. I did it using VueJS instead, but the concept should be the same. It is not yet an elegant solution, but it works without making any modifications to Eel.
Files
Here is my file structure.
Here is
start.sh
:And, here is
app.py
Plan
As you can see, the idea is simple: start both the eel webserver, and whatever other webserver you want. Then, tell the eel browser to open your other webbrowser instead of a static file.
Pitfalls
I hacked this together in just a few minutes as a proof of concept. Clearly we can improve upon this, and looks like something that we could and should be able to bake into eel itself.
As you can see, I needed to throw a
sleep
in there just to make sure the webpack server was up and running first. This needs to be fixed.Maybe also there is a better solution to using
Threading
This may not be the best solution, but it does work. I was able to startup the servers, and make changes to my Vue app and have it live reload inside of the eel browser.
Kudos to @ChrisKnott for an awesomely simple and elegant implementation.
You would need to stash a local copy of the
eel
repo, and make the change. I have not committed it.git clone https://github.com/ahopkins/Eel.git
Then, install that.
pip install -e /path/to/Eel
Go into
Eel/eel/__init__.py
and add.tsx
intoallowed_extensions
as shown above. That will get it working for now until there is a solution. Your alternative would be to define all of your eel methods in a file with a.js
extension.