-
Notifications
You must be signed in to change notification settings - Fork 20
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
[chore] Apply context isolation and rearrange execution.ts
#376
Merged
kyungeunni
merged 14 commits into
elastic:main
from
kyungeunni:explore-context-isolation
Feb 9, 2023
Merged
[chore] Apply context isolation and rearrange execution.ts
#376
kyungeunni
merged 14 commits into
elastic:main
from
kyungeunni:explore-context-isolation
Feb 9, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kyungeunni
changed the title
[chore] Apply context isolation and rearrange
[chore] Apply context isolation and rearrange Feb 7, 2023
execution.ts
to make it more modularexecution.ts
kyungeunni
commented
Feb 7, 2023
kyungeunni
commented
Feb 7, 2023
kyungeunni
force-pushed
the
explore-context-isolation
branch
from
February 7, 2023 09:41
1ee4dc5
to
0ea4ca8
Compare
justinkambic
reviewed
Feb 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few slight improvements/asks and some nit comments.
Really fantastic work on this!
kyungeunni
force-pushed
the
explore-context-isolation
branch
2 times, most recently
from
February 8, 2023 08:30
9d70d94
to
7816b8a
Compare
justinkambic
approved these changes
Feb 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Justin Kambic <[email protected]>
Co-authored-by: Justin Kambic <[email protected]>
kyungeunni
force-pushed
the
explore-context-isolation
branch
from
February 9, 2023 04:05
58b2ee5
to
d15380a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
base work for
onTest
electron code #235Summary
Currently, all the functions running in the main process were mangled together in the
electron/execute.ts
file. This makes it quite difficult to understand, hard to maintain, and a blocker for adding tests.This PR tries to extract each function to its own file so that we could avoid the difficulties mentioned above, and make it possible to add unit tests.
Another important thing is that this PR introduces context isolation as per the security guideline provided by Electron.
Implementation details
execution.ts
is now divided into files underapi/
directorywindow.electronAPI
is exposedHow to validate this change
run test, run dev
Note to reviewers:
I'm afraid this PR is quite big to go through, I wish I could break it down into smaller chunks of PRs but it was inevitable to do it all at once as everything was connected. I recommend seeing how the communication between renderer process <-> main process has been changed by exposing selected APIs in
electron/preload.ts
to align with the best practices.Also, there are new components like
browserManger
orsyntheticsManager
. Those are introduced as it requires a somewhat shared state between functions as well as to make it easier for us to mock the dependency when testing. That being said, it might be an intermediate change that is subject to change in upcoming tests PRs.