CM JavaScript Refactoring

4 views
Skip to first unread message

Ingo Schommer

unread,
Aug 30, 2009, 10:05:11 PM8/30/09
to silverst...@googlegroups.com
Hey folks,

Whew, this is gonna be a long post, in fact so long that I need headlines ;)

# Introduction

in the last weeks, SilverStripe Ltd. has sponsored a larger rewriting
effort of the CMS javascript architecture, with the main goal of enabling
easier and more consistent customizations of the interface.

This also consitutes the long-awaited move from PrototypeJS to jQuery
(and jQuery UI). I've spent three weeks more or less fulltime on a feature branch
of SilverStripe, with a lot of finnicky cleanup work, and some broader
strokes like the introduction of a layout manager for the CMS interface.

In practice, a lot of the work was technical "housekeeping", rather than
dramatic visible changes. If you want to get involved with making
the CMS more useable (keeping in mind the new possibilities
with jQuery and jQuery UI), please start a new thread - this is
not the place to discuss them.

The coding also involved a shiny new jQuery replacement
for our behaviour.js implementation, which was developed
by Hamish Friedlander at SilverStripe Ltd., and will be released
as a separate opensource project soon. It is a fundamental
aspect of the CMS architecture going forward, and will enable
new ways of using jQuery in combination with selector-based
JavaScript inheritance and DOM-oriented public methods.

In terms of code impact, there's over 300 commits to cms/ and sapphire/,
which we will merge back to trunk soonish. Ideally,
all of these changes will make it into a 2.4 release,
although this is pending review and discussion by the community,
so feedback is welcome of course :)

# Goals
- JavaScript library upgrade, no more forks 
- CMS JavaScript cleanup - Rewrite in jQuery where feasible 
- CMS PHP Controller simplification 
- More solid UI components with jQuery UI and plugins 
- CSS Architecture for easier customization 
- Not a large-scale CMS redesign 
- Remove the jsparty/ folder, moved thirdparty libs to sapphire/thirdparty and cms/thirdparty

We've posted our reasoning for the switch to jQuery a while
ago on the mailinglist, and had some good discussions there.

You can also review our (not outdated) research from
early 2008 on the wiki for a bit more context:

# Video and Presentation Slides
The effort was presented to SilverStripe staff last week
in our monthly developer show&tell sessions.
Sig has filmed the whole thing (25 min incl. questions), 
and I've uploaded the slides as well.

# Source & How you can help
All work is available on public git repositories:
Feel free to check out the code (just replace
cms/ and sapphire/ in a standard phpinstaller distribution).

Keep in mind that this is pre-alpha code,
so only useable by the adventureous.
You can log bugs on open.silverstripe.com,
please use the keyword "jsrewrite09" to
group them, and don't assign a milestone.

# Documentation
There's preliminary documentation on the wiki, it outlines
the general principles of our JavaScript architecture, and is
a good read before engaging in discussion here.

# Todo
- Fix secondary interfaces like ModelAdmin, Files&Images, etc.
- Migrate tree implementation to external library (we're currently looking at jstree.com)
- CSS polish, currently we're just using a jQuery UI default theme
- Minification and combination of JavaScript libraries
- Test modules listed as supported at silverstripe.org/modules (We would love the community to help here by writing detailed bug reports or providing high quality patches)

# Notable Changes
Its hard to summarize three weeks worth of commits, here's
some of the ones I think could require discussion.
All commit messages are tagged, basically look for "API CHANGE",
"ENHANCEMENT" and "BUGFIX" messages to start with.


Looking forward to your feedback!
Ingo



-------
Ingo Schommer | Senior Developer
SilverStripe

Skype: chillu23

Reply all
Reply to author
Forward
0 new messages