keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Remove deprecated hooks

Open gautamsi opened this issue 1 year ago • 5 comments

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

gautamsi avatar Jul 08 '24 04:07 gautamsi

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

codesandbox-ci[bot] avatar Jul 08 '24 04:07 codesandbox-ci[bot]

I'll be merging https://github.com/keystonejs/keystone/pull/9166 ASAP, which should help with this pull request, fwiw

dcousens avatar Jul 08 '24 05:07 dcousens

~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

gautamsi avatar Jul 08 '24 05:07 gautamsi

@dcousens I am done with this, are you able to take a look and help resolve single type error in lint and documentation.

gautamsi avatar Jul 25 '24 01:07 gautamsi

I have created documentation in separate PR #9231

gautamsi avatar Jul 25 '24 01:07 gautamsi

@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.

gautamsi avatar Dec 02 '24 02:12 gautamsi

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.

gautamsi avatar Dec 19 '24 04:12 gautamsi

I plan to merge this very soon

dcousens avatar Dec 19 '24 19:12 dcousens

@dcousens I have rebased and removed conflicts.

gautamsi avatar Jan 22 '25 05:01 gautamsi

Thanks @gautamsi! Every bit of help is really appreciated :blue_heart:

dcousens avatar Jan 22 '25 21:01 dcousens

@dcousens do you plan to focus on this again or prioritizing design system first?

gautamsi avatar Jan 30 '25 00:01 gautamsi

I'll happily rebase this soon, should be straight forward - prioritizing the DS upgrade landing for now

dcousens avatar Jan 30 '25 04:01 dcousens

@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.

gautamsi avatar Feb 06 '25 04:02 gautamsi

@emmatown I fixed structure field. Please check linting for select field.

gautamsi avatar Feb 11 '25 14:02 gautamsi

@emmatown there is no point of the PR if you want to keep the top level hooks.

gautamsi avatar Feb 12 '25 04:02 gautamsi

if you are going to keep top level hooks, revert/update #9231

gautamsi avatar Feb 12 '25 05:02 gautamsi

@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?

dcousens avatar Feb 12 '25 05:02 dcousens

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.

dcousens avatar Feb 12 '25 06:02 dcousens