-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem with TTW compilation of bundles.
Fixes #58
- Loading branch information
Showing
11 changed files
with
124 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix problem with TTW compilation of bundles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/plone/staticresources/static/webcompiler/less.js.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 6f0269fdaed7c12872e709c0a12c81e982f071da Mon Sep 17 00:00:00 2001 | ||
From: Johannes Raggam <thetetet@gmail.com> | ||
Date: Sun, 5 Jan 2020 13:04:17 +0100 | ||
Subject: [PATCH] less.js for uncached resource downloads Original | ||
commit by @vangheem: | ||
https://github.com/plone/Products.CMFPlone/commit/bd1f9ba99d1ad40bb7fe1c00eaa32b8884aae5e2 | ||
|
||
--- | ||
src/plone/staticresources/static/webcompiler/less.js | 10 +++++++++- | ||
1 file changed, 9 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/plone/staticresources/static/webcompiler/less.js b/src/plone/staticresources/static/webcompiler/less.js | ||
index fbbba14..e476c79 100644 | ||
--- a/src/plone/staticresources/static/webcompiler/less.js | ||
+++ b/src/plone/staticresources/static/webcompiler/less.js | ||
@@ -462,7 +462,15 @@ FileManager.prototype.loadFile = function loadFile(filename, currentDirectory, o | ||
return; | ||
} | ||
|
||
- this.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { | ||
+ /* XXX Plone hack to always re-download resource TTW */ | ||
+ var url = href; | ||
+ if(url.indexOf('?') === -1){ | ||
+ url += '?'; | ||
+ }else{ | ||
+ url += '&'; | ||
+ } | ||
+ url = url + "bust=" + (new Date()).getTime(); | ||
+ this.doXHR(url, options.mime, function doXHRCallback(data, lastModified) { | ||
// per file cache | ||
fileCache[href] = data; | ||
|
||
-- | ||
2.20.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From c950dbe7c16533e5040cceb22db62db8f244bdd7 Mon Sep 17 00:00:00 2001 | ||
From: Johannes Raggam <thetetet@gmail.com> | ||
Date: Sun, 5 Jan 2020 13:04:32 +0100 | ||
Subject: [PATCH] r.js for uncached resource downloads Original commit | ||
by @vangheem: | ||
https://github.com/plone/Products.CMFPlone/commit/2d3865805efc6b72dce236eb68e502d8c57717b6 | ||
|
||
--- | ||
src/plone/staticresources/static/webcompiler/r.js | 11 ++++++++++- | ||
1 file changed, 10 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/plone/staticresources/static/webcompiler/r.js b/src/plone/staticresources/static/webcompiler/r.js | ||
index ed177d8..d5e2573 100644 | ||
--- a/src/plone/staticresources/static/webcompiler/r.js | ||
+++ b/src/plone/staticresources/static/webcompiler/r.js | ||
@@ -25821,7 +25821,16 @@ define('build', function (require) { | ||
d.resolve(require._cachedRawText[path]); | ||
return d.promise; | ||
} else { | ||
- return file.readFileAsync(path, encoding).then(function (text) { | ||
+ | ||
+ /* XXX Plone hack to always re-download resource TTW */ | ||
+ var url = path; | ||
+ if(url.indexOf('?') === -1){ | ||
+ url += '?'; | ||
+ }else{ | ||
+ url += '&'; | ||
+ } | ||
+ url = url + "bust=" + (new Date()).getTime(); | ||
+ return file.readFileAsync(url, encoding).then(function (text) { | ||
require._cachedRawText[path] = text; | ||
return text; | ||
}); | ||
-- | ||
2.20.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<configure xmlns="http://namespaces.zope.org/zope" | ||
xmlns:gs="http://namespaces.zope.org/genericsetup"> | ||
|
||
<gs:registerProfile name="4" | ||
title="Change r.js and less.js paths for TTW compilation" | ||
description='Configuration for version 4' | ||
directory="profiles/4" | ||
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" /> | ||
|
||
<gs:upgradeSteps source="3" | ||
destination="4" | ||
profile="plone.staticresources:default"> | ||
|
||
<gs:upgradeDepends | ||
title="Change r.js and less.js paths for TTW compilation" | ||
import_profile="plone.staticresources.upgrades:4" /> | ||
|
||
</gs:upgradeSteps> | ||
|
||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
|
||
<include file="2.zcml" /> | ||
<include file="3.zcml" /> | ||
<include file="4.zcml" /> | ||
|
||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<registry> | ||
<record name="plone.resources.rjs"> | ||
<value>++plone++static/webcompiler/r.js</value> | ||
</record> | ||
<record name="plone.resources.lessc"> | ||
<value>++plone++static/webcompiler/less.js</value> | ||
</record> | ||
</registry> |