Re-compiled Coffee-Scripts with version 1.12.7 #842
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
We can not use Coffee Script versions >= 2to compile our coffee script files
The reason is that newer CS version compile template strings into ES compatible templatesliterals:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
But these Template Literals are not cached correctly in Plone's portal_javascripts and it comes to failures with the global jQuery $ variable.
Please see here the differences between compiling code with CoffeeScript version 2.2.3 (the code removed -) and CoffeeScript version
1.12.7 (the code added +)
Therefore, ensure you have CoffeeScript version 1.12.7 installed on your system
npm list -g | grep coffeescript
Install it like this:
npm install -g "coffeescript@<2"
Ensure you have it like this:
Current behavior before PR
Analysis Category Expansion fails in Production Mode with this Error:
Uncaught SyntaxError: Unexpected identifier
Desired behavior after PR is merged
JS logic works fine in Production Mode
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.