Deprecation of base and canvas

Deprecation of base and canvas

by Andrew Lyons -
Number of replies: 7
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi all,

The Clean theme has been available in Moodle since Moodle 2.5, and has been the default theme since Moodle 2.7.

Since that time, many plugins have been converted to use the bootstrapbase core theme and the dependence upon the older base and canvas themes has significantly reduced. Of the plugins marked as being compatible with Moodle 2.9, none currently use either the base, or the canvas themes.

Although it appears low maintenance to keep an unused base theme in core, the costs are surprisingly high on many fronts:

  1. any new feature must come with the CSS for both the bootstrapbase, and the base themes. This can complicate the development, especially since there is no `less` support for the base theme. This also applies to modifications of existing functionality. As such, the base theme may become an obstacle to developer contributions;
  2. any changes to the base theme must then be developed, peer reviewed, integration reviewed, and tested on the base theme. This adds significant time to the entire process and means that developers have less time to focus on issues affecting the wider community.

As such, I have proposed that both the base, and canvas themes be deprecated from Moodle 3.0 onwards, and that they be marked for removal in Moodle 3.2. By the time that the themes are deprecated, the bootstrap themes will have been available for over 2.5 years. Following removal, they will be placed into the Plugins repository but no longer maintained by HQ.

This timeframe is inline with our standard deprecation policies.

I've raised this proposal in MDL-51144. If you have any constructive feedback on why the base and canvas themes should not be deprecated, or why themes cannot be converted to using bootstrapbase (or another third-party base theme), please discuss them here.

Best wishes,

Andrew

Average of ratings: Useful (6)
In reply to Andrew Lyons

Re: Deprecation of base and canvas

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Andrew,

Initial thoughts:

1. The statement that no plugins use base or canvas is false.  A theme is a plugin and many themes (in the plugins DB) use base / canvas as a parent.

2. Because of the logic of the theme loading code, bootstrapbase relies on base being present in order to operate, therefore an opportunity to refactor the theme loading process to be more efficient.  The whole theme structure is loaded, validated as ok then ditched in memory and loaded again.  Walk through the code from index.php to see what I mean.

3. Why so slow?  Why not depreciate in M3.0 and remove in M3.1?

4. Will its removal allow time and effort to be moved to:

a) Updating to BS 3 or even 4?

b) Give space for another framework?

c) The Element library to be completed?

d) Refactoring to reduce the amount of CSS into modular components instead of the current level of granularity?

e) Removal of hard coded images from the JS in favour of classes such that themes can override the images dynamically with other images or icon fonts?

Kind regards,

Gareth 

Average of ratings: Useful (2)
In reply to Gareth J Barnard

Re: Deprecation of base and canvas

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gareth,

1) I was referring to the checking of parentage. Of all of the plugins in the Moodle plugins database, which state that they are compatible with Moodle 2.9, none of them use either base, or canvas as their parent theme. That said, I just found one I'd missed - Archaius does extend base, but this is the only one.

2) Removing any dependence upon the base theme is part of this deprecation process. Hopefully we can improve a few other parts here too.

3) Because 2 releases is our deprecation policy. We do not remove code or 2 releases after a deprecation. That policy can be extended, but it would be highly abnormal to reduce it.

4) Yes - once complete, it should allow more time - that is part of the benefit that I foresee. That said, I couldn't possibly say what the time would be spent on instead. Time would not be freed up immediately as there is some cost to actually performing the deprecation.

Andrew

In reply to Andrew Lyons

Re: Deprecation of base and canvas

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you for your reply Andrew.

With '3' perhaps I'm just chomping at the bit smile - over a year is a long time in software.

In reply to Gareth J Barnard

Re: Deprecation of base and canvas

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gareth,

I agree, as do many others; but consider those who were forced to convert their themes when they migrated from Moodle 1.9 to Moodle 2.0.

At present they have been able to do minimal work on those themes since Moodle 2.0 conversion, but with this change they would essentially have to do a rewrite of their theme.

That said, I think that the conversion process from base to bootstrapbase is relatively simple and is almost simpler to handle by starting afresh and just applying what is needed on top of the bootstrapbase content.

Cheers,

Andrew

In reply to Andrew Lyons

Re: Deprecation of base and canvas

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

With hindsight I think what we could/should have done is partition core CSS that would have servered both Base and Bootstrapbase themes from the same stylesheet. A kind of "Do it Once do it for All" scenario.

In fact this could still be achieved by making Base a child theme of Bootstrapbase and losing all core CSS from Base theme but leave page_layout.css.

Call me crazy...but it works!

Cheers

Mary

In reply to Mary Evans

Re: Deprecation of base and canvas

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Not, in MDL-51580 they are discussing completely removing theme_base from Moodle 3.1, not just deprecating it for a few releases.

In reply to Tim Hunt

Re: Deprecation of base and canvas

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Moodle should have dropped off Base theme in 3.0

If any one needs it the can download from plugins database.

As I have said in MDL-51580 we hardly get any questions about the older themes in the Themes forum.

We made the transition from 1.9 to 2.0 without too much agrivation. In fact it was good fun...I learnt lots about themes then. Now it's getting more technical...and a little boring.

I don't have any qualms about losing Base at all.

Cheers

Mary