Ticket #10888 (closed PLIP: fixed)

Opened 6 years ago

Last modified 3 years ago

Make KSS optional

Reported by: davisagli Owned by: davisagli
Priority: n/a Milestone: 4.3
Component: KSS (Ajax) Version: 4.3
Keywords: Cc: plip-advisories@…

Description (last modified by esteele) (diff)

Proposer: David Glick
Seconder: Eric Steele

(This is an updated version of #8809...see there for previous discussion.)

Motivation

KSS (kinetic style-sheets) were added to Plone 3 as a way to configure dynamic page functionality without writing javascript. However, KSS has not seen the kind of widespread adoption inside or outside of the Plone community which warrant its inclusion in the Plone core. In addition, JQuery has been shown to be an adequate framework for implementing the dynamic functionality of Plone itself, so including KSS by default is an unnecessary burden in terms of download size and performance.

Proposal

I propose to turn KSS into an optional add-on that is available but not installed by default, much like plone.app.openid and CMFPlacefulWorkflow.

Features of Plone that are currently implemented using KSS would be re-written as JQuery. I previously (in Plone 3) identified the following features that may need to be rewritten:

  • inline editing
  • inline validation
  • lock on edit
  • auto-refresh of portlets with a kssPortletRefresh class (yeah, I didn't know we had this feature either)
  • updates to workflow state upon clicking in the workflow menu
  • navigation of the calendar portlet to different months
  • triggering of form tabbing and form unload protection after page load
  • AJAX update of the sharing tab (I think this feature was already removed)
  • folder_contents pagination and sorting

Deliverables:

  • branches of various Plone packages with the above features reimplemented without KSS
  • new releases of plone.app.kss and archetypes.kss that can be used as dependencies by add-ons, and documentation on how to do this

Assumptions

The goal here is to make it possible to use Plone without KSS, not to make it impossible to use KSS. As such, the intent is to produce releases of plone.app.kss and archetypes.kss that can be depended on by other add-ons that still rely on KSS. These packages may still ship with Plone for the duration of the 4.x series, but would not be installed for new sites by default.

The details of the approach to reimplementing Plone features in JQuery have not been decided. Eric Steele has done some experimentation with writing a parser for KSS rules in pure JQuery. I will evaluate that, but will probably end up deciding that it is not worth keeping the KSS rule syntax, and do the configuration in JQuery as well.

Risks

  • Add-ons using KSS will need to be updated to explicitly depend on and install the packages that were previously included with Plone.
  • KSS may languish and die once it is not part of Plone core. (That is arguably not far from the status quo.)

Participants

David Glick can help coordinate work on this PLIP, but will need assistance with the implementation. Possible helpers: Eric Steele, Steve McMahon, Matt Yoder, Nathan van Gheem, others?

Progress

Hanno previously experimented with removing KSS entirely in r25107, but this work is not directly usable as it removed a lot of functionality we don't want to.

Change History

comment:1 Changed 6 years ago by davisagli

  • Description modified (diff)

Added names of people who said they may be able to help.

comment:2 Changed 6 years ago by esteele

Actually, what I wrote is a parser for KSS responses using jQuery.

My assumption was that there's a lot of base functionality implemented as KSS rules that probably shouldn't be. How often, if ever, does someone have a need for a easy way to customize the calendar next/prev arrows or inline editing? How much page load time is sacrificed to parsing/rendering these rules?

My initial work was to remove those base rules, use jQuery handlers to send requests to the KSS handler views and parse the returned xml response. The KSS backend views are good at what they do, so I was lazy and reused them. This allowed me to turn off the base KSS rulesets. At the time, I was seeing a 15-45% speedup throughout the site ( http://markmail.org/thread/aciwpb3gbsa3n2zy), though, with admittedly reduced functionality. This was on an pre-alpha (or early a1) version of Plone 4, so it'd be worthwhile to reexamine those numbers.

Basics of my work are are at https://dev.plone.org/plone/browser/Plone/branches/esteele-jqueryrewrite/Products/CMFPlone/skins/plone_ecmascript/jquery-inlinefunctions.js

Godefroid and Balazs have a great testing setup to check the KSS codebase against multiple browsers. If you're going to do this, we need to find away to make up for that.

comment:3 Changed 6 years ago by esteele

Your PLIP has been accepted for consideration for Plone 4.1.

Framework Team voting on this PLIP was: Alec +1 Craig +1 Elizabeth +1 Laurence +1 Martijn +1 Matthew +1 Rob +1 Ross +1

The initial implementation deadline for your PLIP is October 1st, 2010. The Framework Team would certainly appreciate you finishing beforehand so that they may begin evaluating it as soon as possible. Announce its readiness here once your implementation is ready for review.

comment:4 Changed 6 years ago by cah190

  • Cc plip-advisories@… added

comment:5 Changed 5 years ago by esteele

May also look at #9121 as a part of this work.

comment:6 Changed 5 years ago by esteele

  • Milestone changed from 4.1 to Future

comment:7 Changed 5 years ago by rossp

  • Status changed from new to closed
  • Resolution set to wontfix

PLEASE READ THIS AND RE-OPEN VALID PLIPS!

As we launch the new PLIP process we'd like to see which PLIPs:

  • are still appropriate/needed
  • still have owners/proposers/champions
  • still have available implementers

If this PLIP should still be considered for future releases of Plone please do re-open this ticket and assign an appropriate milestone. If it should be considered for the next release of Plone, use the 4.2 milestone. Also be sure to update the PLIP description, requester, owner, etc. and include a comment detailing recent progress and new plans. We will use all these details in the new continuous PLIP process.

comment:8 Changed 4 years ago by esteele

  • Priority changed from major to n/a
  • Status changed from closed to reopened
  • Resolution wontfix deleted
  • Description modified (diff)
  • Milestone changed from Future to 4.4

comment:9 Changed 4 years ago by esteele

  • Version set to 4.1

comment:10 Changed 3 years ago by davisagli

  • Status changed from reopened to confirmed
  • Version changed from 4.1 to 4.3
  • Milestone changed from 4.4 to 4.3

comment:11 Changed 3 years ago by davisagli

  • Status changed from confirmed to closed
  • Resolution set to fixed

Merged.

In Plone 4.3 plone.app.kss can be installed as an add-on to support inline editing and custom KSS rules. But it will no longer be supported.

Documentation pull request:  https://github.com/collective/collective.developermanual/pull/147

Note: See TracTickets for help on using tickets.