Skip to content
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

Rethink about the runtime process model and electron #30

Closed
4 tasks done
Tracked by #19
Yukaii opened this issue Jun 11, 2023 · 2 comments
Closed
4 tasks done
Tracked by #19

Rethink about the runtime process model and electron #30

Yukaii opened this issue Jun 11, 2023 · 2 comments

Comments

@Yukaii
Copy link
Collaborator

Yukaii commented Jun 11, 2023

I have some difficulties starting the application shipping process around commit fb29964.

Initially, I started the runtime in electron's utility process and struggled with packager bundling 2fcb790. Eventually, I found it too troublesome to eval/load the extension module and its dependencies inside the electron main process, so I decided to manage the Node.js binary on the user's computer and run the runtime with that nodejs runtime.

Regarding the shipping of the runtime, currently I use esbuild to build another single file cjs module of blast-runtime. I have two options:

  • Use that downloaded node binary's npm to install @blastlauncher/runtime with ~/.blast/extensions prefix, just like other blast-extensions. The version can be explicitly found in ~/.blast/extensions/package.json, and version pinning and upgrading can also be easily done.
  • Ship the runtime module as electron assets. We can bundle it with electron-forge's webpack, and there's no need to handle some spawn process magic. But it needs to be upgraded with the electron app itself.

About the compatibility between the runtime and frontend, it's another story.

Tasks

  • Update the @blastlauncher/runtime package to include minimum runtime dependencies. All deps should be bundled with esbuild.
  • Publish a new version of runtime. Use it along and pack with electron-client module webpack
  • Implement a node binary manager module in @blastlauncher/utils (We can search for an existing solution first).
  • Integrate the node binary manager in the electron-client.
  • Implement a runtime process manager in the electron-client.
@Yukaii Yukaii mentioned this issue Jun 11, 2023
5 tasks
@Yukaii Yukaii pinned this issue Jun 15, 2023
@Yukaii
Copy link
Collaborator Author

Yukaii commented Aug 13, 2023

  • Bundle blast-runtime/run.cjs along with electron app

https://github.com/ganeshrvel/tutorial-electron-bundle-binaries/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant