keystone
keystone copied to clipboard
Remove deprecated hooks
This replaces all the hooks from original combined form with the granular one inline with #9056 #9057 #8826
this cleans up the code and is breaking changes.
- [x] Remove types for the combined form
- [x] Cleanup code of hooks
- [x] Update all Field code to use proper hooks
- [x] Fix tests
- [x] Update documentation #9231
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 2676f4e280f2a34e14580bf03c49faa3ecd4e721:
| Sandbox | Source |
|---|---|
| @keystone-6/sandbox | Configuration |
I'll be merging https://github.com/keystonejs/keystone/pull/9166 ASAP, which should help with this pull request, fwiw
~If we go the way of this PR, #9166 would not be needed I think.~
This should be part of v-next branch so that it can take longer, you should merge #9166
@dcousens I am done with this, are you able to take a look and help resolve single type error in lint and documentation.
I have created documentation in separate PR #9231
@dcousens changing base on this to cleanup from deprecated hooks. This has nothing to do with the nextjs upgrade and can be merged sooner for next major release.
let me know if you have any plan with this or waiting for something.
I am unable to fix the typing error if you are waiting for that.
I plan to merge this very soon
@dcousens I have rebased and removed conflicts.
Thanks @gautamsi! Every bit of help is really appreciated :blue_heart:
@dcousens do you plan to focus on this again or prioritizing design system first?
I'll happily rebase this soon, should be straight forward - prioritizing the DS upgrade landing for now
@dcousens I see that you have already rebased this.
You will have to help with the type issue in linting, it is something I am unable to find solution to.
@emmatown I fixed structure field. Please check linting for select field.
@emmatown there is no point of the PR if you want to keep the top level hooks.
if you are going to keep top level hooks, revert/update #9231
@gautamsi this removes the deprecated validateInput and validateDelete functions, and then introduces the breaking change to support the field hooks to use the same object notation as list hooks.
Unpacking the object is often the preferred approach beyond any level of complexity, so I think #9231 stays completely relevant?
Why remove the Function | { ... } hook syntax?
Why remove the Function | { ... } hook syntax?
[Replying to myself] we did actually talk about this at length, but opted to keep things aligned with the approach in .access and everywhere else in the project for now.
Maybe in the future a better pattern will emerge where we only retain the unpacked type variants in the unresolved configuration, and some convenience function (like allOperations<F> (f: F) for access control) could be introduced.