{ "info": { "author": "Plone Foundation", "author_email": "plone-developers@lists.sourceforge.net", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Plone", "Framework :: Plone :: 5.2", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "plone.staticresources\n=====================\n\nThis add-on contains all static JavaScript and CSS resources used by Plone.\n\n\nTarget audience\n---------------\n\nThis documentation aims at:\n\n- **Theme Authors:** who want to change the look and feel of a Plone site and need to:\n\n - understand how to correctly bundle changes made into existing or new frontend code.\n\n- **Integrators and Developers:** who want to customize or maintain the front end of a Plone site for their customers:\n\n - upgrade existing versions or install new ``npm`` packages.\n\n - integrate new JavaScript/CSS behavior, eventually wrapped in a ``pattern`` for optimal integration and reuse within Plone front end ecosystem.\n\n- **Plone Core Developers:** who want to fix Plone bugs or enhance this add-on.\n\n\nHow to upgrade the resources in this package\n--------------------------------------------\n\n1. Increase Npm package versions in ``package.json``, in sections ``dependencies`` or ``devDependencies``.\n\n2. Run ``yarn upgrade`` (important: cannot be ``npm``)\n\n3. Run ``./bin/plone-compile-resources -b plone`` or ``./bin/plone-compile-resources -b plone-logged-in`` (whichever bundle you need to re-build).\n\n4. Increase the ``last_compilation`` date in ``src/plone/staticresources/profiles/default/registry/bundles.xml``.\n\n5. Submit a Pull Request and run the tests on Jenkins.\n\n\nWhat has changed\n----------------\n\nBetween Plone 5.0 and 5.1 these resources were located in ``static/`` directory of ``Products.CMFPlone`` package.\nStarting with Plone 5.2 they are distributed in this independent package due to the specific tooling and workflows used to build frontend resources and also the different maintenance and release needs of ``Products.CMFPlone``.\nFor a complete list of reasons, read `PLIP 1653 `_.\n\n.. note::\n A note on Yarn: we require the use of Yarn because it supports installing packages in a custom named directory, which Npm does not (even using ``--prefix``, ``node_modules`` is hardcoded).\n Our package directory is located at: ``src/plone/staticresources/static/components``.\n\nChanges since Plone 5.1.x\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n- The ``toolbar`` pattern from ``Products.CMFPlone.static.toolbar`` has been moved to ``mockup`` package.\n- ``mockup`` package now uses Npm's registry and Yarn instead of Bower.\n\nBesides the following has been moved in here:\n\n- All static Resources from ``Products.CMFPlone.static``: bundle resources, compiled bundles, external packages\n- Bundle and Resource registrations from ``Products.CMFPlone``'s ``dependencies`` profile\n- ``plone-compile-resources`` script\n- ``thememapper`` bundle from ``plone.app.theming``\n- ``plone.resourceeditor`` bundle from ``plone.resourceeditor``\n\n\nCompiling Bundles\n-----------------\n\nThe front end resources in this package should be updated with the script called ``plone-compile-resources``, available in the ``bin`` directory of a default Plone buildout installation.\nThis script compiles the final CSS and JS resources that will be served to end users.\n\nBuilding the ``plone`` bundle::\n\n ./bin/plone-compile-resources -b plone\n\nBuilding the ``plone-logged-in`` bundle::\n\n ./bin/plone-compile-resources -b plone-logged-in\n\n.. note::\n You can see all the options of this executable by running ``./bin/plone-compile-resources --help``.\n\n\nResources, Bundles, Patterns and the Resource Registry\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe ``plone-compile-resources`` script collects Resources from source packages (e.g. ``mockup``) and compiles them in ``plone/staticresources/static/`` into minified versions with source maps and, for JavaScript only, also into an un-minified version.\nThe output directory is configurable by using ``csscompilation`` and ``jscompilation`` attributes of the bundle registration.\n\nBundles are groups of resources. By default Plone comes configured to serve two main bundles:\n\n- ``plone``: containing JS and CSS used for anonymous visitors\n- ``plone-logged-in``: with additional resources for authenticated visitors, e.g. for editor and management user interfaces\n\nFinally Plone encapsulates most of its CSS and JS into units called Patterns that live in the ``mockup`` package.\nAlthough Patterns provide their own registered Resources, those are not registered to Plone main bundles.\nInstead, they are imported through native LESS and Require JS \"entry points\" that live in ``plone.staticresource``:\n\n- `plone/staticresources/static/plone.js\n `_\n- `plone/staticresources/static/plone.less\n `_\n- `plone/staticresources/static/plone-logged-in.js\n `_\n- `plone/staticresources/static/plone-logged-in.less\n `_\n\nWhen editing a pattern (e.g. in ``mockup`` package), it is important to know for which bundle it is registered, which can be done by checking where it is imported in the entry points above.\nThe bundle name will be useful as parameter for ``plone-compile-resources`` script.\n\n.. note::\n Patterns are also available as independent resources in `Resource Registries` control panel but they are not registered to default Plone bundles, which instead use the entry point approach.\n Pattern's resources may be useful if needed to be injected in specific views.\n\nIn production mode (``./bin/instance start``), since version 5.1, Plone is configured to serve Aggregate Bundles, single files to minimize network requests (`aggregate bundles `_).\nIn that case final production resource URLs will be similar to:\n\n- http://localhost:8080//++plone++production/++unique++TIMESTAMP/default.js\n- http://localhost:8080//++plone++production/++unique++TIMESTAMP/default.css\n\nIf you enable `Development Mode` for JavaScript and CSS in `Resource Registries` control panel, Plone will omit timestamp from path and serve fresh copies of the resources of the selected bundle(s).\nThose are compiled in-browser, on the fly for each page load and requested by XHR requests to URLs like:\n\n- http://localhost:8080/++resource++plone.js\n- http://localhost:8080/++plone++static/plone.less\n- http://localhost:8080/++resource++plone-logged-in.js\n- http://localhost:8080/++plone++static/plone-logged-in.less\n\nThese entry points will then cause Patterns themselves to be loaded through in-browser XHR requests to URLs like:\n\n- http://localhost:8080/Plone/++resource++mockup/livesearch/pattern.js\n- http://localhost:8080/Plone/++resource++mockup/livesearch/pattern.livesearch.less\n\nIf you do enable Development Mode, and yet do not select any bundles, Plone serves static resources in URLs similar to:\n\n- http://localhost:8080/++plone++static/++unique++TIMESTAMP/plone-compiled.min.js\n- http://localhost:8080/++plone++static/++unique++TIMESTAMP/plone-compiled.css\n- http://localhost:8080/++plone++static/++unique++TIMESTAMP/plone-logged-in-compiled.min.js\n- http://localhost:8080/++plone++static/++unique++TIMESTAMP/plone-logged-in-compiled.css\n\n\nDevelopment tips\n^^^^^^^^^^^^^^^^\n\nWhen fixing Plone bugs or improving functionality:\n\n- Dependencies upgrades (e.g. ``moment.js``) should be done in ``mockup`` and after the PR is merged, propagated here (i.e. static resources needs to be recompiled)\n- Likewise, CSS and JS should be developed not in ``plone.staticresources`` but in their own package's source (for instance, in ``mockup``)\n- To see the new changes in the browser, enable `Development Mode` in `Resource Registries` control panel.\n Next the desired bundle (that contains the modified files) must be set to either \"Develop JavaScript\", \"Develop CSS\" or both.\n This causes each of the bundle resources to be served individually, easing development.\n In this case, bundle resources are served from the source package (e.g. ``mockup``) instead of ``plone.staticresources``.\n- To identify which bundle contains the modified resource, see section \"Entry Points\" below.\n Keep in mind the more bundles selected for development mode the slower are page reloads, so it is recommended to select only what is being developed.\n- Alternatively you may run ``./bin/plone-compile-resources`` between changes and avoid `Development Mode`'s in-browser compilation (fastest browser loading time).\n\n\nEntry Points\n^^^^^^^^^^^^\n\nThe current list of registered patterns for each entry point is available in:\n\n- `plone/staticresources/static/plone.js\n `_\n- `plone/staticresources/static/plone.less\n `_\n- `plone/staticresources/static/plone-logged-in.js\n `_\n- `plone/staticresources/static/plone-logged-in.less\n `_\n\nHere's a snapshot:\n\nFor anonymous users\n~~~~~~~~~~~~~~~~~~~\n\n+---------------------------------------+------------------------------------+\n| JS | LESS |\n+=======================================+====================================+\n| - jquery | - mockup-patterns-autotoc |\n| - pat-registry | - mockup-patterns-livesearch |\n| - mockup-patterns-base | - mockup-patterns-markspeciallinks |\n| - mockup-patterns-autotoc | - mockup-patterns-modal |\n| - mockup-patterns-contentloader | - mockup-patterns-pickadate |\n| - mockup-patterns-cookietrigger | - mockup-patterns-select2 |\n| - mockup-patterns-formautofocus | |\n| - mockup-patterns-formunloadalert | |\n| - mockup-patterns-livesearch | |\n| - mockup-patterns-markspeciallinks | |\n| - mockup-patterns-modal | |\n| - mockup-patterns-moment | |\n| - mockup-patterns-pickadate | |\n| - mockup-patterns-navigationmarker | |\n| - mockup-patterns-preventdoublesubmit | |\n| - mockup-patterns-select2 | |\n| - bootstrap-collapse | |\n| - bootstrap-dropdown | |\n| - bootstrap-tooltip | |\n+---------------------------------------+------------------------------------+\n\nFor logged-in users\n~~~~~~~~~~~~~~~~~~~\n\n+--------------------------------------------+--------------------------------+\n| JS | LESS |\n+============================================+================================+\n| - mockup-patterns-inlinevalidation | - mockup-patterns-querystring |\n| - mockup-patterns-querystring | - mockup-patterns-recurrence |\n| - mockup-patterns-recurrence | - mockup-patterns-relateditems |\n| - mockup-patterns-relateditems | - mockup-patterns-structure |\n| - mockup-patterns-structure | - mockup-patterns-tinymce |\n| - mockup-patterns-structureupdater | - mockup-patterns-upload |\n| - mockup-patterns-textareamimetypeselector | - plone-patterns-toolbar |\n| - mockup-patterns-tinymce | |\n| - plone-patterns-portletmanager | |\n| - plone-patterns-toolbar | |\n+--------------------------------------------+--------------------------------+\n\nDeveloping patterns\n-------------------\n\nAll JavaScript code in this package is downloaded via ``yarn`` into ``src/plone/staticresources/static/components``.\nNothing in that directory should be manually edited.\nIf you need to fix something, do it in the original repository and eventually upgrade its version (next section).\n\nFor Mockup, the original repository is: https://github.com/plone/mockup/\n\nFor Patternslib, visit: http://github.com/patternslib/Patterns\n\n\nGenerating the ``plone-compile-resources`` script\n-------------------------------------------------\n\nThe ``plone-compile-resources`` script can be used to compile bundles from the command line.\nIn short, the script starts up a Plone instance, reads the resources and bundles configured in the registry and compiles a JS/CSS bundle based on that configuration.\nSee ``plone-compile-resources --help`` for more information.\n\nWhen using buildout, ``plone-compile-resources`` script is automatically generated.\nIf you use a custom buildout, you might need to add something similar to:\n\n.. code-block:: ini\n\n [buildout]\n parts =\n # ...\n zopepy\n # ...\n [instance]\n # ...\n\n [zopepy]\n recipe = zc.recipe.egg\n eggs =\n ${instance:eggs}\n interpreter = zopepy\n scripts =\n zopepy\n plone-compile-resources\n\n\nMore on the Resource Registry and its modes\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nHave a look on how ``plone.staticresources`` and ``mockup`` register their resources:\n\nIn ZCML:\n\n- https://github.com/plone/mockup/blob/master/mockup/configure.zcml\n- https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/configure.zcml\n\nIn the resource registry:\n\n- https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/bundles.xml\n- https://github.com/plone/plone.staticresources/blob/master/src/plone/staticresources/profiles/default/registry/resources.xml\n\nFor more information on the Plone resource registry see the documentation at:\n\n- https://docs.plone.org/adapt-and-extend/theming/resourceregistry.html\n\n\nWarning\n-------\n\nIf you update ``r.js`` or ``less``, you will need to manually re-apply a patch that gives us cache busting resource downloads so we can build through the web.\nSee:\n\n- https://github.com/plone/Products.CMFPlone/commit/2d3865805efc6b72dce236eb68e502d8c57717b6\n- https://github.com/plone/Products.CMFPlone/commit/bd1f9ba99d1ad40bb7fe1c00eaa32b8884aae5e2\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\n\nChangelog\n=========\n\n.. You should *NOT* be adding new change log entries to this file.\n You should create a file in the news directory instead.\n For helpful instructions, please see:\n https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst\n\n.. towncrier release notes start\n\n1.1.0 (2019-06-22)\n------------------\n\nNew features:\n\n\n- Add support for asynchronous loading of javascript resources.\n A new plone-base bundle is added with the minimum required scripts from plone bundle.\n Import the extra profile to enable experimental async loading.\n [agitator] (#27)\n\n\nBug fixes:\n\n\n- Fixes plone/mockup#895 again. (#24)\n- Fixed plone/Products.CMFPlone#2490 conflict in z-index between main toolbar and structure pattern toolbar (#25)\n- - Integrate https://github.com/plone/mockup/pull/906 which fixes wrong in-path marking for similar pathnames. #26\n [agitator] (#26)\n\n\n1.0.2 (2019-03-21)\n------------------\n\nBug fixes:\n\n\n- Fix highlight of current item in nav for image and file.\n [agitator] (#18)\n- Fix less building error.\n [vangheem] (#19)\n- Update resources after alignment fix in Select2-based widgets\n [davilima6] (#21)\n\n\n1.0.1 (2019-03-12)\n------------------\n\nBug fixes:\n\n\n- Fix highlight of current item in nav for image and file.\n [agitator] (#18)\n- Update resources after alignment fix in Select2-based widgets\n [davilima6] (#21)\n\n\n1.0.0 (2019-03-04)\n------------------\n\nNew features:\n\n\n- Ship moment.js without locales, which are now lazily loaded in 'mockup' package\n [davilima6] (#10)\n\n\nBug fixes:\n\n\n- Customize select2 to work better with relateditems pattern, update compiled resources: plone, logged-in\n [MrTango] (#16)\n\n\n1.0a1 (2019-02-13)\n------------------\n\nNew features:\n\n\n- Put together all Plone assets in a single package. [thet] (#1)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi/plone.staticresources", "keywords": "Python Plone", "license": "GPL version 2", "maintainer": "", "maintainer_email": "", "name": "plone.staticresources", "package_url": "https://pypi.org/project/plone.staticresources/", "platform": "", "project_url": "https://pypi.org/project/plone.staticresources/", "project_urls": { "Homepage": "https://pypi.python.org/pypi/plone.staticresources" }, "release_url": "https://pypi.org/project/plone.staticresources/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Static resources for Plone", "version": "1.1.0" }, "last_serial": 5436016, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e8c6efa8494da20647e29726a09f6b13", "sha256": "5b0ef3975e777db6c2a9d20d43d82d2d334a4fd816652c7bb464a3c9a41ef1c5" }, "downloads": -1, "filename": "plone.staticresources-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e8c6efa8494da20647e29726a09f6b13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39731142, "upload_time": "2019-03-04T15:56:07", "url": "https://files.pythonhosted.org/packages/44/38/82951829357e6984edd9656478b1ab1f8a7cfa89b5ea0bb48a41d3d7a7e5/plone.staticresources-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "4a012ec6f542faf9c5ec813b41742398", "sha256": "3e7bab0808a6be8c04a2c1522aeb40dd6f2d978d0155b83918bbb56fb35ff779" }, "downloads": -1, "filename": "plone.staticresources-1.0.1.tar.gz", "has_sig": false, "md5_digest": "4a012ec6f542faf9c5ec813b41742398", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39731265, "upload_time": "2019-03-13T00:43:20", "url": "https://files.pythonhosted.org/packages/d1/bc/a47275483c7b460a58fd8a33e0c1b15b9487b19dceee518691eb1fcbf15d/plone.staticresources-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "01cf77913a032624d8fe46a5e15db5e6", "sha256": "5c75f7e8f46746ad020d17767dcaceaddd7a1a08abbac28e05a0c0dc87b0a37b" }, "downloads": -1, "filename": "plone.staticresources-1.0.2.tar.gz", "has_sig": false, "md5_digest": "01cf77913a032624d8fe46a5e15db5e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39730651, "upload_time": "2019-03-22T02:59:02", "url": "https://files.pythonhosted.org/packages/de/48/41d595972dac4094f2547a13a0cc5a8c536c48450fc315ca96f48e68187d/plone.staticresources-1.0.2.tar.gz" } ], "1.0a1": [ { "comment_text": "", "digests": { "md5": "46d1dcf129040b162875805e6176519b", "sha256": "16b124c9013f406812d1ea53524c6d061749f6f53256bdc292f954b6f0c3ca8f" }, "downloads": -1, "filename": "plone.staticresources-1.0a1.tar.gz", "has_sig": false, "md5_digest": "46d1dcf129040b162875805e6176519b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39852468, "upload_time": "2019-02-14T00:56:24", "url": "https://files.pythonhosted.org/packages/f6/27/84040be717558c61dcf50cd9e8c8822685fa157cb6914ae2274b2d5324bf/plone.staticresources-1.0a1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "fa514be9de3ef4be314aa68455953a01", "sha256": "da943d54d3c270ef41754f685e8b5b9c0909ed565d5d2c0bd9ca6e64f03979e1" }, "downloads": -1, "filename": "plone.staticresources-1.1.0.tar.gz", "has_sig": false, "md5_digest": "fa514be9de3ef4be314aa68455953a01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39652587, "upload_time": "2019-06-23T01:11:08", "url": "https://files.pythonhosted.org/packages/61/27/c9e122f8eec2f39be5ad9102c0499d50eb10aa04b525e4a716f4252587e0/plone.staticresources-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fa514be9de3ef4be314aa68455953a01", "sha256": "da943d54d3c270ef41754f685e8b5b9c0909ed565d5d2c0bd9ca6e64f03979e1" }, "downloads": -1, "filename": "plone.staticresources-1.1.0.tar.gz", "has_sig": false, "md5_digest": "fa514be9de3ef4be314aa68455953a01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39652587, "upload_time": "2019-06-23T01:11:08", "url": "https://files.pythonhosted.org/packages/61/27/c9e122f8eec2f39be5ad9102c0499d50eb10aa04b525e4a716f4252587e0/plone.staticresources-1.1.0.tar.gz" } ] }