Repository navigation
feat: add run from ASAR button - #1695
AlokYadavCodes wants to merge 6 commits into
Conversation
|
Hey @codebytere , just checking in. Let me know if there's anything I can do to help with the review. Also tagging @dsanders11 , since you opened this issue and are mentoring the GSoC project I’m applying for (Fiddle Support for Fuses), I would love to hear your thoughts as well. Thanks so much for your time and guidance. I really appreciate it and am excited to incorporate any feedback you might have! |
nikwen
left a comment
There was a problem hiding this comment.
Thanks for the pull request! I won't be able to review all of the PR, unfortunately, due to time constraints, but I thought this one was one of the best GSoC-related PRs I've seen so far this year.
I hope that someone else will get to this soon. There's a flood of GSoC-related pull requests at the moment, which keeps everyone busy. Please know that a good PR like this is very much appreciated. Thank you! 👍
dsanders11
left a comment
There was a problem hiding this comment.
This is a good start but it requires some changes and test coverage. 👍
| interface runOptions { | ||
| runFromAsar: boolean; | ||
| } |
There was a problem hiding this comment.
| interface runOptions { | |
| runFromAsar: boolean; | |
| } | |
| export interface RunOptions { | |
| runFromAsar?: boolean; | |
| } |
Should start with a capital letter to match existing style, and should be exported since it's part of the public API for this file. Since these are options, runFromAsar should be optional as more options may be added in the future.
There was a problem hiding this comment.
Oops, missed the capital letter there, thanks for catching that!
Exported it and made runFromAsar optional.
| if (runFromAsar) { | ||
| options.push('runFromAsar'); | ||
| } |
There was a problem hiding this comment.
This should be added to StartFiddleParams, and then it will be handled automatically by the ...params in the call to window.ElectronFiddle.startFiddle below. This will also require changes in src/main/fiddle-core.ts to plumb it into the call to runner.spawn.
|
@AlokYadavCodes, I've changed this PR to be a draft for the moment, the test failures are related to needing the |
|
Hey @dsanders11 , Also, I submitted a draft GSoC proposal titled "Electron Fiddle Support for Fuses" on April 2. If you have a moment to share any quick feedback before the deadline tomorrow, I'd really appreciate it. Totally understand if you're busy - thanks! |
|
@AlokYadavCodes, you'll need to bump the version of
Please send it to summer-of-code@electronjs.org as that's where we provide draft feedback. 🙂 |
|
@dsanders11 |
|
@AlokYadavCodes, the UI around the "Run from ASAR" button needs to be improved from my testing, the dropdown is a bit awkward looking with the focus ring around it (could it look more like the the dropdown for public/private gist?) and the dropdown remains there after I've clicked on it. I've also realized that this line is preventing this from working (due to starting options with Line 370 in d5e133f |
|
@dsanders11, fixed the UI to match the dropdown style used for public/private gist selection.
Should we also update the fiddle/src/main/fiddle-core.ts Line 56 in 53057ba |
|
@dsanders11 Just a gentle reminder about this PR whenever you have a chance. |
* feat: add Run from ASAR Adds a "Run from ASAR" command to the Run menu and the command palette. It packs the fiddle (with its installed modules) into app.asar in the run directory and starts Electron on the archive, so a fiddle can be tested the way a packaged app loads its code. Native addons are unpacked next to the archive, as Forge does. Run directories are now deleted through original-fs: Electron's fs treats an .asar file as a folder and could not remove the archive. Rebuilds #1695 on the rewritten codebase (#2032). Closes #1551. Co-authored-by: Alok Kumar <156905376+AlokYadavCodes@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WZZBjA2WsXJcxVUCYeuN2i * fix: map ASAR run errors through the archive's real path, and start ASAR runs in the run dir Electron realpaths the archive, so on macOS (tmpdir under /var -> /private/var) stack paths name /private/var/.../app.asar/main.js. Add the archive's real path to the output parser's roots, as realAppDir does for folder runs. An ASAR run now starts with the run dir as its working directory instead of the loose app folder, so a cwd-relative read fails as it would in a packaged app. Folder runs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WZZBjA2WsXJcxVUCYeuN2i * test: run the headless CLI on Chromium's headless Ozone backend Without a display (the Ubuntu CI runners), `--headless` still starts Chromium's default X11 backend, which then skips its "Missing X server" check. XCursorLoader's PropertyCache gets an error reply on the dead connection and calls OnPropertyChanged() synchronously from inside the XCursorLoader constructor, before rm_xcursor_theme_ is constructed, so it assigns to an uninitialized std::string. Whether that segfaults depends on the heap's leftover bytes, so any change to startup allocations moves the odds: Run from ASAR's bundled @electron/asar (with glob) took the CLI from never crashing to crashing about 40% of the time, and with a larger environment main crashes every time. The e2e spec saw these SIGSEGVs as a null exit code. `--ozone-platform=headless` never touches X11. The CLI opens no windows, so pass it in the CLI spec and in `yarn fiddle`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WZZBjA2WsXJcxVUCYeuN2i --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alok Kumar <156905376+AlokYadavCodes@users.noreply.github.com>
runOptionsinRunner.run() method.runOptionsparameter is defined as follows:Updated UI screenshots:
Closes #1551
This functionality requires an upstream change in
@electron/fiddle-core.I have already opened a PR to implement the required updates in fiddle-core:
Please review both the PR's and let me know if any changes are needed.