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

docs: define practices for third-party extensible APIs #586

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

samuelmaddock
Copy link
Member

A few of Electron's existing APIs don't do a good job of supporting extensibility for third-party libraries. Let's try to define best practices to guide future API designs with third-party extensibility in mind.

protocol.registerSchemesAsPrivileged

session.setPreloads / session.getPreloads

  • Requires replacing all preloads rather than adding a single preload
session.setPreloads([
  ...session.getPreloads(),
  path.join(__dirname, 'new-preload-script.js')
])

@samuelmaddock samuelmaddock requested a review from a team as a code owner October 3, 2024 19:19
wg-api/best-practices.md Outdated Show resolved Hide resolved
wg-api/best-practices.md Outdated Show resolved Hide resolved
samuelmaddock and others added 3 commits October 3, 2024 16:16
Co-authored-by: Will Anderson <will@itsananderson.com>
Co-authored-by: Will Anderson <will@itsananderson.com>
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@itsananderson itsananderson left a comment

Choose a reason for hiding this comment

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

LGTM as well. Sorry I forgot to come back and stamp after your updates 😅

@samuelmaddock samuelmaddock merged commit a193a7d into electron:main Oct 10, 2024
2 checks passed
@samuelmaddock samuelmaddock deleted the docs/extensible-apis branch October 10, 2024 18:27
@timfish
Copy link

timfish commented Oct 10, 2024

Thanks for your work on this!

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

Successfully merging this pull request may close these issues.

5 participants