Skip to content

Commit

Permalink
Update nw.js once again and work around the NW2 performance issues.
Browse files Browse the repository at this point in the history
Turns out that nw.js 0.42.0 crashes a lot on newer macOS versions, so we
need to upgrade to a later version. As Ico figured out a while ago, the
performance issues in later versions are due to the NW2 upgrade in
0.42.4 (https://nwjs.io/blog/nw2-mode/). This can be disabled which gets
JS execution performance back up to where it was in older versions.

Thus we have the following changes:

- Use --disable-features=nw2 to work around the NW2 scripting
  performance regression (nwjs/nw.js#7979).
  This is essentially a backport of Ico's fix in
  pd-l2ork/pd-l2ork@290fffc1. Thanks, Ico!

- Bump nw.js back up to 0.67.1 across platforms (Mac, Linux, Windows).
  This is the same version that Ico uses which seems to work well across
  platforms. (Later versions have some weird window-related regressions
  when used with NW2 disabled, so for now we have to stick to 0.67.1.)
  • Loading branch information
agraef committed Aug 7, 2024
1 parent ada8bbb commit 343a24d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions l2ork_addons/tar_em_up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if [ ! -d "../pd/nw/nw" ]; then
# work on newer macOS versions. Note that at present only
# Intel builds are supported, but these should also work on
# Apple Silicon via Rosetta 2.
nwjs_version="v${nwjsver:-0.42.0}"
nwjs_version="v${nwjsver:-0.67.1}"
elif [ $arch == "arm" ]; then
# rpi-- only 0.27.6 is available atm
nwjs_version="v0.27.6"
Expand All @@ -226,7 +226,7 @@ if [ ! -d "../pd/nw/nw" ]; then
nwjs_version="v0.23.7"
else
# default for Linux and Windows
nwjs_version="v${nwjsver:-0.42.0}"
nwjs_version="v${nwjsver:-0.67.1}"
fi

nwjs="nwjs-sdk"
Expand Down
2 changes: 1 addition & 1 deletion pd/nw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function nw_create_window(cid, type, width, height, xpos, ypos, attr_array) {
gui.Window.open(my_file, {
title: my_title,
// [email protected]: position in 0.46.2 overrides x and y below
position: pos,
//position: pos,
focus: true,
width: width,
// We add 23 as a kludge to account for the menubar at the top of
Expand Down
2 changes: 1 addition & 1 deletion pd/nw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "purr-data",
"version": "0.1.0",
"main": "index.html",
"chromium-args": "--proxy-server=http://127.0.0.1 --password-store=basic",
"chromium-args": "--disable-features=nw2 --proxy-server=http://127.0.0.1 --password-store=basic",
"window": {
"icon": "./purr.png",
"position": "center",
Expand Down

0 comments on commit 343a24d

Please sign in to comment.