Skip to content

feat: allow setting code cache directory - #31154

Merged
ckerr merged 4 commits into
mainfrom
miniak/code-cache-path
Mar 15, 2022
Merged

ckerr merged 4 commits into
mainfrom
miniak/code-cache-path

Conversation

@miniak

@miniak miniak commented Sep 27, 2021 •

Copy link
Copy Markdown
Contributor

Description of Change

Add ses.setCodeCachePath() API for setting code cache directory.

When transitioning to a node-free renderer environment apps which previously relied on creating v8 cached data via the vm module would store the data at version based locations of the format like <user-data-dir>/<commit-sha-or-version> so that the cache can be invalidated on updates. When relying on blink to now handle the cache creation and invalidation, this api is useful to serve as a hard reset when the cache goes into a non-recoverable state.

Checklist

Release Notes

Notes: Added ses.setCodeCachePath() API for setting code cache directory.

@miniak miniak added semver/minor backwards-compatible functionality target/16-x-y labels Sep 27, 2021
@miniak
miniak force-pushed the miniak/code-cache-path branch 3 times, most recently from a7e1b10 to 90ea368 Compare September 30, 2021 14:43

@zcbenz zcbenz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API looks good to me.

Comment thread docs/api/session.md Resolved
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Oct 4, 2021
Comment thread docs/api/session.md Resolved
Comment thread docs/api/session.md Resolved
Comment thread docs/api/session.md Resolved
@nornagon

nornagon commented Mar 9, 2022

Copy link
Copy Markdown
Contributor

API LGTM

@deepak1556
deepak1556 force-pushed the miniak/code-cache-path branch from 90ea368 to a57159b Compare March 10, 2022 12:09
@deepak1556
deepak1556 requested review from nornagon and zcbenz March 10, 2022 12:11
@nornagon nornagon self-assigned this Mar 14, 2022

@ckerr ckerr left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good idea.

From an API WG pov, my two questions are

  1. Does it make sense to expose the size feature to end users? It looks like it would be easy to do, but IDK if there's benefit in it.

  2. The previous discussion about what to do with dead cache entries

Comment thread docs/api/session.md Resolved
deepak1556 and others added 2 commits March 14, 2022 20:12
Co-authored-by: Charles Kerr <[email protected]>
@deepak1556
deepak1556 requested a review from ckerr March 15, 2022 03:24

@ckerr ckerr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@ckerr

ckerr commented Mar 15, 2022 •

Copy link
Copy Markdown
Member

API Review In progress — Pending (0/2 LGTMs - ready on 2021-10-04)

There are three approvals, so this bot being broken is not a reason to block this PR

@ckerr
ckerr merged commit 2657383 into main Mar 15, 2022
@ckerr
ckerr deleted the miniak/code-cache-path branch March 15, 2022 20:34
@release-clerk

release-clerk Bot commented Mar 15, 2022

Copy link
Copy Markdown

Release Notes Persisted

Added ses.setCodeCachePath() API for setting code cache directory.

@trop

trop Bot commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "17-x-y", please check out #33285

@trop

trop Bot commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "18-x-y", please check out #33286

bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
* feat: allow setting code cache directory

* chore: address review feedback

* chore: update docs

Co-authored-by: Charles Kerr <[email protected]>

* chore: rewrite with base::Contains

Co-authored-by: Charles Kerr <[email protected]>

Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: Charles Kerr <[email protected]>
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* feat: allow setting code cache directory

* chore: address review feedback

* chore: update docs

Co-authored-by: Charles Kerr <[email protected]>

* chore: rewrite with base::Contains

Co-authored-by: Charles Kerr <[email protected]>

Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: Charles Kerr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/requested 🗳 semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants