You are here: Foswiki>Tasks Web>Item13481 (20 Feb 2017, MichaelDaum)Edit Attach

Item13481: Move cruft out of base templates

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component:
Branches: master
Reported By: CrawfordCurrie
Waiting For: GeorgeClark
Last Change By: MichaelDaum
The base templates - the crudest skin on which other skins may be based - has gathered a lot of cruft. This has come mainly from PatternSkin, but there are dependencies on other Plugins, such as TwistyPlugin, that mean the base templates are not useable without a lot of plugins being installed. There is also a lot of Javascript that doesn't work with JQuery, and is specific to PatternSkin.

This is not good. The base skin needs to be just that - a base, that carries no dependencies outside of the core. There should be no 'base' Javascript other than strikeone.

To clean this up requires two stages; first, moving the content of pub/System/JavascriptFiles to PatternSkin (this can be done safely for 1.2.0 as it involves no functional changes, just file moves).

Second stage is to cleanse the templates themselves, and remove dependencies. That has to wait for the next release, as it involves functional changes that might break something.

-- CrawfordCurrie - 29 Jun 2015

Stage 1 is complete.

If you uninstall all extensions (except the user mapping, which is required) then you'll see that the base templates crash due (at least) to missing FamFamFamContrib.

-- Main.CrawfordCurrie - 29 Jun 2015 - 17:15

We need to be clear on which changes will break a site's customizations, and which will tolerate local customizations.

Can Stage2 be done in a minor release like Foswiki 2.2, or is it significant enough to be deferred to a major release.

-- GeorgeClark - 18 Feb 2017

A lot can be done incrementally in minor releases, as it is just moving functionality from the base templates out to skin-specific templates.

You should be able to test the base templates by ./pseudoinstall -u PatternSkin FamFamFamContrib - I just tried and it seems to mostly work, though TwistyPlugin seems to stop - does it depend on Pattern? Wrinkles like this need to be worked out and then the whole thing kept working while the base templates are further simplified.

The only place this falls down is if anyone has built a new skin by replacing Pattern with their own derived skin, but still relying on the overstuffed base templates.

The goal is to get down to the simplest set of templates that can possibly work - the wiki ideal.

MichaelDaum has been talking about re-skinning and cleaning out JavascriptFiles, he may want to comment on whether the above is a worthwhile approach.

-- Main.CrawfordCurrie - 19 Feb 2017 - 08:24

I don't think incremental work will lead to much improvement anymore. Incremental changes are good to maintain the status quo more or less.

Incremental work is great. Don't get me wrong: I am all for stability and reliability, something we try to offer to our users given the all too often shifting sands in web development out there.

However, Foswiki has amassed so much legacy in templates and code not only in the base templates and the Foswiki::UI level that we need to get back to a clean plate more often. The sheer effort to GTC (Grok The Cruft) is not justifiable. The same effort is better spent to decouple as much cruft as possible while understanding what's going on. Cruft should then be moved and preserved at a safe distance it does not block new development more than required. People should then be able to follow one of two paths: either installing a legacy layer to restore backwards compatibility, or uninstall any legacy to clear the way for new stuff.

There is a lot we can remove in the base templates. There is a lot we can restructure too.

-- MichaelDaum - 19 Feb 2017

This task needs to be broken down into manageable chunks that make sense on their own each ... and need a task item each. Closing this one.

-- MichaelDaum - 20 Feb 2017
 
Topic revision: r8 - 20 Feb 2017, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy