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

feat(fast-element): attached behaviors #2784

Merged
merged 3 commits into from
Mar 11, 2020

Conversation

EisenbergEffect
Copy link
Contributor

Description

This PR refactors the RefDirective into a general purpose AttachedBehaviorDirective which opens up new possibilities for attaching arbitrary custom behavior to any HTML element within a template.

Motivation & context

When reflecting on the way that the ref binding works, it occurred to me that the base functionality could be parameterized slightly to result in a whole new extensibility point within the templating engine. With that in place, ref could be built on top of a lower-level API and other "attached behaviors" could also be built rather easily.

NOTE: This PR also makes ref a standard export of the library.

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

This is technically a breaking change because RefDirective no longer exists. However, that was not likely used by anyone directly. It was used internally by the ref function. This function, which is used in most templates, has remained unchanged, in terms of its signature and intended usage.

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@EisenbergEffect EisenbergEffect merged commit 170eed7 into master Mar 11, 2020
@EisenbergEffect EisenbergEffect deleted the users/eisenbergeffect/attached-behaviors branch March 11, 2020 19: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.

3 participants