News for hackers. Stuff that matters.
Re:WKWebView, an Electron alternative on macOS/iOS by lcnmrn on Wednesday December 26, 2018 @08:53AM (#18762124)
Each Electron app comes with a very specific versions of Chromium and Node.js.

They can't run on native frameworks. If native frameworks are updated old apps would break. If native frameworks aren't updated newer apps would break.

What you're asking was already tried with Adobe AIR and failed. Instead we need lighter alternatives to Node.js and Chromium.

Re:WKWebView, an Electron alternative on macOS/iOS by azhenley on Wednesday December 26, 2018 @09:22AM (#18762244)
I'm really starting to think it would be a good PhD dissertation project to (semi?) automatically reduce Chromium to the bare minimum needed for a given Electron app. The techniques could probably be applied to reducing any library and would be of interest to researchers in SE and PL, along with industry.
Re:WKWebView, an Electron alternative on macOS/iOS by DonHopkins on Wednesday December 26, 2018 @10:39AM (#18762622)
That's not just tree shaking, that's more like rainforest shaking!
Re:WKWebView, an Electron alternative on macOS/iOS by nickpsecurity on Wednesday December 26, 2018 @04:32PM (#18765121)
That's exactly what I thought. You just include what you use. Either developer does it on a confijguration screen, a tool does it with analysis on what code reaches what other code, or both. It would also help if Chrome is designed to make this easier.

eCos is prior work on OS side that made me always think of designing systems for easy stripping.

http://ecos.sourceware.org/about.html

Re:WKWebView, an Electron alternative on macOS/iOS by cat199 on Wednesday December 26, 2018 @11:35AM (#18762964)
> good PhD dissertation project

why?

would not existing static analysis/dependency pruning take care of it if someone had the time?

I don't see what would be 'novel' here from a theoretical point of view..

still a good project possibly though

Re:WKWebView, an Electron alternative on macOS/iOS by azhenley on Wednesday December 26, 2018 @11:51AM (#18763069)
That is the research of it, we don't know if existing techniques would work! And surely there are novel improvements that could be made, particularly for this specific application.

Also, I imagine there are many cases where static analysis would not be enough for the JS app.

Re:WKWebView, an Electron alternative on macOS/iOS by barbecue_sauce on Wednesday December 26, 2018 @02:13PM (#18764043)
Sounds more like an undergrad thesis.
Re:WKWebView, an Electron alternative on macOS/iOS by andai on Wednesday December 26, 2018 @03:57PM (#18764813)
An old man once said, "write the thesis you wish to see in the world."
Re:WKWebView, an Electron alternative on macOS/iOS by Andrex on Wednesday December 26, 2018 @05:47PM (#18765564)
Hm, would headless Chromium be a good starting point for this?
Re:WKWebView, an Electron alternative on macOS/iOS by cztomsik on Wednesday December 26, 2018 @04:21PM (#18765032)
shameless self-promotion https://github.com/cztomsik/node-webrender

(not production-ready but it might be soon good enough for really quick GUI prototyping using subset of web technologies - javascript + react + flexbox + styles)

HMR & react-devtools are already supported.

Re:WKWebView, an Electron alternative on macOS/iOS by m0dest on Wednesday December 26, 2018 @11:16AM (#18762830)
This concern about breaking only seems true for the Node.js side. The HTML/JS/CSS running in the web view should be pretty resilient to version upgrades; web devs are used to defensive, backward-compatible design that handles multiple browser versions.

The bridge itself is API stable. evaluateJavaScript:completionHandler: isn't going anywhere.

So the question is whether it's okay to use a native web view while still bundling your own V8 + Node. That seems like an improvement to me!

Re:WKWebView, an Electron alternative on macOS/iOS by dchest on Wednesday December 26, 2018 @01:25PM (#18763662)
The bridge itself is API stable. evaluateJavaScript:completionHandler: isn't going anywhere.

Historically, this hasn't been the case. Apple loves to deprecate stuff (although, thankfully, they are a bit slower to remove it). Before WKWebView there was a "stable" WebView.

Re:WKWebView, an Electron alternative on macOS/iOS by bunnycorn on Wednesday December 26, 2018 @08:47PM (#18766579)
And if my memory serves me well, you couldn't even use WK version with local files! Clearly indicating that was not the way to make UIs, but to browse the real web...
Re:WKWebView, an Electron alternative on macOS/iOS by jf- on Wednesday December 26, 2018 @09:25AM (#18762258)
Or maintain backwards compatibility. You don’t need to remove deprecated API features, just mark them as deprecated. It would add some size but it’s better than the alternatives.