-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(core): allow an extension to be used by multiple extension points #4816
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
Conversation
dougal83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍 Thank you!
c457e8d to
79eda47
Compare
79eda47 to
e93f23d
Compare
e93f23d to
cbaddf2
Compare
dougal83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed to enable #4693 to contribute via multiple extension points.
use loopbackio#4816, and alter to non breaking by eaving it to user to use binding decorators in app. Signed-off-by: Douglas McConnachie <dougal83+git@gmail.com>
cbaddf2 to
0275dc5
Compare
|
@dougal83 Thank you for the review. I further improved the PR to make filterByTag even more flexible. PTAL. |
bajtos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvements in developer experience ❤️
The first commit looks mostly good to me. I have reservations about the complexity of the proposed design in the second commit, let's discuss.
Hmm, it looks like GitHub is listing the commits in the opposite order. By "first commit" I meant 0275dc5 (allow extensions to be used by multiple extension points), "second commit" meant dd6da12 |
emonddr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement!
0275dc5 to
2a4fe1b
Compare
bajtos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I now use a similar syntax as https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach to pass in the following params:
(tagValue, tagName, tagMap)
Lovely! This way LB developers can re-use their existing knowledge about ES6 and perhaps even re-use small functional bits between forEach and TagValueMatcher places.
I think these additions deserve documentation too. I think both docs for Context and for ExtensionPoint/Extension pattern should be updated. (Feel free to open a follow-up PR for the docs.) |
This allows an extension to be tagged with multiple extension points and the extension to be discovered by an extension point name.
2a4fe1b to
652e8e4
Compare
use loopbackio#4816, and alter to non breaking by eaving it to user to use binding decorators in app. Signed-off-by: Douglas McConnachie <dougal83+git@gmail.com>
The PR is to address the need by #4693 (comment).
TagValueMatcherfunction type for more flexible tag value matching used byfilterByTagChecklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈