-
Notifications
You must be signed in to change notification settings - Fork 88
Feature/lit 3918 no globalthis variables anymore #663
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
Feature/lit 3918 no globalthis variables anymore #663
Conversation
… litnodeclient export
…one in auth-browsers/eth
… a function and module scoped variable
…es-anymore Signed-off-by: Anson <[email protected]>
|
|
||
| // check if config is loaded yet | ||
| if (!globalThis?.litConfig) { | ||
| if (!litConfig) { |
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.
Making a note to reevaluate this module of scoping of the LitConfig instance for the logger refactor task: https://linear.app/litprotocol/issue/LIT-3921/migrate-to-interfacing-with-logger-through-module-over-global-object
Ansonhkg
left a comment
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
| if (isBrowser()) { | ||
| // @ts-ignore | ||
| globalThis.litWCProvider = wcProvider; | ||
| litWCProvider = wcProvider; |
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.
double checked that this variable is not used in other modules as it's now locally scoped instead of global
Description
This PR removes the global variables used in several to share configs between modules or helper functions
Also removes the cdn installation instructions as those depend on a now gone global variable
The intent for this is to allow consumers of the SDK to have multiple versions of it without conflicts
Changelog
globalThis.litWCProviderfromauth-browserpackage is gonesetMiscLitConfigfunction to pass litCore config up tomiscpackage instead of relying onglobalThis.litConfigType of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: