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
Refactor JDocument so it can be autoloaded #8905
Conversation
{ | ||
/** | ||
* @var JDocumentJSON | ||
\ */ |
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.
oops
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.
It's a removed line. So all good now :)
👍 for adding support for |
I have tested this item ✅ successfully on aa7c947 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8905. |
@izharaazmi something like that won't be part of this PR. As long as people are extending the right classes (which we have checks for) then it's down to them to provide an implementation. In the future we could investigate some sort of interface. But it's likely going to be something JDocumentRenderer already supports anyhow |
Yeah, I understand that that can't be part of this PR. I was asking for the additional prospects. I think we can provide a full fledged structured rendering similar to that of html renderers, like response code, messages, body, redirects, callbacks, etc or whatever we can figure out when into it. This can give us a well defined format for Joomla based JSON APIs as well. Same can be done for XML rendering for XML APIs. I understand that this is not the part of Joomla project scope right now. But I wonder, what if? Btw, |
Exactly. There's definitely a lot of work to do with |
JDocument and its subclasses aren't a proper request/response structure, nor even responsible for building the response. It is at best a page rendering system; all of the response data is handled as part of the JApplicationWeb API. JDocument does have a couple of calls into the application to set some response data based on the format, but that's the extent of what it's capable of at the moment. |
I have tested this item ✅ successfully on aa7c947 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8905. |
Refactor JDocument so it can be autoloaded
To test ensure that Joomla itself functions the same (just try a couple of pages). The error page works and any custom formats you might have (e.g. the VCF view for com_contact etc).
There should be no changes before and after the patch, however in the future you can now autoload properly in JDocument. Having things like the renderers now running autoloading is going to be important in the future for introduction of alternate output formats.