Skip to content
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

Replace slimit with calmjs.parse #2616

Merged
merged 2 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ Bug fixes:
- Remove ``plone-generate-gruntfile`` (it is all available through ``plone-compile-resources``).
[jensens]

- Migrate from ``slimit`` to ``calmjs.parse`` for the JavaScript cooker #2616
[metatoaster]


New Features:

Expand Down
4 changes: 2 additions & 2 deletions Products/CMFPlone/resources/browser/cook.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from calmjs.parse import es5
from datetime import datetime
from io import BytesIO
from plone.protect.interfaces import IDisableCSRFProtection
Expand All @@ -10,7 +11,6 @@
from Products.CMFPlone.interfaces.resources import OVERRIDE_RESOURCE_DIRECTORY_NAME # noqa
from Products.CMFPlone.resources.browser.combine import combine_bundles
from scss import Compiler
from slimit import minify
from zExceptions import NotFound
from zope.component import getUtility
from zope.component.hooks import getSite
Expand Down Expand Up @@ -121,7 +121,7 @@ def cookWhenChangingSettings(context, bundle=None):
cooked_js += '\n/* resource: {0} */\n{1}'.format(
resource.js,
js if '.min.js' == resource.js[-7:] else
minify(js, mangle=False, mangle_toplevel=False)
es5.minify_print(js)
)
except SyntaxError:
cooked_js +=\
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'AccessControl >= 4.0b1',
'Acquisition',
'borg.localrole',
'calmjs.parse',
'DateTime',
'ExtensionClass',
'five.customerize',
Expand Down Expand Up @@ -110,7 +111,6 @@
'pyScss',
'setuptools>=36.2',
'six',
'slimit',
'transaction',
'z3c.autoinclude',
'ZODB3',
Expand Down