Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proposal bind shorthand #37

Merged
merged 17 commits into from
Jan 30, 2025
Merged

Proposal bind shorthand #37

merged 17 commits into from
Jan 30, 2025

Conversation

cesarParra
Copy link
Owner

@cesarParra cesarParra commented Jan 14, 2025

Bind feature based on this proposal: #38

import { counter, counterPlusTwo } from "c/demoSignals";

export default class CountTracker extends LightningElement {
bindTest = $binded(this, "bindTest").to(counter);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand why you are doing this but I don't love it. Not sure what would be a better way to do the binding

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, that's why I'm keeping it as a proposal stage until I get some feedback, not sure if you saw the issue I put up for discussion: #38

I don't want to merge if its going to be detrimental compare to what exists today, but I haven't found a better way of doing it with how Javascript works today. The only way I can think this could be done is by using decorators, but JS doesn't support those yet.

this.propertyName = propertyName;
}
to(signal) {
$effect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this ok performance wise?

stanleyzapata and others added 13 commits January 21, 2025 11:14
- Introduced a `stackDepth` tracker in effect execution to manage circular dependencies.
- Effects can now re-enter up to a maximum stack depth of 16 without throwing an error.

This change allows limited circular dependencies while preventing infinite loops.
* fix: Rebuild

* Commit from GitHub Actions (CI)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@cesarParra cesarParra marked this pull request as ready for review January 30, 2025 15:23
@cesarParra cesarParra merged commit a64ca63 into main Jan 30, 2025
Copy link
Contributor

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants