Skip to content

fix: v2 non-field api support #5178

Merged
jhefferman-sfdc merged 5 commits intomasterfrom
jhefferman/api-setter-fix
Jan 30, 2025
Merged

fix: v2 non-field api support #5178
jhefferman-sfdc merged 5 commits intomasterfrom
jhefferman/api-setter-fix

Conversation

@jhefferman-sfdc
Copy link
Contributor

Details

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

W-17701540

@jhefferman-sfdc jhefferman-sfdc requested a review from a team as a code owner January 30, 2025 18:14
@@ -0,0 +1,14 @@
<x-parent>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this test for symmetry (I know it is covered elsewhere too)

props: Properties,
attrs: Attributes,
publicFields: Set<string>,
api: Set<string>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like publicFields better. Makes the high-level intent more obvious.

import { LightningElement, api } from 'lwc';

export default class Child extends LightningElement {
@api set setterGetterApi(value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@api set setterGetterApi(value) {
@api set setter(value) {

Can we also add a @api get getter in this test, to make sure we cover both?

@jhefferman-sfdc jhefferman-sfdc merged commit b6c0276 into master Jan 30, 2025
11 checks passed
@jhefferman-sfdc jhefferman-sfdc deleted the jhefferman/api-setter-fix branch January 30, 2025 21:04
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.

2 participants