-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add Decorator Support #428
base: master
Are you sure you want to change the base?
Conversation
fa5736d
to
8af9612
Compare
@dbollinger I'd love to get your thoughts on the "open questions" above -- especially whether we should detect usage inside one version of |
This is great! For question 1 -- I generally favor the advice to "prefer duplication over the wrong abstraction" and in this case a separate export seems fine. Alpha/beta releases can help make that a smoother process as well. For question 2 -- I think some additive documentation would be a good first step, but I'm not sure about the best way to manage that alongside the release process. |
Good words to live by! I’m cool with making it a separate import right now and maybe combining them sometimes in the future. This package is technically still pre- Given the fact that it won’t be the exports from the “main” module, I’ll add some |
8af9612
to
880d5f0
Compare
Codecov Report
|
880d5f0
to
a00d002
Compare
Rebased to use |
a00d002
to
d0dc07c
Compare
d0dc07c
to
7981ea5
Compare
7981ea5
to
05a8740
Compare
Hmm... So it seems like the decorator tests don't working for Ember... Some thoughts:
|
Will decorators work in those versions anyways? 🤷♂️ |
They could -- the original implementation of the decorator I had did -- but the way it is not implemented, where TypeScript's compiler is satisfied, does not. I would be in favor of just dropping support for these two very old Ember versions and increase the minimum version to |
@mike-north @alexlafroscia do we know what's the status here 🙏 |
No updates from me 🤷♂️ I honestly forgot I made these PRs, but with the update-to-Ember-3.12-at-a-minimum PR still standing as it is, I don't think we're in a place to move forward really. |
Looks like that Pr landed so this PR can move forward? I think the prototype workaround is alright but decorators would also be nice! |
Is there any news on this? Would indeed be nice to have this in. |
@alexlafroscia Possible we could rebase with the latest on the main branch and see if @Turbo87 would be open to merging and releasing it? |
That would be 🔝 @alexlafroscia @snewcomer !! Thank you for putting this together 🙏 |
@snewcomer Did the rebase and made a new PR which is here: #609 |
FWIW we (@mainmatter) forked the addon and created a new API that does not involve decorators at all but should also be a bit more TS friendly once we add types: https://github.com/mainmatter/ember-api-actions |
also, even if we merged this PR we still couldn't release it, because @mike-north still hasn't given anyone npm ownership of the package... :-/ |
@Turbo87 Thanks for forking and taking over! I hate it when this happens to great projects (and great PRs) and there's no clear passing of the torch. Your solution feels great, and I'm gonna migrate over to that and forget about this branch entirely! 🎉 |
@mike-north Pssssst think you could pass the keys over to someone else and archive this repo, maybe updating the readme with a link to the maintained project? Seems like you're not into this project anymore and it'd be great to give the community a direction to go towards. |
In trying to use your version @Turbo87, it looks like… a) it's not actually a fork of this project but a completely new project with the same name? If you're looking to carry this project forward into the future (and I hope you are!), it feels weird to not have the years of git history that came before. If this were my project that I started and then abandoned, I'd feel slighted if my name were erased from the history. b) Your addon seems to be missing some key features that this one has, like the before and after hooks on the actions. Was that intentional? |
it doesn't have the history because we've rewritten it from scratch with a completely different API 😅 yes, before and after missing is intentional, because you can just do those before and after the action call within the async function. also, I apologize for the lack of documentation so far. it's still work in progress, but I thought I'd share it here already anyway :) |
This adds two decorators,
memberAction
andcollectionAction
, that are exported fromember-api-actions/decorators
. They are built to be compatible with the V1 decorator spec.The exported functions are called with the same options as the existing helpers, and internally call the exact same logic.
Open Questions:
Left To-Do, Pending Question Resolution:
Closes #413