In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ]  Related Changesets ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0000457 [In-Portal CMS] Front End feature request always 2009-12-16 14:45 2010-07-22 15:06
Reporter Dmitry View Status public Project Name In-Portal CMS
Assigned To !COMMUNITY Developer
Priority normal Resolution fixed Fixed in Version 5.1.0-B1
Status closed Product Version 5.0.1 Target Version 5.1.0
Time EstimateNo estimate
Summary 0000457: Automatic CSS / JS Compression
Description The elegant and simple implementation (doesn't exist yet) of solving problems with large javascript, css files being sent on every page load.

Instead of
<script type="text/javascript"
src="<inp2:m_TemplatesBase/>js/script.js"></script>

we should use

<script type="text/javascript" src="<inp2:m_Script
file="js/script.js"/>"></script>


Tag Script would:

1. get compressed version of given file based on current theme (compressed
versions could be stored under "/system/cache")

2. if given file was changed after compressed file was created, then create
compressed file with file modification time in it's name and return url to
compressed file

3. if given file wasn't changed after compressed file was created, then
return url to compressed file


There would not be any additional calls to index.php to load every
compressed javascript, because of tag implementation is being used. What
ever compression is made or not could be determined by new configuration
variable. Compression could be turned off automatically, when debug mode is
turned on for example. What compressor to use would be determined based on
given file extension. What compressor engine to use will be determined in
later development stages of this feature (command-line, php, java etc.).


NOTE:

We should be able to process multiple JS files (and probably CSS) in a single minimized version.

Let's say I want something like this <script type="text/javascript"
src="<inp2:m_Script file="js/script.js|js/another_jq.js"/>"></script>
I did see it a few times like this - can't remember the software /
website, but will find this and put examples here.
Additional Information
Tags No tags attached.
Reference Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/d81f3bf4d0f0bd38
Change Log Message Ability to automatically compress JS and CSS files on request
Estimate Points 0
Attached Files patch file icon js_css_compress_core.patch [^] (44,612 bytes) 2010-05-04 14:05 [Show Content]
patch file icon js_css_compress_modules.patch [^] (1,554 bytes) 2010-05-04 14:05 [Show Content]
patch file icon js_css_compress_themes.patch [^] (41,426 bytes) 2010-05-04 14:06 [Show Content]
patch file icon disabled_compression_during_debugging.patch [^] (449 bytes) 2010-05-12 04:38 [Show Content]
patch file icon infinite_compression_fix.patch [^] (744 bytes) 2010-05-15 07:36 [Show Content]
patch file icon still_using_old_compressed_code_after_upgrade.patch [^] (410 bytes) 2010-05-18 08:02 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to 0000704closed (5.1.0)alex Improvements to "E-mail Template" editing 
parent of 0000761closed (5.1.0)alex Bug related to SSL in JS/CSS compress feature 
parent of 0001167closed (5.2.0)alex Improvements in Compressed CSS/JS File Naming 
has duplicate 0000040closed (Icebox)Dmitry Issues with JavaScript and CSS Caching 
related to 0000752closed (5.1.0)alex Uploader javascript is not compressed 
related to 0001177closed (5.2.0)alex Debug version of CSS/JS files (decompressed) loaded even after Debug is Disabled via Cookies 

-  Notes
User avatar (0002053)
alex (manager)
2010-05-04 14:17

Tag "m_Compress" added. Supported usages are (you can also use "css", where I use "js" in examples):

1. <inp2:m_Compress files='path/to/file_a.js|path/to/file_b.js'/>

Will use relative paths to css/js files or complete urls (from any js/css from the site) as input and:
- will combine contents of all listed files into once single file
- minify that file
- return full url to that file

2. <inp2:m_Compress files='path/to/file_a.js|path/to/file_b.js' to="var_name"/>

Will put all listed files to variable given in "to" parameter for later usage (like queuing)

3. <inp2:m_Compress from="var_name"/>

Will act like "1." except, that actual files will be retrieved from variable given in "from" parameter and not from "files" parameter as usual.

4. <inp2:m_Compress type="js">
sample js code here to replace with minified version
</inp2:m_Compress>

Will minify code inside "m_Compress" tag and replace original code.
User avatar (0002055)
Dmitry (manager)
2010-05-04 20:32

Tested good, please commit!
User avatar (0002056)
alex (manager)
2010-05-05 01:37

Since all "CSS" files are compressed into same path under /system/cache folder, then relative paths to images inside CSS files won't work.

As work around I've introduced "@templates_base@" string, that can be placed into CSS file being compressed. During compression it will be replaced to full url to theme (without trailing slash).
User avatar (0002057)
alex (manager)
2010-05-05 02:06

Fix committed to 5.1.x branch. Commit Message:

Fixes 0000457: Automatic CSS / JS Compression
User avatar (0002196)
alex (manager)
2010-05-12 04:39

Patch "disabled_compression_during_debugging.patch" (already commited) disables compression even, when we are debugging using Zend Studio.
User avatar (0002210)
alex (manager)
2010-05-15 07:39

Patch "infinite_compression_fix.patch" (already commited) fixes case, that files got re-compressed again and again when I switch debug mode on and off (debug file generation time was overwriting non-debug file generation time and so on).
User avatar (0002217)
Dmitry (manager)
2010-05-16 22:05

Tested good.
User avatar (0002227)
alex (manager)
2010-05-18 08:02

All compressed code is not updated during upgrade to new version (e.g. from 5.1.0 to 5.1.1), since theme cache is not rebuild on upgrade.
User avatar (0002228)
alex (manager)
2010-05-18 08:03

Patch "still_using_old_compressed_code_after_upgrade.patch" fixes compressed file cache not being reset during upgrade.
User avatar (0002238)
Dmitry (manager)
2010-05-18 20:24

New patch tested good, please commit.
User avatar (0002250)
alex (manager)
2010-05-19 02:45

Fix committed to 5.1.x branch. Commit Message:

Fixes 0000457: Automatic CSS / JS Compression
User avatar (0002340)
Dmitry (manager)
2010-05-30 19:37

UPDATE:

There are some JS errors when compression is ON or OFF in IE 8 with compatibility mode On or IE7. All details posted here.

Below are the error list provided by IE (I am trying to go to Polls grid after login)

=============
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.4; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Timestamp: Mon, 31 May 2010 00:25:55 UTC


Message: Expected identifier, string or number
Line: 1079
Char: 235
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/system/cache/c_1159502181_1275265484.js


Message: 'TB' is undefined
Line: 31
Char: 1
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-tree:m0--1--s-


Message: Object expected
Line: 13
Char: 2
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/core/admin_templates/js/tree.js


Message: Object expected
Line: 301
Char: 2
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/core/admin_templates/js/tree.js


Message: 'Application' is undefined
Line: 359
Char: 3
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-tree:m0--1--s-


Message: Expected identifier, string or number
Line: 1079
Char: 235
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/system/cache/c_1159502181_1275265484.js


Message: Expected identifier, string or number
Line: 1079
Char: 235
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/system/cache/c_1159502181_1275265484.js


Message: 'TB' is undefined
Line: 30
Char: 1
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'TB' is undefined
Line: 31
Char: 1
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-head:m0--1--s-


Message: Object expected
Line: 217
Char: 3
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'AjaxPopupManager' is undefined
Line: 188
Char: 2
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-head:m0--1--s-


Message: 'ToolBar' is undefined
Line: 233
Char: 7
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'Application' is undefined
Line: 286
Char: 3
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-head:m0--1--s-


Message: 'ToolBar' is undefined
Line: 305
Char: 8
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'GridScrollers' is undefined
Line: 362
Char: 3
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'Grids' is undefined
Line: 525
Char: 2
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-


Message: 'Application' is undefined
Line: 548
Char: 3
Code: 0
URI: http://www.jurmala.com/SVN/5.1.x/admin/index.php?env=-in-bulletin/polls/poll_list:m0--1--s-
===============
User avatar (0002346)
alex (manager)
2010-05-31 04:56

There is no problem with compression at all. Since now all JS is merged into one file, then you will see errors from all js files on every page, even if it's not used there.

In this case, problem was in "form_controls.js" file with trailing comma in object declaration. Problem was moved here 0000757. Please test this task and I will make it resolved.
User avatar (0002348)
Dmitry (manager)
2010-05-31 14:52

Completed.
User avatar (0002349)
Dmitry (manager)
2010-05-31 14:52

Reopened by mistaken.
User avatar (0002519)
alex (manager)
2010-07-22 15:06

Closing, since 5.1.0 release has been released.

- Related Changesets
In-Portal CMS: 5.1.x r13585
Timestamp: 2010-05-19 02:45:55
Author: alex
Details ] Diff ]
Fixes 0000457: Automatic CSS / JS Compression
mod - /in-portal/branches/5.1.x/core/install.php Diff ] File ]
In-Portal CMS: 5.1.x r13564
Timestamp: 2010-05-15 07:39:25
Author: alex
Details ] Diff ]
1. Bug 0000457: Automatic CSS / JS Compression
2. Fixes case, that files got re-compressed again and again when I switch debug mode on and off.
mod - /in-portal/branches/5.1.x/core/units/helpers/minifiers/minify_helper.php Diff ] File ]
In-Portal CMS: 5.1.x r13560
Timestamp: 2010-05-12 04:40:13
Author: alex
Details ] Diff ]
1. Bug 0000457: Automatic CSS / JS Compression
2. Disables compression even, when we are debugging using Zend Studio
mod - /in-portal/branches/5.1.x/core/units/helpers/minifiers/minify_helper.php Diff ] File ]
In-Portal CMS: 5.1.x r13487
Timestamp: 2010-05-05 02:06:05
Author: alex
Details ] Diff ]
Fixes 0000457: Automatic CSS / JS Compression
mod - /in-portal/branches/5.1.x/core/admin_templates/browser/browser_header.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/catalog/advanced_view.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/catalog/catalog.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/catalog/item_selector/item_selector_toolbar.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/incs/grid_blocks.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/incs/header.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/reviews/reviews.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/sections_list.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/admin_templates/users/user_edit_items.tpl Diff ] File ]
mod - /in-portal/branches/5.1.x/core/kernel/nparser/nparser.php Diff ] File ]
mod - /in-portal/branches/5.1.x/core/kernel/nparser/ntags.php Diff ] File ]
mod - /in-portal/branches/5.1.x/core/units/categories/categories_tag_processor.php Diff ] File ]
add - /in-portal/branches/5.1.x/core/units/helpers/minifiers File ]
add - /in-portal/branches/5.1.x/core/units/helpers/minifiers/css_minify_helper.php File ]
add - /in-portal/branches/5.1.x/core/units/helpers/minifiers/js_minify_helper.php File ]
add - /in-portal/branches/5.1.x/core/units/helpers/minifiers/minifiers_config.php File ]
add - /in-portal/branches/5.1.x/core/units/helpers/minifiers/minify_helper.php File ]
mod - /in-portal/branches/5.1.x/core/units/helpers/themes_helper.php Diff ] File ]
Modules :: In-Commerce: 5.1.x r13486
Timestamp: 2010-05-05 01:48:30
Author: alex
Details ] Diff ]
Bug 0000457: Automatic CSS / JS Compression
mod - /w/in-commerce/branches/5.1.x/admin_templates/orders/orders_print.tpl Diff ] File ]
Themes :: Simple: 1.1.x r13484
Timestamp: 2010-05-05 01:40:22
Author: alex
Details ] Diff ]
Bug 0000457: Automatic CSS / JS Compression
mod - /themes/simple/branches/1.1.x/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/content.css Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/layout.css Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/override.css Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/print.css Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/screen.css Diff ] File ]
mod - /themes/simple/branches/1.1.x/inc/typography.css Diff ] File ]
Themes :: OnlineStore: 1.1.x r13483
Timestamp: 2010-05-05 01:38:49
Author: alex
Details ] Diff ]
Bug 0000457: Automatic CSS / JS Compression
mod - /themes/onlinestore/branches/1.1.x/inc/lbox/lightbox.css Diff ] File ]
mod - /themes/onlinestore/branches/1.1.x/platform/blocks/common/html_head.tpl Diff ] File ]
Themes :: Default: 5.1.x r13482
Timestamp: 2010-05-05 01:37:57
Author: alex
Details ] Diff ]
Bug 0000457: Automatic CSS / JS Compression
mod - /themes/default/branches/5.1.x/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/default/branches/5.1.x/inc/styles.css Diff ] File ]
Themes :: Advanced: 1.1.x r13481
Timestamp: 2010-05-05 01:34:51
Author: alex
Details ] Diff ]
Bug 0000457: Automatic CSS / JS Compression
mod - /themes/advanced/branches/1.1.x/in-bulletin/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/in-bulletin/inc/styles.css Diff ] File ]
mod - /themes/advanced/branches/1.1.x/in-commerce/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/in-link/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/in-news/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/platform/designs/default_design.des.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/platform/elements/html_head.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/platform/elements/menu.elm.tpl Diff ] File ]
mod - /themes/advanced/branches/1.1.x/platform/inc/dmenu.css Diff ] File ]
mod - /themes/advanced/branches/1.1.x/platform/inc/styles.css Diff ] File ]

- Issue History
Date Modified Username Field Change
2011-12-08 03:46 alex Relationship added related to 0001177
2011-12-02 04:56 alex Relationship replaced has duplicate 0000040
2011-11-13 17:08 Dmitry Relationship added parent of 0001167
2010-08-31 14:23 alex Relationship added related to 0000040
2010-07-22 15:06 alex Note Added: 0002519
2010-07-22 15:06 alex Status resolved => closed
2010-06-08 03:30 alex Relationship added parent of 0000761
2010-05-31 14:52 Dmitry Note Added: 0002349
2010-05-31 14:52 Dmitry Status reviewed and tested => resolved
2010-05-31 14:52 Dmitry Resolution reopened => fixed
2010-05-31 14:52 Dmitry Note Added: 0002348
2010-05-31 14:52 Dmitry Status needs testing => reviewed and tested
2010-05-31 04:56 alex Note Added: 0002346
2010-05-31 04:56 alex Assigned To alex => !COMMUNITY
2010-05-31 04:56 alex Status needs feedback => needs testing
2010-05-30 19:37 Dmitry Note Added: 0002340
2010-05-30 19:37 Dmitry Status resolved => needs feedback
2010-05-30 19:37 Dmitry Resolution fixed => reopened
2010-05-29 16:38 alex Relationship added related to 0000752
2010-05-19 02:45 alex Changeset attached 5.1.x r13585
2010-05-19 02:45 alex Note Added: 0002250
2010-05-19 02:45 alex Status reviewed and tested => resolved
2010-05-19 02:45 alex Resolution reopened => fixed
2010-05-18 20:24 Dmitry Note Added: 0002238
2010-05-18 20:24 Dmitry Assigned To !COMMUNITY => alex
2010-05-18 20:24 Dmitry Status needs testing => reviewed and tested
2010-05-18 08:03 alex Relationship added related to 0000704
2010-05-18 08:03 alex Note Added: 0002228
2010-05-18 08:03 alex Status needs feedback => needs testing
2010-05-18 08:02 alex File Added: still_using_old_compressed_code_after_upgrade.patch
2010-05-18 08:02 alex Assigned To alex => !COMMUNITY
2010-05-18 08:02 alex Note Added: 0002227
2010-05-18 08:02 alex Status resolved => needs feedback
2010-05-18 08:02 alex Resolution fixed => reopened
2010-05-16 22:05 Dmitry Note Added: 0002217
2010-05-15 07:39 alex Note Added: 0002210
2010-05-15 07:39 alex Changeset attached 5.1.x r13564
2010-05-15 07:36 alex File Added: infinite_compression_fix.patch
2010-05-12 04:40 alex Changeset attached 5.1.x r13560
2010-05-12 04:39 alex Note Added: 0002196
2010-05-12 04:38 alex File Added: disabled_compression_during_debugging.patch
2010-05-05 02:06 alex Note Added: 0002057
2010-05-05 02:06 alex Status reviewed and tested => resolved
2010-05-05 02:06 alex Fixed in Version => 5.1.0-B1
2010-05-05 02:06 alex Resolution open => fixed
2010-05-05 02:06 alex Changeset attached 5.1.x r13487
2010-05-05 01:48 alex Changeset attached 5.1.x r13486
2010-05-05 01:43 alex Changeset attached 5.1.x r13485
2010-05-05 01:40 alex Changeset attached 1.1.x r13484
2010-05-05 01:38 alex Changeset attached 1.1.x r13483
2010-05-05 01:37 alex Changeset attached 5.1.x r13482
2010-05-05 01:37 alex Note Added: 0002056
2010-05-05 01:34 alex Changeset attached 1.1.x r13481
2010-05-04 20:32 Dmitry Note Added: 0002055
2010-05-04 20:32 Dmitry Assigned To !COMMUNITY => alex
2010-05-04 20:32 Dmitry Status needs testing => reviewed and tested
2010-05-04 14:17 alex Note Added: 0002053
2010-05-04 14:17 alex Assigned To alex => !COMMUNITY
2010-05-04 14:17 alex Developer => alex
2010-05-04 14:17 alex Status needs work => needs testing
2010-05-04 14:06 alex File Added: js_css_compress_themes.patch
2010-05-04 14:05 alex File Added: js_css_compress_modules.patch
2010-05-04 14:05 alex File Added: js_css_compress_core.patch
2010-04-28 11:45 Dmitry Change Log Message => Ability to automatically compress JS and CSS files on request
2010-04-28 11:45 Dmitry Status active => needs work
2010-04-12 16:52 Dmitry Status needs work => active
2010-04-08 23:57 Dmitry Assigned To => alex
2010-04-08 23:57 Dmitry Status active => needs work
2010-04-08 23:57 Dmitry Description Updated View Revisions
2010-04-08 23:56 Dmitry Target Version Icebox => 5.1.0
2009-12-16 15:03 Dmitry Target Version => Icebox
2009-12-16 14:45 Dmitry New Issue
2009-12-16 14:45 Dmitry Reference => Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/d81f3bf4d0f0bd38



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker