{ "info": { "author": "Baptiste Fontaine", "author_email": "b@ptistefontaine.fr", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "==============\nwebassets-iife\n==============\n\n.. image:: https://img.shields.io/travis/bfontaine/webassets-iife.png\n :target: https://travis-ci.org/bfontaine/webassets-iife\n :alt: Build status\n\n.. image:: https://img.shields.io/coveralls/bfontaine/webassets-iife/master.png\n :target: https://coveralls.io/r/bfontaine/webassets-iife?branch=master\n :alt: Coverage status\n\n.. image:: https://img.shields.io/pypi/v/webassets-iife.png\n :target: https://pypi.python.org/pypi/webassets-iife\n :alt: Pypi package\n\n.. image:: https://img.shields.io/pypi/dm/webassets-iife.png\n :target: https://pypi.python.org/pypi/webassets-iife\n\n``webassets-iife`` is a webassets_ filter to wrap a JavaScript bundle in an\nIIFE to prevent global leaks and improve minification.\n\n.. _webassets: https://webassets.readthedocs.org/en/latest/\n\nInstall\n-------\n\n.. code-block::\n\n pip install webassets-iife\n\nUsage\n-----\n\nFor example with Flask:\n\n.. code-block::\n\n from flask.ext.assets import Environment, Bundle\n from webassets_iife import IIFE\n\n # ...\n\n assets = Environment(app)\n\n js = Bundle('myscript1.js',\n 'myscript2.js',\n filters=(IIFE, 'closure_js'), output='all.min.js')\n assets.register('js_all', js)\n\nThis will concat ``myscript1.js`` and ``myscript2.js`` into one JS chunk, wrap\nit in an IIFE and minify it.\n\nIIFE?\n-----\n\nAn *IIFE* is an Immediately-Invoked Function Expression. It\u2019s an anonymous\nfunction that\u2019s declared and invoked immediately after that. It\u2019s used in\nJavaScript to create a closed environment which can\u2019t be accessed from the\noutside.\n\n.. code-block::\n\n // a and b can be accessed by external code\n var a = 3,\n b = 1;\n // ... some code ...\n\n // a and b can't be accessed by external code\n (function() {\n var a = 3,\n b = 1;\n // ... some code ...\n })();\n\nWrapping code in an IIFE helps the minifier see the dead code, because it\n*knows* that these local variables can\u2019t be accessed from the outside and thus\ncan remove them or mangled their name.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bfontaine/webassets-iife", "keywords": null, "license": "Copyright \u00a9 2014 \u2013 Baptiste Fontaine\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "webassets-iife", "package_url": "https://pypi.org/project/webassets-iife/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webassets-iife/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bfontaine/webassets-iife" }, "release_url": "https://pypi.org/project/webassets-iife/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "IIFE filter for webassets", "version": "0.1.0" }, "last_serial": 1040209, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4ea95d700a75052eb6119fd3d65fa20e", "sha256": "37ba9f12af74b188d758714f6227923b7ea8824802de5b36cafe29f3a7153e39" }, "downloads": -1, "filename": "webassets-iife-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4ea95d700a75052eb6119fd3d65fa20e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2498, "upload_time": "2014-03-24T22:53:37", "url": "https://files.pythonhosted.org/packages/0e/3d/cfcc1aa6b41021842b67369f9876bd3d53d46459067531845098a99917df/webassets-iife-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "86e3b20568900838aae6def59f282490", "sha256": "4f782a4510cb427aa96f510b23ac7391449668ea3213bf2ff38197837a8ced7b" }, "downloads": -1, "filename": "webassets-iife-0.0.2.tar.gz", "has_sig": false, "md5_digest": "86e3b20568900838aae6def59f282490", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2606, "upload_time": "2014-03-24T22:56:09", "url": "https://files.pythonhosted.org/packages/c0/86/3160cafd2b6c681fc929348fa10053f3bb9b46cd105fe679c6a6f9e35620/webassets-iife-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "c6e86447e76df42e201af31f05b4c198", "sha256": "ac9769ecb303e4b2364b2b1da3a300d1118012dc8faeb54f9f6a63b3029e2771" }, "downloads": -1, "filename": "webassets-iife-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c6e86447e76df42e201af31f05b4c198", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3268, "upload_time": "2014-03-25T09:09:07", "url": "https://files.pythonhosted.org/packages/d7/8a/4da381a1c8dc81d0a23751d6e72cbc47dbee8745fba465717404dd5a6ae9/webassets-iife-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c6e86447e76df42e201af31f05b4c198", "sha256": "ac9769ecb303e4b2364b2b1da3a300d1118012dc8faeb54f9f6a63b3029e2771" }, "downloads": -1, "filename": "webassets-iife-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c6e86447e76df42e201af31f05b4c198", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3268, "upload_time": "2014-03-25T09:09:07", "url": "https://files.pythonhosted.org/packages/d7/8a/4da381a1c8dc81d0a23751d6e72cbc47dbee8745fba465717404dd5a6ae9/webassets-iife-0.1.0.tar.gz" } ] }