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

Replace deepAccess with optional chaining #12543

Open
gwhigs opened this issue Dec 4, 2024 · 2 comments · Fixed by #12544
Open

Replace deepAccess with optional chaining #12543

gwhigs opened this issue Dec 4, 2024 · 2 comments · Fixed by #12544
Labels

Comments

@gwhigs
Copy link
Collaborator

gwhigs commented Dec 4, 2024

Type of issue

Question

Description

I see mixed use of both optional chaining (obj?.prop1?.prop2) and the deepAccess function in Prebid.js.

Is optional chaining preferred? If so, would a PR replacing some usage of deepAccess be appropriate?

I have a list of such patches for certain modules and would like to submit them. However, my internal build target includes native support for optional chaining. I'm unsure whether this is the case more generally.

Replacing deepAccess entirely — if desirable — would be a larger effort considering how deeply integrated some usages are.

@dgirardi
Copy link
Collaborator

dgirardi commented Dec 4, 2024

No objections to such PRs. All the browsers we target now have native support for it, and it's part of our "standard" build output, but we still have babel set up so that it would get transpiled away for those that wish to build for older browsers. I believe the reason for deepAccess is that the project is old enough that these features were missing or experimental even for babel at the time.

@patmmccann
Copy link
Collaborator

Keeping open for a linter warning suggesting the use of optional chaining

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready for Dev
Development

Successfully merging a pull request may close this issue.

3 participants