This PR aims to privatise, protect and remove unused methods from lit-node-client and lit-core, standardise to use #methodFoo over _methodFoo for privatised methods, and protected _methodBar over _methodBar for protected methods.
NOTE: Even though we are implementing these method visibility changes using # for private methods and protected _ for protected methods, it is important to note that these changes will only be fully effective with TypeScript and modern JavaScript (ES2022 and later). Core JavaScript prior to ES2022 does not natively support the # syntax for private methods, and JS does not have a native protected keyword; this is a TypeScript feature that allows for better control over method visibility.
Method Visibility Changes
Privatised Methods
The following methods have been changed to private (prefixed with #):
1. Removed getIpAddress method from packages/misc/src/lib/misc.ts and related test cases in packages/misc/src/lib/misc.spec.ts.
2. Removed unused endpoints from packages/constants/src/lib/constants/endpoints.ts.
Type of change
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
NETWORK=localchain DEBUG=false yarn test:local
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules
Description
This PR aims to privatise, protect and remove unused methods from
lit-node-client
andlit-core
, standardise to use#methodFoo
over_methodFoo
for privatised methods, andprotected _methodBar
over_methodBar
for protected methods.NOTE: Even though we are implementing these method visibility changes using
#
for private methods andprotected _
for protected methods, it is important to note that these changes will only be fully effective with TypeScript and modern JavaScript (ES2022 and later). Core JavaScript prior to ES2022 does not natively support the#
syntax for private methods, and JS does not have a nativeprotected
keyword; this is a TypeScript feature that allows for better control over method visibility.Method Visibility Changes
Privatised Methods
The following methods have been changed to private (prefixed with #):
Protected Methods
The following methods have been changed to protected (prefixed with _):
Removed Methods and Endpoints
Type of change
How Has This Been Tested?
Checklist: