widgets, plone4/5 and mockup
Kai Hoppert <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
i have some questions about mockup and plone which i really cannot
answer on my own.
First the history how i came to that questions, i try to make it short.
in a plone 4.3.2 i installed plone.app.widgets 1.4.0. 1.4.0 comes with a
select2 version wich was a little bit buggy.
```
$('.content-pat-select2').select2(
{dropdownCssClass : 'content-select2-dropdown'}
)
```
was not working. At this time a don't know much about mockup. So i
looked in the source files of the product and searched for an unminified
widgets.js with maybe have an unminified select2.
Nothing found so why it is not there. So I got to know mockup.
Now to my stomach ache i currently have with mockup.
Please correct me if i am wrong! The following should not be offensive.
I think mockup/require.js it the right way for plone!.
1. If you use plone in business, you really will need a mockup in EVERY
plone site i think , if you like to do deeper customizing.
Possible reasons:
- Fixing a java script bug in the bundle
- Using a diffrent bootstrap version
- Need an upgrade of jquery
- Solving version conflicts with newly integraded stuff.
Every released plone version has bugs. Thats reality.
Something to reflect:
Not every plone site you intall for a customer will get an upgrade if a
new plone version will be released.
It's every time a question of: Will he pay an upgrade. What i wan't to
clarify here is.
It's business as usual to fix a bug or integrate new stuff. A one time
installed plone site can have a live time between of 4 years and more.
I am dealing with plone since 10 years.
If i understand right bower is a must have of mockup otherwise i will
not have the js libraries. So this means every plone site will have
round about 250 mb extra in development.
configure.zcml example Plone5
```
<configure zcml:condition="installed mockup">
<browser:resource
name="plone.js"
file="static/plone.js"
/>
<browser:resource
name="plone.css"
file="static/plone.css"
/>
</configure>
<configure zcml:condition="not-installed mockup">
<browser:resource
name="plone.js"
file="static/plone.min.js"
/>`
<browser:resource
name="plone.css"
file="static/plone.min.css"
/>
</configure>
```
So if mockup is there, mockup and require js are dealing with the java
script dependencies.
If not the bundle is used. But the bundle i think is undermine what
requirejs is. A js framework for loading js library if i really need it
and not from the beginning on.
But if everything is in one file, all the stuff is delivered at once.
Here a big point. As i upgraded plone.app.widgets 1.4.0 -> 1.6.0 in
plone4.3.2 without mockup my site breaks at first,
because 1.4.0 is not comming with an own jquery version, 1.5.0 and
greater does.
At this time i did not reinstalled the product. I know that jquery is
placed to deprecated, so it is not longer loaded.
BUT: What if you don't have mockup and you install an additional add on
product wich is build with mockup.
You will have the same problem because jquery will be comming from a
still existing, integrated bundle.
I thinks this will be a commen use case in future. An answer will be not
depending in your add on product to jquery, you would have to depend on
plone.
But currently barceloneta, the toolbar, and widgets are referencing to
jquery in their bundle.js.
I think we really really need a way in using require js be default in
plone. mockup installed or not. If mockup is not installed requirejs
should works in a way wich is described on the require js page.
Reasons:
- For people who are not so firm with plone or new to it, it will be
incomprehensible why they need to install a 250 mb framework only for
fixing a java script bug.
Or upgrading maybe select2 or using a newer bootstrap version.
- I think you will got massivly problems in maintenance you plone site
if you will not install mockup in every of you sites. Fixing a js bug in
core
wich you really need to fix after maybe two or three years running
the same plone version will consume a lot of time. And in business time
is money.
- Because time is money in business, sometimes things has to be done
fast and not theoretically correct. Not every project is so important
and has a such big budget
to do things theoretically correct.
I am currenty using bootstrap in all of our new plone sites. plone
version 4.3.2. And upgrading bootstrap in a plone site currently takes
15 minutes of my time.
Downloading, extracting, uploading, commiting, checking out on server or
egg bundled what every, restarding.
I think makeing a version update of an js file in future has to be just
as fast and just as easy as it is today. If everything is in a big
compiled bundle without any separation you have no chance in doing a
quick bug fix. And this is really really negativ. Updating jquery,
bootstrap, awesome fonts and anything else has to possible without using
mockup in an easy way as it is today.
Plone is getting more and more complex with every version over the years.
The greatest advantage of plone should be easy to use, easy to learn,
fast in developement. Only with this goals new developers will get into
the community and plone will live forever :)
Thanks for your time, i hope you understand my position and my english
Greetings
Kai Hoppert
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech