-
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
Refactoring SchemaCollection to allow any kind of schema + internal code simplification #81
Refactoring SchemaCollection to allow any kind of schema + internal code simplification #81
Conversation
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.
Thank you for the extensive work on it! Think it will be a great addition and super-useful. I went through the PR and left some comments with some things I noticed 👍
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.
Thanks @ralphjsmit for your feedback, I answered all the comments I guess and I'm going the push new code regarding the deprecated methods
I managed to refactor |
Thank you for the changes! Looking really good on first glance, I needed to get used to the the |
Hey @ralphjsmit did you get a chance to look at it ? |
Sorry, not yet, likely next week. |
a4a3f51
to
e73fe3c
Compare
be8eae9
to
e1ace45
Compare
Hi Quentin! Thanks for your patience, I came back to the PR today and reviewed it. In the end I decided to keep the fluent methods for article, breadcrumb list and faq page, because I think having these as options for fluent classes is valuable for developers as well, because it provides them with auto-completed fluent methods for the most common things to change, without having to remember the exact keys and format needed for these. I did refactor these 3 fluent classes to extend the I just released it in 1.6.0, together with the alternate tag PR. Thanks for providing the PR to make it easier to add custom schemas! :) |
@ralphjsmit Great! thank you very much 🙏 |
Hi,
The main purpose of this PR is to allow any kind of schema to be defined within
SchemaCollection
. Along the way, I also simplified some internal logic to simplify the code.This PR does not introduce any breaking changes!
The new recommended and documented way to add schema is now as follows:
Additionally, this PR comes with 2 presets that replace
addArticle
andaddBreadcrumbs
.Here's an example using
withArticle
:I admit that this new way of modifying preconfigured schema is not entirely ideal. It could be greatly improved by defining new classes that extend
Collection
and support methods similar to the currentArticle
.However, considering the complexity of supporting every schema key in a fluent way, I'm not entirely convinced it's necessary at this time.