-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.2.0 to 4.0.0 [braking change] #56
base: master
Are you sure you want to change the base?
Changes from 9 commits
74dc3e7
7c2cc3e
35fae38
890b23b
71f1547
abd6cd1
b3fafe4
b04d0b3
258b7ee
1ff1cd8
98cd6f2
dad7593
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,141 +3,46 @@ Introduction | |
|
||
Integration of jQueryUI in Plone | ||
|
||
IMPORTANT - 2.2.0 > 4.0.0 Upgrade | ||
================================= | ||
|
||
WARNINGS | ||
======== | ||
Can not be upgraded from 2.2.0 directly! It is a major braking release! | ||
|
||
Plone < 4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not remove version information needed by older Plone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not simply removed, it is updated - see https://github.com/szakitibi/collective.js.jqueryui/blob/98cd6f28dc7b34f888ffc6b6f54e1535fddefd8e/README.rst#plone--5 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even removing support for older versions of Plone, we should not remove the information of which version of collective.js.jqueryui is compatible with these versions. Note that today the product is no longer compatible with Plone < 4, but the information is still in the README. This makes it easy if some old Plone user arrives at the repository and wants to use the product on their site. |
||
--------- | ||
There is no upgrade step provided for this "version jump", instead follow these steps: | ||
|
||
For Plone 3 you need version 1.7.x of this package | ||
|
||
JQueryUI > 1.8.6 is supposed to be compatible with jQuery 1.3.2. | ||
At the moment you should prefer to use the 1.7.X version of jQueryUI | ||
(same package exists for 1.7 branch) | ||
1. First uninstall 2.1.8 version of JQuery UI using "Site Setup / Add-ons" page. This will cleanly remove all: Plugin selection related registry records; Old style `jsregistry` items; Actions and controlpanel pages. | ||
2. Run the buildout to get the 4.0.0 version. | ||
3. Restart instance. | ||
4. Install JQuery UI again using "Site Setup / Add-ons" page. | ||
|
||
Plone < 4.3 | ||
----------- | ||
WARNINGS | ||
======== | ||
|
||
Use version < 1.9 | ||
Plone < 5 | ||
--------- | ||
|
||
Integration for Zope and Plone | ||
============================== | ||
Support is dropped for older versions of Plone and Python 2.7. | ||
|
||
This package can be used as a Plone add-on - for this it adds GenericSetup | ||
profiles and Plone ControlPanel configlets - or it can be used as a simple Zope | ||
jQuery UI resources registrar. See bellow how your zc.buildout config file | ||
should look like if you use collective.js.jqueryui with or without Plone. | ||
Integration for Zope | ||
-------------------- | ||
|
||
Plone | ||
----- | ||
This package can be used as a Plone add-on only. | ||
|
||
for Plone > 4.0: | ||
Usage | ||
===== | ||
|
||
buildout.cfg:: | ||
|
||
[instance] | ||
eggs += | ||
collective.js.jqueryui | ||
|
||
for Plone == 4.0 you must add plone.app.registry yourself: | ||
|
||
buildout.cfg:: | ||
|
||
extends=http://good-py.appspot.com/release/plone.app.registry/1.0b2 | ||
[instance] | ||
eggs += | ||
collective.js.jqueryui | ||
plone.app.registry | ||
|
||
Zope | ||
---- | ||
|
||
buildout.cfg:: | ||
|
||
[instance] | ||
eggs = | ||
collective.js.jqueryui | ||
zcml = | ||
collective.js.jqueryui | ||
|
||
Include plugins and optimizations | ||
================================= | ||
|
||
By default this addon register all plugins and activate all of them except tabs. | ||
So ui.tabs is registred but not activated. | ||
|
||
Because jQueryUI is big on both javascripts and css you may want to optimize | ||
the configuration of your site or your addon which depends on this one. | ||
|
||
So you can activate/unactivate plugins using registry profile or the jQueryUI | ||
controlpanel. | ||
|
||
Using registry.xml, you can activate only what you want:: | ||
|
||
<registry> | ||
<records interface="collective.js.jqueryui.controlpanel.IJQueryUIPlugins"> | ||
<value key="ui_draggable">True</value> | ||
<value key="ui_droppable">True</value> | ||
</records> | ||
</registry> | ||
|
||
In the case of a policy you can do a full configuration:: | ||
|
||
<registry> | ||
<records interface="collective.js.jqueryui.controlpanel.IJQueryUIPlugins"> | ||
<value key="ui_core">True</value> | ||
<value key="ui_widget">True</value> | ||
<value key="ui_mouse">True</value> | ||
<value key="ui_position">True</value> | ||
<value key="ui_draggable">True</value> | ||
<value key="ui_droppable">True</value> | ||
<value key="ui_resizable">True</value> | ||
<value key="ui_selectable">True</value> | ||
<value key="ui_sortable">True</value> | ||
<value key="ui_accordion">False</value> | ||
<value key="ui_autocomplete">False</value> | ||
<value key="ui_button">False</value> | ||
<value key="ui_dialog">False</value> | ||
<value key="ui_slider">False</value> | ||
<value key="ui_tabs">False</value> | ||
<value key="ui_datepicker">False</value> | ||
<value key="ui_progressbar">False</value> | ||
<value key="effects_core">False</value> | ||
<value key="effects_blind">False</value> | ||
<value key="effects_bounce">False</value> | ||
<value key="effects_clip">False</value> | ||
<value key="effects_drop">False</value> | ||
<value key="effects_explode">False</value> | ||
<value key="effects_fade">False</value> | ||
<value key="effects_fold">False</value> | ||
<value key="effects_highlight">False</value> | ||
<value key="effects_pulsate">False</value> | ||
<value key="effects_scale">False</value> | ||
<value key="effects_shake">False</value> | ||
<value key="effects_slide">False</value> | ||
<value key="effects_transfer">False</value> | ||
</records> | ||
<records interface="collective.js.jqueryui.controlpanel.IJQueryUICSS"> | ||
<value key="css">False</value> | ||
<value key="patch">False</value> | ||
</records> | ||
</registry> | ||
|
||
Using the control panel, you can select plugins you want. If you unselect a | ||
plugin it will be unactivated (but not its dependencies) | ||
|
||
Using python, you just have to use plone.registry api:: | ||
|
||
from zope.component import getUtility | ||
from plone.registry.interfaces import IRegistry | ||
from collective.js.jqueryui.config import DEPS | ||
from collective.js.jqueryui.interfaces import IJQueryUICSS, IJQueryUIPlugins | ||
#is plone.app.registry | ||
registry = getUtility(IRegistry) | ||
proxy = registry.forInterface(IJQueryUIPlugins) | ||
setattr(proxy, 'ui_draggable', True) | ||
setattr(proxy, 'ui_droppable', True) | ||
By default this addon register all plugins and activate all of them. The registry based plugin activation is dropped. See https://github.com/collective/collective.js.jqueryui/issues/46. | ||
|
||
Credits and contributions | ||
========================= | ||
|
@@ -148,4 +53,4 @@ Credits and contributions | |
* `Ecreall <https://www.ecreall.com>`_ | ||
|
||
.. |makinacom| image:: http://depot.makina-corpus.org/public/logo.gif | ||
.. _makinacom: https://www.makina-corpus.com | ||
.. _makinacom: https://www.makina-corpus.com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,62 @@ | ||
How to upgrade this package | ||
=========================== | ||
|
||
- Go to https://jqueryui.com/download | ||
- Go to the URL specified in the collective/js/jqueryui/css/sunburst/jqueryui.css file to pre-load current theme settings. | ||
|
||
- Go to the URL specified in the src/collective/js/jqueryui/jquery-ui-$VERSION.custom/jquery-ui.theme.css file to pre-load current theme settings. | ||
- Click on "Download theme" in the left-side "Theme rollover". | ||
- At the bottom "Theme" update by "sunburst" in "Theme Folder Name" field. | ||
- Download jquery-ui-X.custom.zip | ||
|
||
Commands to execute:: | ||
|
||
PKG="/home/toutpt/workspace/collective.js.jqueryui/src/collective/js/jqueryui" | ||
VERSION="1.8.13" | ||
PREV="1.8.12" | ||
unzip ~/jquery-ui-$VERSION.custom.zip | ||
cd ~/jquery-ui-$VERSION.custom | ||
rm $PKG/jquery-ui-$PREV.custom.min.js | ||
rm $PKG/jquery-ui-$PREV.custom.js | ||
rm $PKG/js/* | ||
cp ui/jquery-ui.js $PKG/jquery-ui-$VERSION.custom.js | ||
cp ui/minified/jquery-ui.min.js $PKG/jquery-ui-$VERSION.custom.min.js | ||
cp ui/minified/i18n/jquery-ui-i18n.min.js $PKG/jquery-ui-i18n.js | ||
cp ui/minified/*.min.js $PKG/js/ | ||
|
||
rm $PKG/css/sunburst/images/* | ||
rm $PKG/css/sunburst/jqueryui.css | ||
cp css/sunburst/jquery-ui-$VERSION.custom.css $PKG/css/sunburst/jqueryui.css | ||
cp css/sunburst/images/* $PKG/css/sunburst/images/ | ||
|
||
- update version in README.txt and common.zcml and config.py | ||
unzip jquery-ui-$VERSION.custom.zip | ||
rm -R jquery-ui-$PREV.custom | ||
|
||
- update version in `config.py` and `configure.zcml` for resources | ||
|
||
- increment the profile version in metadata.xml | ||
|
||
- update the ugprade step:: | ||
- provide ugprade step:: | ||
|
||
<genericsetup:upgradeStep | ||
source="*" | ||
destination="3001" | ||
source="4000" | ||
destination="4001" | ||
title="" | ||
description="" | ||
profile="collective.js.jqueryui:default" | ||
handler=".upgrades.common" | ||
/> | ||
|
||
|
||
Caveats/Issues: | ||
=============== | ||
|
||
!IMPORTANT: The old style configurable solution does not work any more! | ||
https://github.com/collective/collective.js.jqueryui/issues/46 | ||
This is a simplified 4.0.0 version, with different upgrade steps. | ||
|
||
make it work | ||
------------ | ||
|
||
The result of the unpacked jQuery UI zip with Plone 5.2.4 (5212) patterns require.js raises an error: | ||
|
||
``` | ||
Uncaught Error: Mismatched anonymous define() module: function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2"; ... require.js:168 | ||
at makeError (require.js:168:17) | ||
at intakeDefines (require.js:1254:36) | ||
at Object.localRequire [as require] (require.js:1446:21) | ||
at requirejs (require.js:1797:24) | ||
at patterns-compiled.js:15444:1 | ||
``` | ||
|
||
Solution was to manually remove from `jquery-ui-1.13.2.custom/jquery-ui.min.js` the ADM part (`"function"==typeof define&&define.amd?define(["jquery"],t):`) right at the start of the javascript code: | ||
|
||
`!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){ ...` | ||
|
||
so we end up with: | ||
|
||
`!function(t){"use strict";t(jQuery)}(function(V){ ...` | ||
|
||
|
||
no more i18n datepicker | ||
----------------------- | ||
|
||
It does not work anymore, the viewlet is simply short circuited in its render method. It is left in the product in case it is used by other addons. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
|
||
setup( | ||
name="collective.js.jqueryui", | ||
version="2.2.1.dev0", | ||
version="4.0.0 (unreleased)", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not 3.0.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To point it out better, that it is a huge jump and a braking change. So much has been removed, that I think it is basically a new product, just to register the bundle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that makes sense. Even if we were moving from 2.99 to 3.0.0, that would also indicate a breaking release. I think we can use 3.0.0. |
||
description="JQueryUI ready for Plone", | ||
long_description=long_description, | ||
# Get more from https://pypi.org/classifiers/ | ||
|
@@ -30,12 +30,10 @@ | |
"Framework :: Zope :: 4", | ||
"Framework :: Plone", | ||
"Framework :: Plone :: Addon", | ||
"Framework :: Plone :: 4.3", | ||
"Framework :: Plone :: 5.0", | ||
"Framework :: Plone :: 5.1", | ||
"Framework :: Plone :: 5.2", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.7", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This product doesn't have much in python. I think compatibility with python 2 could be maintained, at least to have a compatible version that fixes the security problem. |
||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
], | ||
|
@@ -55,7 +53,7 @@ | |
package_dir={"": "src"}, | ||
include_package_data=True, | ||
zip_safe=False, | ||
python_requires=">=2.7", | ||
python_requires=">=3.7", | ||
install_requires=[ | ||
"Products.CMFPlone", | ||
"setuptools", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
# -*- coding: utf-8 -*- | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be possible to do the update. An upgrade step should be created.