-
-
Notifications
You must be signed in to change notification settings - Fork 600
Augmented classes always return Value instances #5302
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jasonvarga
added a commit
to statamic/docs
that referenced
this pull request
Feb 17, 2022
jackmcdade
added a commit
to statamic/docs
that referenced
this pull request
Mar 15, 2022
* New Antlers docs (#692) Co-authored-by: Jason Varga <jason@pixelfear.com> * Update blade doc with new `Statamic::tag()` and `Statamic::modify()` usage. (#702) * Frontend form field conditions (#691) * Document conditional fields in front-end forms. * JS. * Finish documenting custom JS drivers. * Suggest more real-world example gist, as well as a link to our built-in Alpine driver. * Tweak the intro Co-authored-by: Jack McDade <jack@jackmcdade.com> * Link to the new parser docs * Mention alternate closing tags * Refactor JSON encoding for form attributes in JS drivers (#723) * fix mobile header overflow issue. Closes #725 * Document newest PHP delimiter * Show the new new site site in the quick start guide * Delete installed.png * initial 3.3 upgrade guide * Blade variables as per statamic/cms#5201 * fix a few code examples * change per statamic/cms#5302 * Improve docs on getting data out of entries * reword * avoid the slash so the example isn't highlighted as a regex. its just an example. * wip * Rely on the automatic TOC * Update fluent tag docs with param setters (#739) * zero impact 3.3 changes * fetch and pagination example * property access * explain void * form submission data change * live preview * live preview * Remove live preview extending page - it's all covered in the regular one * at symbol can escape braces in strings and params * Laravel 8 * explain date field change * Add date where clauses * laravel upgrade guide * Tweak the L7-L8 upgrade guide * A few more tweaks * fix tpyo * enh? * Improve Blade docs * Remove caveats. * Routes and Controller examples for Blade * A little more detail up front Co-authored-by: Jason Varga <jason@pixelfear.com> Co-authored-by: Jesse Leite <jesseleite@gmail.com>
superstar1205
added a commit
to superstar1205/lc
that referenced
this pull request
Aug 21, 2022
* New Antlers docs (#692) Co-authored-by: Jason Varga <jason@pixelfear.com> * Update blade doc with new `Statamic::tag()` and `Statamic::modify()` usage. (#702) * Frontend form field conditions (#691) * Document conditional fields in front-end forms. * JS. * Finish documenting custom JS drivers. * Suggest more real-world example gist, as well as a link to our built-in Alpine driver. * Tweak the intro Co-authored-by: Jack McDade <jack@jackmcdade.com> * Link to the new parser docs * Mention alternate closing tags * Refactor JSON encoding for form attributes in JS drivers (#723) * fix mobile header overflow issue. Closes #725 * Document newest PHP delimiter * Show the new new site site in the quick start guide * Delete installed.png * initial 3.3 upgrade guide * Blade variables as per statamic/cms#5201 * fix a few code examples * change per statamic/cms#5302 * Improve docs on getting data out of entries * reword * avoid the slash so the example isn't highlighted as a regex. its just an example. * wip * Rely on the automatic TOC * Update fluent tag docs with param setters (#739) * zero impact 3.3 changes * fetch and pagination example * property access * explain void * form submission data change * live preview * live preview * Remove live preview extending page - it's all covered in the regular one * at symbol can escape braces in strings and params * Laravel 8 * explain date field change * Add date where clauses * laravel upgrade guide * Tweak the L7-L8 upgrade guide * A few more tweaks * fix tpyo * enh? * Improve Blade docs * Remove caveats. * Routes and Controller examples for Blade * A little more detail up front Co-authored-by: Jason Varga <jason@pixelfear.com> Co-authored-by: Jesse Leite <jesseleite@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another developer UX PR.
Currently when call augmentation methods, you'll get
Valueinstances if the field exists in the blueprint. Otherwise you'd just get the raw value. That made it frustrating since you'd have to do a bunch ofinstanceof Valuechecks afterwards.In this PR, you can now always expect
Valueinstances.Before
Previously you'd have to do a bunch of instanceof checks for something like this:
After
Now you can assume there will always be a
Value.Breaking change
This is technically a breaking change.
If you were explicitly coding something expecting a non-
Value, it will now be aValue.For example, the entry's
publishedvalue was just a boolean.Now:
A suggested adjustment is to avoid using these methods completely, and use the new magic properties from #5297.