refactor!: use native private class fields and remove underscore prefixes - #699
Open
B4nan wants to merge 3 commits into
Open
refactor!: use native private class fields and remove underscore prefixes#699B4nan wants to merge 3 commits into
B4nan wants to merge 3 commits into
Conversation
…ixes Private class properties now use native `#` fields instead of TypeScript's compile-time `private`; private/protected methods keep their keyword and lose the `_` prefix. `Actor.#instance` gets an @internal `setDefaultInstance()` seam replacing the test-only `_instance` pokes, and the dead `_throwCannotCombineCustomMethods` duplicate of the crawlee base-class check is removed. BREAKING CHANGE: protected ProxyConfiguration helpers were renamed (`_getUsername` -> `getUsername`, `_checkAccess` -> `checkAccess`, `_fetchStatus` -> `fetchStatus`, `_requestStatus` -> `requestStatus`, `_throwCannotCombineCustomWithApify` -> `throwCannotCombineCustomWithApify`), `_setPasswordIfToken` is now private, and private properties are no longer reachable at runtime.
|
See more at https://github.com/apify/apify-sdk-js/actions/runs/32495575482#summary-96813046532 |
This was referenced Aug 21, 2026
fix: Remove storage purge() methods so that the storage frontends can fill in the functionality
#694
Open
This file contains hidden or 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
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.
Applies the same convention that landed in crawlee v4 (apify/crawlee#3980, apify/crawlee#3108) to the SDK: native
#private fields for private class properties, no_prefixes on members.Actor,ChargingManager,ProxyConfiguration, the storage/request-queue backends,PlatformEventManagerandAsyncLockare now native#fields (hard-private at runtime, invisible to enumeration andJSON.stringify). Private and protected methods keep their keyword and lose the_prefix; six private constructor parameter properties became explicit#fields.ProxyConfigurationprotected helpers renamed:_getUsername→getUsername,_checkAccess→checkAccess,_fetchStatus→fetchStatus,_requestStatus→requestStatus,_throwCannotCombineCustomWithApify→throwCannotCombineCustomWithApify._setPasswordIfTokenis nowprivate(honoring its TODO)._throwCannotCombineCustomMethodsis deleted: the crawlee base-class constructor already performs the identical check with the same message, so the SDK copy was unreachable.Actor._instance(public@internalstatic) is nowstatic #instance, with an@internalActor.setDefaultInstance()seam replacing the test helpers'delete-based resets.ProxyConfiguration's private fields via@ts-expect-errornow assert through the publicnewProxyInfo()result; the token-fetched password path gained an assertion it previously lacked.no-underscore-dangleoxlint rule (class fields + method names) enforces the convention; the upgrading guide documents the renames and the#semantics change.The methods stay on the prototype deliberately: the test harness routes
Actormethods through crawlee'sbindMethodsToServiceLocator, which only wraps prototype members.