Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live/Hot reload for Neutralino applications #288

Closed
saaymeen opened this issue Jun 3, 2020 · 14 comments
Closed

Live/Hot reload for Neutralino applications #288

saaymeen opened this issue Jun 3, 2020 · 14 comments
Labels
enhancement New feature or request feature-request

Comments

@saaymeen
Copy link

saaymeen commented Jun 3, 2020

Hi, just discovered Neutralino. Is it possible to develop a React app with neutralino using the benefits of hot module replacement or live reload? It's a bit cumbersome to rebuild the whole app everytime I change a div or test some styles. Please excuse me if I oversee anything from the docs.
Cheers!

@shalithasuranga
Copy link
Member

Thanks for reporting the issue. This feature request is already there in CLI neutralinojs/neutralinojs-cli#7

This will be added soon

@saaymeen
Copy link
Author

saaymeen commented Jun 9, 2020

Perfect, thanks for the response on this one! Maybe it's a good idea to allow the Github discussions for this repository so that the issues don't get polluted with such kind of questions.

@EriKWDev
Copy link

Currently I use nodemon with the command nodemon -x "neu build && neu run" -w src/*
This will listen to changes in the src directory and execute build and run.

It's rather slow compared to something like Flutter's Hot Reload or even Webpack since it rebuilds everytime, but it works and at least I dont't have to manually type the commands... xP

@raffaelj
Copy link

I use a simple workaround to refresh the window. It works in browser and window mode. For simplicity I just used Mousetrap, but you could add your own event listeners.

Download mousetrap.min.js and add it with a key binding to index.html with

<script src="/assets/lib/mousetrap.min.js"></script>
<script>
// bind F5 key to page reload
Mousetrap.bind('f5', function() {window.location.reload();});
</script>

You can also run the refresh in a loop or/and bind an onclick event to a button.

@shalithasuranga
Copy link
Member

Hey @raffaelj Nice idea.. I will try to add neu listen asap

@shalithasuranga
Copy link
Member

Hey.. I closed this since neu listen was released.

@jwhijazi
Copy link

neu listen is no longer available in version 4. What are the alternatives?

@shalithasuranga
Copy link
Member

Hey.. @jwhijazi you can use neu run --frontend-lib-dev and read more details from here: https://neutralino.js.org/docs/how-to/use-a-frontend-library

@jwhijazi
Copy link

Hey.. @jwhijazi you can use neu run --frontend-lib-dev and read more details from here: https://neutralino.js.org/docs/how-to/use-a-frontend-library

Thanks for the info.
I don't know if I can ask another question in this issue, but I'm asking for an API to get PC network information such as IP address and MAC address.

2 similar comments
@jwhijazi
Copy link

Hey.. @jwhijazi you can use neu run --frontend-lib-dev and read more details from here: https://neutralino.js.org/docs/how-to/use-a-frontend-library

Thanks for the info.
I don't know if I can ask another question in this issue, but I'm asking for an API to get PC network information such as IP address and MAC address.

@jwhijazi
Copy link

Hey.. @jwhijazi you can use neu run --frontend-lib-dev and read more details from here: https://neutralino.js.org/docs/how-to/use-a-frontend-library

Thanks for the info.
I don't know if I can ask another question in this issue, but I'm asking for an API to get PC network information such as IP address and MAC address.

@shalithasuranga
Copy link
Member

Hey.. Sure you can ask more questions. Also, you can discuss your ideas/questions with the entire community via Discord too.
Neutralinojs doesn't offer an API for network information, I think it's not a too generic API to be added into the official API. But there are several approaches to do this. You can create an extension using any favorite language and obtain network details via that specific extension instance. Please check more details about extensions from here: https://neutralino.js.org/docs/how-to/extensions-overview

@tonnidiaz
Copy link

tonnidiaz commented May 13, 2023

@shalithasuranga Native apis are not working with react when using neu run --frontend-lib-dev

@shalithasuranga
Copy link
Member

Hey.. @thehackingknight Are you using the latest version and did you follow this tutorial to enable hot reloading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request
Projects
None yet
Development

No branches or pull requests

6 participants