Thursday, July 1, 2021

[SNIPPET] Change default python3 to python3.9 in Xubuntu (or others Debian-based distros)

Changes the symlink `python3` to point to `python3.9`:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1

Wednesday, April 14, 2021

[FIX] Parcel does not detect file changes when using Geany

Problem

Parcel's hot module replacement (HMR) either doesn't detect or only detects the first time a static file changes when using the Geany text editor.

Cause

Geany uses by default a feature called "safe write" in the Parcel documentation and "atomic file saving" in the Geany documentation. When this is enabled, instead of simply overwriting the file being saved, Geany writes to a separate temporary file and then subsequently renames this temporary file to the existing file name. In this manner, it aims to avoid data loss if the writing is interrupted for some reason.

Solution

  1. Open Geany.
  2. Go to Preferences >> Various.
  3. Disable "files.use_atomic_file_saving".
  4. Disable "files.use_gio_unsafe_file_saving".
  5. Click Apply and OK.

Now Parcel will detect changes properly.

Sources

https://wiki.geany.org/config/all_you_never_wanted_to_know_about_file_saving

https://en.parceljs.org/hmr.html#safe-write