PWAs and the vanishing Electron

36 views
Skip to first unread message

Gilad Bracha

unread,
Oct 6, 2023, 10:04:18 PM10/6/23
to Newspeak Programming Language
The Newspeak IDE is now a PWA (Progressive Web App). That rather awful term refers to web pages that can be installed on the client, and thereafter function much like a local application. In particular, there is no longer need for internet access to run them.

Until now, we offered two ways of achieving this: the Electron version of the or serving the IDE via localhost. Each has its pros and cons, but mostly cons (see the details toward the end of this message). 

It has long been obvious that this should change, and so Issue #84 was born. It's not a huge piece of work, but it was tedious. Thanks to Mircea Trofimciuc who did most of the work a couple of years ago. The issue got stuck because things didn't work on a mac.

Recent investigations into Electron updates were the the veritable last straw, and so I finally fixed the (fairly trivial) remaining blockers. 

At this point, if you go to https://newspeaklanguage.org/webIDE/, you'll get the IDE running in your browser. If you want to install it locally, you should use a Chromium based browser, which will allow you to install it with one click (you can even install it on mobile devices - mobile Safari allegedly supports this. Android certainly does).

So as of now, there is only one version the app. The web site has been updated accordingly, but really just the bare minimum.

A few details could be improved, but they aren't enough to justify sticking with the old solutions. Below, I'll just elaborate a bit on the difficulties with the old way of doing things.

The Electron app packages Newspeak with all of Chromium. The resulting download is huge, and when executed brings up a separate process with all the bloat that entails.  As for using localhost, that requires running a local web server.  

In addition, maintaining these options is a burden on yours truly. In addition to the basic web version, we (the royal we - me) had to build and deploy 3 other versions - Windows & Mac Electron builds and the web server zip file.  This only gets worse over time. Electron needed updating to keep up with Chrome updates, including both useful features and security fixes. It also grew ever larger (235Mb, compared to maybe 4mb for the web page?), and now there are even more versions - one for Linux, and each OS comes in Intel & ARM flavors.

 The next step should be sorting out  the automatic deployment of all Newspeak apps and documents as PWAs. Hopefully before Thanksgiving.


Milan Zimmermann

unread,
Oct 9, 2023, 2:47:48 AM10/9/23
to newspeak...@googlegroups.com
Gilad,

This is great. I was also able to build a local server producing a PWA for any vfuel, although not using the same directory structure as in https://github.com/newspeaklanguage/newspeak/tree/master/platforms/webIDE , just throwing all files in servable on the same level, editing the index, adding manifest.json and service worker  ... not time for much since Friday night.

Two brief notes:

- when I run the build.sh in the latest from Github (both Newspeak and Primordialsoup), I am getting errors for "vm/primitives.cc:2600: error: Failed to stat '*.txt'" and a different error for the files with "22" in them. Both are easy to fix locally by commenting out the appropriate lines from build.sh, but I thought I'd mention it in case it indicates anything semi useful.

- you mentioned the next step around making automatic deployments of all Newspeak apps as PWAs. I was curious about what you meant in more detail. Perhaps, when clicking on "deploy" we would generate the App vfuel, but also generate the whole structure for a server (like the one in https://github.com/newspeaklanguage/newspeak/tree/master/platforms/webIDE , except referencing the App vfuel instead of the IDE vfuel, adding App specific assets etc )?  Speculating but curious, but not important at all especially now,

Thanks,
Milan




--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/5830a6bb-7370-4e1c-a249-18b795840ae3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages