-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: add helper process #2753
feat: add helper process #2753
Conversation
This branch is running in CodeSandbox. Use the links below to review this PR faster. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #2753 +/- ##
==========================================
- Coverage 69.76% 69.65% -0.12%
==========================================
Files 335 335
Lines 7204 7204
Branches 1021 1021
==========================================
- Hits 5026 5018 -8
- Misses 1875 1882 +7
- Partials 303 304 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
affine-toeverythingBundle maindiff ------------------- Bundle Size Diff -------------------------
@@ EntryPoint: main @@
## master …elper-process +/- ##
===================================================================
= Bundle 4.44 MB 4.44 MB
= Initial JS 2.33 MB 2.33 MB
= Initial CSS 117 kB 117 kB
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
= Assets 77 77
= Chunks 60 60
= Packages 196 196
= Duplicates 15 15
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~#
! Deduplicate versions of libraries
! Separate mixed content assets files
! Avoid non-minified assets
@@ EntryPoint: pages/_app @@
## master …elper-process +/- ##
===================================================================
= Bundle 4.32 MB 4.32 MB
= Initial JS 2.21 MB 2.21 MB
= Initial CSS 117 kB 117 kB
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
= Assets 75 75
= Chunks 58 58
= Packages 196 196
= Duplicates 15 15
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~#
! Deduplicate versions of libraries
! Separate mixed content assets files
! Avoid non-minified assets
@@ EntryPoint: pages/_error @@
## master …elper-process +/- ##
===================================================================
= Bundle 16.6 kB 16.6 kB
= Initial JS 16.6 kB 16.6 kB
= Initial CSS 0 B 0 B
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
= Assets 2 2
= Chunks 2 2
= Packages 5 5
= Duplicates 0 0
...and more |
Deploying with Cloudflare Pages
|
(cherry picked from commit 5ba2dff)
(cherry picked from commit 5ba2dff)
(cherry picked from commit 5ba2dff)
(cherry picked from commit 5ba2dff)
fix #2614
The goal is to have another helper process using Electron's new UtilityProcess API to offload the blocking APIs (workspace, DB, dialog).
In order to do so, we need to have a different solution than the existing IPC based solutions. Here in this PR we introduced a MessagePort enabled bi-directional communication between UtilityProcess and renderer, and abstract the API with async-rpc-call recommended by @himself65.
The issues
main
,helper
andrenderer
main
andhelper
shall be initialized earlier thanrenderer
and will pass the api meta torenderer
main
andhelper
will expose APIs torenderer
, but with different scopes (mostly, helper cannot invoke electron related APIs)rpc.postEvent
The general design: