2021-10-24, 09:13 AM
@Devilshakerz,
I like your macro idea. As you say, the main challenge is developing a reliable instruction and API set. I wonder whether there's an existing PHP library for this that has been well-tested. I'd kind of expect that there is. A little googling didn't turn one up, but it's hard to know what the right keywords are.
The macro-based functionality you describe seems pretty useful, although - I think we agree - beyond the scope of the initial release.
Re storage of theme-related data in the filesystem versus the DB, you seem to envisage a hybrid approach, which I hadn't expected. I had been under the impression that everything theme-related would be stored in the filesystem alone, and I was comfortable with that. Is it really necessary/preferable to store anything theme-related in the DB?
Re storage of macros, perhaps they could simply be stored under inc/themes/macros.
Agreed that increased reliance on identifiers in the filesystem and manifests makes it more important to keep them unique.
Re composer.json: oh, I hadn't realised that that's what you meant by a theme's manifest file. In that case, yes, I do think it's worth having a separate theme JSON file with its own custom schema including theme properties/metadata. This is where I had understood all theme-related data would be stored, eliminating the need for storage in the DB.
Re the current 1.9 CSS being generated using SCSS: thanks, I hadn't been aware of that or had forgotten. I imagine that the answer is "No, it can be deferred", but just to confirm: do you think the MVP for our initial 1.9 release requires MyBB to handle pre-processing, or can we defer that to later?
Probably, but it should probably be accompanied by a strong "Only if you know what you are doing" warning.
Probably, yes.
Upon upload of a new version of a theme (including the core them during an upgrade) or resource-generating plugin, the admin should probably be given, during the upgrade/install procedure, the choice of automatic (except where manual conflict resolution is required) or manual update of board themes per modification instructions. Presumably, admins would generally choose the automatic option.
Do you mean so that they can be rolled back if necessary? This might be a good idea, but maybe deferred to a later release?
I'm not quite sure what you mean by Resources in 1.8.x format, but maybe, per frostschultz and Omar's suggestions, we should drop 1.8 support from the very start? Make a clean break?
That might be a consideration too, yes, but I was thinking more of practical problems given the new concept of a board theme which is mutable whereas original themes are immutable, except when being updated with a developer-supplied new version. When such an update is applied, and multiple original themes form an inheritance chain, tricky questions like this arise: what if the original theme is higher up on the chain, and a change to it made by the developer conflicts with a child original theme (which isn't simultaneously being updated) - does that change propagate through to (a) the child original theme (here, the answer seems to be: "No, because original themes are immutable"), and (b) the (mutable) board theme(s) at the bottom of the inheritance chain (here, the answer seems to be: "Only if, after the system flags a conflict that needs to be resolved by the admin, the admin resolves that conflict")?
And what if the admin resolves the conflict in favour of the new version of the parent original theme, such that the change gets incorporated into the board theme at the bottom of the chain, but, upon later updating the child theme, a change is made to the same area of the same resource - does *that* change get propagated to the board theme, or does another conflict get raised with the admin?
It just seems to me that allowing for these sort of inheritance chains for original themes leads to unnecessary complications in respect of these sort of questions. It seems to me that more sensible is for original theme developers to manually incorporate any changes from other original themes on which their theme is based, and then to release the complete new version of the theme to end-users, which avoids the need for admins to resolve such potential conflicts.
Board admins can then tinker with spawning child board themes of board themes to any degree of inheritance without any of these sort of conflicts arising.
My idea is: yes. Changes to the core theme always propagate to board themes, bypassing original themes.
Yes, I realised in writing up my summary that I don't think that this part of the diagram makes total sense: original themes are immutable, so core changes *can't* propagate to them (except via a new version supplied by the theme developer) - but core changes *should* propagate to board themes, which *are* mutable: without core changes propagating to board themes, board functionality dependent on those changes might fail.
I need to clarify though that when I talk about changes propagating, I'm referring to the case in which a copy-on-write resource *has* been written, i.e., the resource exists in the child, and is not being pulled in from the parent.
This clarification also applies to my above considerations re original themes inheriting from other original themes.
Sure, that was an omission on my part.
I'm not familiar with CSS pre-compilers, so I defer to you on the first part of that question. On the parenthetical part, yes, that seems sensible.
Yes, exactly.
What would you suggest instead/additionally then? Setting file/directory permissions to disallow writing?
My idea was to store the core theme just like an original theme, under inc/themes/immutable/core.
Likewise: stored in the same subdirectories under inc/themes/immutable/core as for any original theme.
Yes, exactly.
Yes. Just as for themes.
I'm comfortable with acceding to your apparent preference for the plugins directory rather than the themes directory.
Am also comfortable with your idea of
I'm not quite sure what you mean by this (especially the being tied to a specific version part) and how you see it working - can you please elaborate?
Yes, there are lots of exciting possibilities for plugin manifest files, but, I do think they're out of scope for at least the first release of 1.9.
Yes.
Re your preference for uploading unzipped and not zipped files, that's OK with me - that idea of mine was only to help with versioning. My understanding was that the current version of a theme or plugin's theme-related files would always reside in the "current" directory. Its directory name would not be explicitly versioned, though its version could be pulled out of its manifest/properties file. Updating the theme or plugin's theme-related files then would entail moving the "current" directory to the "<version>" directory where <version> is pulled out of the manifest/properties file, and replacing it with the new "current" directory.
The sort of possibility I suggested above might work then: under the MyBB root is a "staging" directory. An unzipped plugin/theme is uploaded to that directory, and the ACP picks up on the new/updated plugin/theme staging directory, and, if it is an update, automatically moves the "current" directory to the "<version>" directory for the existing install location for that plugin/theme, and then moves the plugin/theme files to their appropriate locations, overwriting any existing files.
Good idea.
I like your macro idea. As you say, the main challenge is developing a reliable instruction and API set. I wonder whether there's an existing PHP library for this that has been well-tested. I'd kind of expect that there is. A little googling didn't turn one up, but it's hard to know what the right keywords are.
The macro-based functionality you describe seems pretty useful, although - I think we agree - beyond the scope of the initial release.
Re storage of theme-related data in the filesystem versus the DB, you seem to envisage a hybrid approach, which I hadn't expected. I had been under the impression that everything theme-related would be stored in the filesystem alone, and I was comfortable with that. Is it really necessary/preferable to store anything theme-related in the DB?
Re storage of macros, perhaps they could simply be stored under inc/themes/macros.
Agreed that increased reliance on identifiers in the filesystem and manifests makes it more important to keep them unique.
Re composer.json: oh, I hadn't realised that that's what you meant by a theme's manifest file. In that case, yes, I do think it's worth having a separate theme JSON file with its own custom schema including theme properties/metadata. This is where I had understood all theme-related data would be stored, eliminating the need for storage in the DB.
Re the current 1.9 CSS being generated using SCSS: thanks, I hadn't been aware of that or had forgotten. I imagine that the answer is "No, it can be deferred", but just to confirm: do you think the MVP for our initial 1.9 release requires MyBB to handle pre-processing, or can we defer that to later?
(2021-10-24, 12:52 AM)Devilshakerz Wrote:Quote: 8. What system could be implemented for applying theme updates?
A: The same sort of system as for applying core theme updates: the conceptual generation of a patch which MyBB attempts to auto-apply to associated board themes, and to board themes which inherit from those board themes (see below re inheritance and association), etc, with UI-assisted conflict resolution as necessary.
The database information will likely include a reference to a version of the theme (pointing to a specificinc/themes/theme-name/*
version directory).
Should the system expose an option to change this version?
Probably, but it should probably be accompanied by a strong "Only if you know what you are doing" warning.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Should the parent theme information include a version number that, unless bumped, will cause the child theme to continue to inherit from the old version (but issue "attention needed" warnings)?
Probably, yes.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Should changes in parent themes, and in plugins' modification instructions, be propagated silently or manually (following "attention needed" warnings, with possible edit suggestions)?
Upon upload of a new version of a theme (including the core them during an upgrade) or resource-generating plugin, the admin should probably be given, during the upgrade/install procedure, the choice of automatic (except where manual conflict resolution is required) or manual update of board themes per modification instructions. Presumably, admins would generally choose the automatic option.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Should changes to Board themes, which are not versioned, be logged (e.g. in diff format), especially given the automation involved?
Do you mean so that they can be rolled back if necessary? This might be a good idea, but maybe deferred to a later release?
(2021-10-24, 12:52 AM)Devilshakerz Wrote: The MVP, however, would be one where theme interactions are no worse than in 1.8, so we'd need functions for:
- adding custom Resources in 1.8.x format, but attached to 1.9.x themes (PluginLibrary-like, may need modifications)
- adding custom Resources in 1.9.x format
- adding stylesheets and modifying properties in 1.9.x format
I'm not quite sure what you mean by Resources in 1.8.x format, but maybe, per frostschultz and Omar's suggestions, we should drop 1.8 support from the very start? Make a clean break?
(2021-10-24, 12:52 AM)Devilshakerz Wrote:Quote: 4. That re inheritance and association, we stipulate that inheritance applies only to board themes: only a board them can inherit, and only from another board theme. A board theme may alternatively (one or the other must be the case), though, be irrevocably *associated* with the (immutable) original or core theme of which it is a (mutable) copy, meaning that updates to that original/core theme are auto-applied to all associated board themes (and to those board themes which inherit from those board themes, etc). The metadata for an *original* theme may, though, additionally, indicate (for purely informative purposes) that it is "based on" or "inspired by" some other original theme - an original theme which need not be installed, and changes to which do not affect the inspired original theme in the local installation, whereas original themes which are inherited from or associated with board themes *do* need to be installed, and attempting to uninstall such a theme results in an error.
Does that limitation come from expected practical problems with exporting and importing themes (which would necessitate moving packages of multiple themes at once, when they form an enforced inheritance chain)?
That might be a consideration too, yes, but I was thinking more of practical problems given the new concept of a board theme which is mutable whereas original themes are immutable, except when being updated with a developer-supplied new version. When such an update is applied, and multiple original themes form an inheritance chain, tricky questions like this arise: what if the original theme is higher up on the chain, and a change to it made by the developer conflicts with a child original theme (which isn't simultaneously being updated) - does that change propagate through to (a) the child original theme (here, the answer seems to be: "No, because original themes are immutable"), and (b) the (mutable) board theme(s) at the bottom of the inheritance chain (here, the answer seems to be: "Only if, after the system flags a conflict that needs to be resolved by the admin, the admin resolves that conflict")?
And what if the admin resolves the conflict in favour of the new version of the parent original theme, such that the change gets incorporated into the board theme at the bottom of the chain, but, upon later updating the child theme, a change is made to the same area of the same resource - does *that* change get propagated to the board theme, or does another conflict get raised with the admin?
It just seems to me that allowing for these sort of inheritance chains for original themes leads to unnecessary complications in respect of these sort of questions. It seems to me that more sensible is for original theme developers to manually incorporate any changes from other original themes on which their theme is based, and then to release the complete new version of the theme to end-users, which avoids the need for admins to resolve such potential conflicts.
Board admins can then tinker with spawning child board themes of board themes to any degree of inheritance without any of these sort of conflicts arising.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: In this scenario, do all themes continue to inherit from the Core theme (so Core changes result in "attention needed" warnings, even if an Original theme is the closest parent)?
My idea is: yes. Changes to the core theme always propagate to board themes, bypassing original themes.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: In the latest diagram, an Original theme would inherit either from another Original theme or the Core theme, and the inheritance chain would be composed of optional, but uninterrupted series of Board and Original themes, up to the Core theme.
Yes, I realised in writing up my summary that I don't think that this part of the diagram makes total sense: original themes are immutable, so core changes *can't* propagate to them (except via a new version supplied by the theme developer) - but core changes *should* propagate to board themes, which *are* mutable: without core changes propagating to board themes, board functionality dependent on those changes might fail.
I need to clarify though that when I talk about changes propagating, I'm referring to the case in which a copy-on-write resource *has* been written, i.e., the resource exists in the child, and is not being pulled in from the parent.
This clarification also applies to my above considerations re original themes inheriting from other original themes.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Are parent directories going to be supported for CSS files?
Sure, that was an omission on my part.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: If SCSS is supported, should these source files be placed in e.g.css/_scss
(and all subdirectories, or those beginning with_
, would be ignored when copying resources to publicly available locations)?
I'm not familiar with CSS pre-compilers, so I defer to you on the first part of that question. On the parenthetical part, yes, that seems sensible.
(2021-10-24, 12:52 AM)Devilshakerz Wrote:Quote: Each of these theme directories is placed within either:
-> inc/themes/immutable [for the core theme and original themes]
or
-> inc/themes/mutable [for board themes]
Are separate directories only intended to hint to users which files should (not) be modified?
Yes, exactly.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: It may be insufficient as long as we can't include a more detailed warning ("visit the ACP to modify your themes").
What would you suggest instead/additionally then? Setting file/directory permissions to disallow writing?
(2021-10-24, 12:52 AM)Devilshakerz Wrote: If merged, should the core theme be stored separately (currently inc/views
), or also merged for internal clarity?
My idea was to store the core theme just like an original theme, under inc/themes/immutable/core.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: What about Core theme's resources other than templates (currently not present)?
Likewise: stored in the same subdirectories under inc/themes/immutable/core as for any original theme.
(2021-10-24, 12:52 AM)Devilshakerz Wrote:Quote: In addition, plugins supply their resources per 1.1 in the "Existing ideas" list above in a structure identical to the theme structure described above, the only difference being that they are placed under:
-> inc/themes/immutable/ext-<plugin-codename>
but still contain a "current" subdirectory as well as any applicable historical "<version>" subdirectories.
In the diagram's terms, is each active plugin'sext-*
directory a set of New resources, making the collection of all of them an Inheritance base when combined with the Core theme, forming the root of the inheritance chain?
Yes, exactly.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Should New resources be saved as physical files
Yes. Just as for themes.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Should they be saved in the directory for themes, rather than plugins?
I'm comfortable with acceding to your apparent preference for the plugins directory rather than the themes directory.
Am also comfortable with your idea of
extend.php
files.(2021-10-24, 12:52 AM)Devilshakerz Wrote: This structure would be processed by the extensions system. Note the modification instructions are always tied to a specific theme version (and the most recent version would be used to install the modifications), and plugins can be distributed with just the most recent versions of these instructions (so overwriting plugin files would preserve instructions for previous versions).
I'm not quite sure what you mean by this (especially the being tied to a specific version part) and how you see it working - can you please elaborate?
(2021-10-24, 12:52 AM)Devilshakerz Wrote: Themanifest.json
could be used as an optional alternative toinc/plugins/*.php
files and*_info()
array manifest functions, but major plugin system changes unrelated to the theme system are probably out of scope for 1.9.
Yes, there are lots of exciting possibilities for plugin manifest files, but, I do think they're out of scope for at least the first release of 1.9.
(2021-10-24, 12:52 AM)Devilshakerz Wrote:Quote: 7. Given that plugins will be supplying theme directories (in inc/themes/immutable/ext-<plugin-codename>) which we do not want to be simply copied over (since we do not want to overwrite the "current" subdirectory without first archiving it in a <version> subdirectory), the initial 1.9 release is a good occasion on which to introduce semi-automated plugin installation: rather than FTPing an unzipped plugin directory structure directly to the board's root directory and then installing it via the ACP's Plugins page, the ZIP archive itself would be uploaded via the ACP's Plugins page. In addition, although consisting in an ordinary ZIP file, the extension for MyBB plugin archives would be changed from .zip (to something perhaps like .mbt?), so as to avoid tempting members into unzipping them and uploading them as-is, thus mistakenly overwriting the plugin's "current" theme directory.
A fall-back for admins using servers without PHP's Zip extension would be to rename the file so that it has a .zip extension, then upload the unzipped contents to some sort of staging directory checked by the ACP's Plugins page - perhaps simply a subdirectory under the board's root named "plugin_staging".
Does that also apply to theme updates?
Yes.
Re your preference for uploading unzipped and not zipped files, that's OK with me - that idea of mine was only to help with versioning. My understanding was that the current version of a theme or plugin's theme-related files would always reside in the "current" directory. Its directory name would not be explicitly versioned, though its version could be pulled out of its manifest/properties file. Updating the theme or plugin's theme-related files then would entail moving the "current" directory to the "<version>" directory where <version> is pulled out of the manifest/properties file, and replacing it with the new "current" directory.
The sort of possibility I suggested above might work then: under the MyBB root is a "staging" directory. An unzipped plugin/theme is uploaded to that directory, and the ACP picks up on the new/updated plugin/theme staging directory, and, if it is an update, automatically moves the "current" directory to the "<version>" directory for the existing install location for that plugin/theme, and then moves the plugin/theme files to their appropriate locations, overwriting any existing files.
(2021-10-24, 12:52 AM)Devilshakerz Wrote: eventually we can maintain a Markdown Blog draft as a main architecture outline - may help whether it gets published or not
Good idea.