2021-03-29, 07:15 AM
(This post was last modified: 2021-04-25, 09:41 PM by Laird. Edited 2 times in total.
Edit Reason: Correct typos / grammatical errors
)
[Originally posted in a team-only private forum; moved to this public forum at Devilshakerz's suggestion]
Hi all,
As I wrote in my application to join the team, my highest priority, which I believe mirrors that of our users, is a default responsive theme, which means prioritising the release of 1.9. My analysis and recommendations in this respect after some thought follow.
Development discussions are, of course, better had publicly and transparently, however, given that the release of 1.9 has become a sensitive issue, with some in the community angry about its delay, I am posting this thread privately to start with. I will repost it publicly (edited if necessary) if the consensus here is that that's appropriate.
As a new and relatively uninformed team member, this all might come across as unjustifiably assertive, perhaps even presumptuous or arrogant. If so, please forgive me: my intention is simply to forge the best (immediate) path forward for our project. Where I get it wrong, especially due to ignorance or error, I hope that you will correct me. Where I overstep the bounds of my role, I hope that you will let me know.
That said, here is what I've come up with.
In summary, my recommendations for the initial 1.9 release are for:
Looking a little more closely into the current Find Updated Templates diff functionality, as Devilshakerz's comments suggest it is fruitful to do, I have an observation which might turn out to be false (and if you know it to be false, then please say so), but which right now seems to me to be true:
Because the diff is only two-way, and doesn't have access to nor take into account the prior Master template upon which the admin based their custom template, the explanation at the top of the diff report is not always accurate, that explanation being (colours not identical):
It seems to me that if the new Master template deletes content present in the prior Master template, this will be shown in light red, for the admin to interpret as a "customization" that they had made to that prior template, which it is not, and which they had not.
It seems to me that this confusion can best be resolved by running a three-way (or at least a dual) diff, which does take into account the contents of the prior Master template from which the admin had generated their custom template. This, in turn, means storing that prior Master template and its relationship with the customised template. This would presumably be done automatically when the admin first saves an edited version of the (then-current) Master template.
This would allow us to extend Devilshakerz's idea a little: we could auto-generate a "patch" between the version of the Master template which the admin had customised, and the new version of the Master template, and then attempt to auto-apply that "patch". If there were no conflicts with the customisations made by the admin, then we could simply auto-apply the patch and avoid the need for the template to even show up in "Find Updated Templates" at all (perhaps, for safety, this would be configurable, as in a yes/no setting somewhere in the ACP something like "Attempt to auto-apply core updates to customised templates where possible?"). Again, this depends on the prior Master template being stored and related to the customised template.
I emphasise that final point because I think that it is of concern given the current goal of user-editable filesystem-based templates. In general, the problem is this: certain features such as the one I've just canvassed require that metadata is automatically generated and then associated with a customised template when that template is saved, however, it is impossible to automatically generate that metadata, let alone automatically store it against that template, when edits to templates are permitted via the filesystem. Too, in a filesystem-based approach, the best place to store that metadata might well be in the same file as the (user-editable) template, however, this would mix user-editable data with auto-generated data, which in my opinion is bad practice with meaningful potential for error.
Regarding inheritance, I agree with Wildcard in that issue's comments that the current system works well and seems to be optimal. Again, though, I have concerns about the implementation of inheritance given user-editable filesystem-based templates. In particular: how is inheritance to be implemented in files? If a user-editable filesystem template inherits from the Master template, then what does this look like in the filesystem? If it is implemented via an empty template file, then this confounds the user's editing experience, since the user then has to locate the Master template and manually copy its contents in on first edit. On the other hand, if it is implemented by a template file with contents identical to the Master template, then an inheriting template cannot be distinguished from one which does not inherit but happens to have the same contents as the Master template anyway. Neither of these options seem to me to be viable, and I can't see an alternative, viable option. If anybody else can, then please say so.
For these two reasons (and there might be others that I've overlooked), I think that filesystem-based templates, especially when user-editable independently of the MyBB UI, are not a good idea, and should be abandoned. If ease of editing is our goal, then incorporating into core Shade's FASTyle plugin, as suggested in the comments of issue #3686, Allow editing of Twig templates from the ACP, is a better idea. However, as this is a backwards-compatible change, my recommendation is that it be deferred beyond the initial 1.9 release.
I end this missive then with a fourth and final recommendation:
I encourage others to suggest their own such features ASAP so that we can plan for them, and implement the necessary infrastructure for them in, and then roll out ASAP, MyBB 1.9 with a default responsive theme.
In the hope of the speediest possible release of 1.9,
Cheers, guys.
Hi all,
As I wrote in my application to join the team, my highest priority, which I believe mirrors that of our users, is a default responsive theme, which means prioritising the release of 1.9. My analysis and recommendations in this respect after some thought follow.
Development discussions are, of course, better had publicly and transparently, however, given that the release of 1.9 has become a sensitive issue, with some in the community angry about its delay, I am posting this thread privately to start with. I will repost it publicly (edited if necessary) if the consensus here is that that's appropriate.
As a new and relatively uninformed team member, this all might come across as unjustifiably assertive, perhaps even presumptuous or arrogant. If so, please forgive me: my intention is simply to forge the best (immediate) path forward for our project. Where I get it wrong, especially due to ignorance or error, I hope that you will correct me. Where I overstep the bounds of my role, I hope that you will let me know.
That said, here is what I've come up with.
In summary, my recommendations for the initial 1.9 release are for:
- 1.8.27 to be the last release prior to 1.9, and for the list of PRs planned to be merged prior to 1.8.27 to be ASAP (a) minimised and (b) frozen, and, thereafter, for all remaining PRs to be deferred to the 1.9 branch (with conflicts resolved as necessary) - but for even those PRs deferred to the 1.9 branch to not necessarily be applied prior to its initial release, the timeliness of which should be prioritised above the merging of (non-critical) PRs.
- All non-critical unimplemented changes for 1.9 other than to the template system to be deferred to a later release.
- Changes to the template system for 1.9 anyway to be minimised, except for backwards-incompatible changes, which should be kept to the bare minimum necessary to avoid future backwards-incompatible changes given the functionality we ultimately plan to, or will potentially, implement.
- I love Euan's idea of a JS manager similar to the stylesheet manager, also with support for the stipulation of dependencies. Although it is perhaps debatable as to whether or not this should be considered a non-backwards-compatible change that ought to be included in the initial 1.9 release, my view is that it is not, since we wouldn't be able to force plugin developers to use it anyway; the approach of inserting JS files into templates would always be available to them regardless. Thus, I do not think that we should aim to include it in the initial 1.9 release.
- I also love Devilshakerz's idea of enhancing Find Updated Templates so as to provide 'a comparison of what's changed in [a] specific upgrade in the master set; these "diffs" would be easier to recognize than master-custom comparison (as unrelated modifications are caught up in the report), along with a suitable UI (perhaps the diff - "suggested changes"/"copy these" - and an editor side-by-side).'
Looking a little more closely into the current Find Updated Templates diff functionality, as Devilshakerz's comments suggest it is fruitful to do, I have an observation which might turn out to be false (and if you know it to be false, then please say so), but which right now seems to me to be true:
Because the diff is only two-way, and doesn't have access to nor take into account the prior Master template upon which the admin based their custom template, the explanation at the top of the diff report is not always accurate, that explanation being (colours not identical):
Quote:Changes that have been made between your previous version and this one are highlighted like this.
Any customizations you've made to your templates (the old ones) are highlighted like this.
It seems to me that if the new Master template deletes content present in the prior Master template, this will be shown in light red, for the admin to interpret as a "customization" that they had made to that prior template, which it is not, and which they had not.
It seems to me that this confusion can best be resolved by running a three-way (or at least a dual) diff, which does take into account the contents of the prior Master template from which the admin had generated their custom template. This, in turn, means storing that prior Master template and its relationship with the customised template. This would presumably be done automatically when the admin first saves an edited version of the (then-current) Master template.
This would allow us to extend Devilshakerz's idea a little: we could auto-generate a "patch" between the version of the Master template which the admin had customised, and the new version of the Master template, and then attempt to auto-apply that "patch". If there were no conflicts with the customisations made by the admin, then we could simply auto-apply the patch and avoid the need for the template to even show up in "Find Updated Templates" at all (perhaps, for safety, this would be configurable, as in a yes/no setting somewhere in the ACP something like "Attempt to auto-apply core updates to customised templates where possible?"). Again, this depends on the prior Master template being stored and related to the customised template.
I emphasise that final point because I think that it is of concern given the current goal of user-editable filesystem-based templates. In general, the problem is this: certain features such as the one I've just canvassed require that metadata is automatically generated and then associated with a customised template when that template is saved, however, it is impossible to automatically generate that metadata, let alone automatically store it against that template, when edits to templates are permitted via the filesystem. Too, in a filesystem-based approach, the best place to store that metadata might well be in the same file as the (user-editable) template, however, this would mix user-editable data with auto-generated data, which in my opinion is bad practice with meaningful potential for error.
Regarding inheritance, I agree with Wildcard in that issue's comments that the current system works well and seems to be optimal. Again, though, I have concerns about the implementation of inheritance given user-editable filesystem-based templates. In particular: how is inheritance to be implemented in files? If a user-editable filesystem template inherits from the Master template, then what does this look like in the filesystem? If it is implemented via an empty template file, then this confounds the user's editing experience, since the user then has to locate the Master template and manually copy its contents in on first edit. On the other hand, if it is implemented by a template file with contents identical to the Master template, then an inheriting template cannot be distinguished from one which does not inherit but happens to have the same contents as the Master template anyway. Neither of these options seem to me to be viable, and I can't see an alternative, viable option. If anybody else can, then please say so.
For these two reasons (and there might be others that I've overlooked), I think that filesystem-based templates, especially when user-editable independently of the MyBB UI, are not a good idea, and should be abandoned. If ease of editing is our goal, then incorporating into core Shade's FASTyle plugin, as suggested in the comments of issue #3686, Allow editing of Twig templates from the ACP, is a better idea. However, as this is a backwards-compatible change, my recommendation is that it be deferred beyond the initial 1.9 release.
I end this missive then with a fourth and final recommendation:
- That minimal changes be made to the templating system for the initial 1.9 release: Twig templates can and should be distributed, stored, and edited in the same way as templates for 1.8 - including by plugins via the
find_replace_templatesets()
function - except where this conflicts with a planned future feature which would otherwise be backwards-incompatible.
I encourage others to suggest their own such features ASAP so that we can plan for them, and implement the necessary infrastructure for them in, and then roll out ASAP, MyBB 1.9 with a default responsive theme.
In the hope of the speediest possible release of 1.9,
Cheers, guys.