-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the application’s size #2
Comments
Unless I am mistaken, API usage of Puppeteer is limited to: const browser = await puppeteer.launch({ args });
// ...
const page = await browser.newPage();
await page.goto(url);
// ...
const scriptElemHandle = await page.addScriptTag({ path });
await page.evaluate((scriptElem) => {
// ...
}, scriptElemHandle);
// ...
const results = await page.evaluate(() => new Promise((resolve, reject) => {
// ...
}));
await page.close();
// ...
await browser.close();
...all of which can be performed via Electron's own Chromium renderer process, either in a separate |
you're right, thanks for tip! (in fact, quite coincidentally, I was thinking about that too today while sipping my morning coffee 😄 ). It would require some refactoring of |
A single off-screen Electron That being said, the main question is whether or not "hiding" a window off-screen has undesirable side-effects when automating a11y tests ... I'm not sure. To be verified. |
By the way, have you looked into Carlo?
|
Yes, I've just seen a tweet about that yesterday. It's definitely interesting, but not fully adapted to our requirements I think (for instance it will display an error message when Chrome isn't installed on the user's environment, which will not fulfill the easy-install experience we're promising). |
Work in progress: daisy/ace#227 |
Fixed: #42 |
Current, Ace weighs around 300MB, which is huge. There are two primary reasons:
There are a couple approaches to improve the situation, while keeping a cross-platform HTML+CSS+JS code base, unfortunately none of which seems to be ideal or even fully available to us at this stage:
Using puppeteer to drive the Electron-bundle chromium instance
This would remove the need to bundle our own copy of Chromium. However:
--remote-debugging-port
flag to enable remote debugging and allow Puppeteer to connect to it (with theconnect()
API). So far, our experiments with the current approach failed:Bundling a lighter build of Chromium
By default, Puppeteer bundles the default Chromium build. We could save a few MB by only bundling chromium's headless shell instead. Pupetteer would make this feasible by skipping the chromium download at install (or depending on
puppeteer-core
), then using itsBrowserFetcher
API to download the headless shell.However, at the time of writing no pre-built binaries of
headless_shell
are available.See also puppeteer/puppeteer#3140
Compiling the code to a native GUI
There are a few promising libraries:
The huge benefit of using this approach is that the GUI itself would be much more lightweight, and it would allow us to independently control the version of the local chromium engine used by Ace (with puppeteer).
Porting to NW.js?
NW.js is an alternative to Electron, but it seems to be based on default chromium builds. It could possibly allow to be driven by puppeteer, and is more up-to-date with latest chromium versions.
Porting to NW.js wouldn't solve the performance-related issues of the app not being native however, and the build ecosystem (notably for creating installers and updaters) is less mature than it is in the Electron world.
Developing per-platform native UIs
That could solve all our issues, and would be better for performance. However we're quite happy with the HTML+CSS+JS cross-platform development workflow, and we just don't have the resources to develop different code bases for each target OS ¯\_(ツ)_/¯.
The text was updated successfully, but these errors were encountered: