Skip to content

Comments

[web] Allows live reloading during development#419

Merged
dgdavid merged 11 commits intomasterfrom
hot-reloading
Feb 10, 2023
Merged

[web] Allows live reloading during development#419
dgdavid merged 11 commits intomasterfrom
hot-reloading

Conversation

@dgdavid
Copy link
Contributor

@dgdavid dgdavid commented Feb 9, 2023

Problem

Sometimes it's a PITA to have to refresh manually the browser while working in the front end. For example, when you're doing changes in a popup: save the file, goes to the browser, click refresh, open the popup again.

Solution

To configure webpack for allowing the hot reloading

Testing

Tested manually by @dgdavid and @imobachgs

TODO:

  • In this PR:

    • Update the README
    • Update the changes file
  • In the future:

    • Allow the live reloading in an external device too. To do that, we could

      • Use the server IP in the websocketURL.

      • Transform the manifest.json file for adding the ip in the "content-security-policy"

      • Make needed configuration for allowing wss since seems that browsers does not allow connecting to an unsecure websocket from a secure connection, which makes sense.

        Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Comment on lines +20 to +27
While working on the code, you might want to run the [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to get the [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) enabled.

```
npm run server
```

Or simply run the Webpack watcher for refreshing the build every time you save a change **BUT** reloading
the code in your browser by yourself.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, help me to improve this text by using the "Add suggestion" Github's feature.

@dgdavid dgdavid changed the title [web] Allows hot reloading during development [web] Allows live reloading during development Feb 9, 2023
@coveralls
Copy link

coveralls commented Feb 9, 2023

Coverage Status

Coverage: 77.943%. Remained the same when pulling d8e3f5f on hot-reloading into f9fa0d2 on master.

@dgdavid dgdavid marked this pull request as ready for review February 9, 2023 16:27
NODE_ENV is never "development" ¯\_(ツ)_/¯
Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I have tested it and it works great. LGTM.

@dgdavid dgdavid merged commit 5d85d3d into master Feb 10, 2023
@dgdavid dgdavid deleted the hot-reloading branch February 10, 2023 09:55
@imobachgs imobachgs mentioned this pull request Feb 13, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 16, 2023
https://build.opensuse.org/request/show/1066106
by user IGonzalezSosa + dimstar_suse
- Version 0.7
- Do not use a proxy to get the errors lists
  (gh#agama-project/agama#424).

- Add live reloading feature for easing the front-end development
  process (gh#agama-project/agama#419).

- Fix storage section crashing when proposal is not ready
  (gh#agama-project/agama#418).

- Better handling of software repositories
  (gh#agama-project/agama#414):
  * Report issues when reading the software repositories.
  * Inform the user about the software proposal progress.
  * Add a button to reload the repositories
    (gh#agama-project/agama#388).

- Added a button for displaying the YaST logs
  (related to gh#agama-project/agama#379)

- UI fixes (gh#agama-project/agama#401):
  * Add a fallback height for the layout
  * Fix some miss-alignments
  * Add missing icon
  * Ensure tooling serving and loading fo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants