-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove filters
export from @keystone-6/core/types
#7919
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This comment was marked as resolved.
This comment was marked as resolved.
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 13dcbd8:
|
This should have been documented (minimal if not comprehensive) instead of removed exports. I have to augment filters for timestamp field, caveat is that the controller can not be overridden by passing "ui.views" param. You have to write full custom field for this purpose. Now I ave to copy whole set of files from keystone just for common filters. Also the custom Fields should be able to make use of default filter in most cases. Should there be way to override controller when setting "ui.views" by having "controller" exports? |
@gautamsi we are sympathetic to trying to make this experience less tedious, for ourselves and the community. Before we made this change, we found that while reviewing the ecosystem, and our own examples, that We know that removing the If you had any specific examples where writing these filters is particular painful in updating your packages, please report your experience! We can then work together in improving the DX for everyone.
This is a good question, I'll bring this up with the team next week.
I think the point should be that filters should be easier to write, but not necessarily "defaulted" or "copied". |
My understanding at the moment is that writing custom fields, is painful, confusing, error prone, and now, verbose. I want to introduce new functions (in a non-breaking way) that make writing custom fields easier and understandable. |
thanks @dcousens for the quick answer. I have opened a pull request which may fix this if it was a bug. I am able to use this with hopefully we will have simpler story for extending field with filters. If the PR goes through as patch soon I do not have to worry about the filters. I usually extend existing fields and that does not require writing full set of code for custom field while preserving all the core functionality. |
The
filters
export isn't documented or well designed for public consumption, so we're making it private, custom field types can define filters themselves like https://github.com/keystonejs/keystone/blob/main/examples/custom-field/3-pair-field/index.ts