-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DOC EmbeddedRecordsMixin] Assert from JSONAPISerializer #7167
[DOC EmbeddedRecordsMixin] Assert from JSONAPISerializer #7167
Conversation
'The JSONAPISerializer does not work with the EmbeddedRecordsMixin because the JSON API spec does not describe how to format embedded resources.', | ||
!props.isEmbeddedRecordsMixin, | ||
!props.isEmbeddedRecordsMixin || props.isEmbeddedRecordsMixinCompatible === true, |
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.
Probably want a test for allowing this
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.
yep, also mention the opt-in flag in the assertion message
'The JSONAPISerializer does not work with the EmbeddedRecordsMixin because the JSON API spec does not describe how to format embedded resources.', | ||
!props.isEmbeddedRecordsMixin, | ||
!props.isEmbeddedRecordsMixin || props.isEmbeddedRecordsMixinCompatible === true, |
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.
yep, also mention the opt-in flag in the assertion message
thanks for taking a look at this @allthesignals! |
Alright, I just put it into init. Not sure if there's a problem with that approach. |
5cdb116
to
318c410
Compare
@runspired do we expect the IE11 asset size check to be this sensitive? it's complaining about a 50B (not Kb) increase. |
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.
LGTM assuming tests 🍏
Oh, interesting — the assertion does get stripped out but leaves the empty
And it's exactly 50 bytes. Edit: Oh. I can just put it inside that |
Use of EmbeddedRecordsMixin and JSONAPISerializer together asserts instead of warns. Allows for setting "isEmbeddedRecordsMixinCompatible" on the serializer for when parts of the API are compatible.
318c410
to
7b01137
Compare
thanks @allthesignals! |
@hjdivad we do expect it to be that sensitive. The idea is that any regression is one we are acutely aware of, vs allowing lots of tiny drift to be added over time unnoticed. |
Use of EmbeddedRecordsMixin and JSONAPISerializer together asserts instead of warns. Allows for setting "isEmbeddedRecordsMixinCompatible" on the serializer for when parts of the API are compatible.
Closes #6991