34895[BUGFIX] Split large CSS file automatically
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 3
Review log 38
Show 13 earlier messages
-
Jigal van Hemert uploaded patch set 1 12/01/14, 22:04
-
Markus Klein commented on patch set 1 12/01/14, 22:35
Hm, the splitting is now performed on every request, right? Moreover, I also would only add the necessary files from the Splitter lib. Just the php file, the licence and a readme that states the commit hash, which is used here. -
Andreas Kienast commented on patch set 1 12/02/14, 07:34
We should mention the library in "About TYPO3 CMS" > "External Libraries", shouldn't we? -
Jigal van Hemert commented on patch set 1 12/02/14, 07:49
> Hm, the splitting is now performed on every request, right? Splitting is done whenever the page renderer prepares a page with (optionally) concatenated and compressed CSS files. Different sources add CSS files. These are first concatenated (if that option is active), then compressed (if that option is active). After that we can see if the resulting files need to be split. Usually pages and the linked CSS files are cached and the splitting only takes place during rendering. There is no other place where the splitting is useful. It's possible that large files are added, but it can also happen that a lot of smaller files are combined into a merged file that is too big. Both need to be split. > Moreover, I also would only add the necessary files from the > Splitter lib. Just the php file, the licence and a readme that > states the commit hash, which is used here. Could be done, but I don't know if it's allowed by the license. If composer support is eventually added to the core we would probably also ship a downloadable package with the entire splitter lib. -
Mathias Brodala commented on patch set 1 12/02/14, 08:23
PageRenderer.php:2811Not 30 as written in Forge?PageRenderer.php:2811Not 4096 (4K)? -
Jigal van Hemert commented on patch set 1 12/02/14, 10:21
PageRenderer.php:2811ReplyCheck http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx?PageIndex=2#comments 4095 is mentioned there, but also 12 bits (which leads to 4096); 4095 limit in splitting seems safe and is not much difference. (Same for 31 vs 5 bits) -
Mathias Brodala commented on patch set 1 12/02/14, 10:34
Thanks for clarification, I added the link to the Forge ticket.PageRenderer.php:2811ReplyDone -
Markus Klein commented on patch set 1 CR -1 12/02/14, 12:10
Still, there is a logic within the merge to cache merged files. We should stick this logic to this place as well. -
Felix Kopp commented on patch set 1 12/02/14, 14:43
I am fine with postponing to 7.1 - In that case the 7.0 does not bring full IE9 backend support. I personally think IE9-support must be brought to 7 LTS, but not necessarily to the first iteration with 7.0. -
Sascha Egerer commented on patch set 1 CR -1 12/08/14, 10:05
I would not put this into the core! Why should we fix a bad CSS file in the typo3 core? If somebody has this issue he should think about his CSS file and not how to get it running in the browser! So if somebody need that i could write is own hook to fix that but as said i would not put this into core! -
Wouter Wolters commented on patch set 1 12/08/14, 10:22
@sascha the core css for the backend is already the problem. That is why this has been created. -
Sascha Egerer commented on patch set 1 CR 0 12/08/14, 10:26
For me that means we have to heavily refactor the css for 7.1. I'll remove my -1 for this but i really don't like this idea/workaround because it "hides" the real problem of a bad css file -
Jigal van Hemert commented on patch set 1 CR -2 12/08/14, 13:12
> For me that means we have to heavily refactor the css for 7.1. > I'll remove my -1 for this but i really don't like this > idea/workaround because it "hides" the real problem of a bad css > file I'll be working on the CSS concatenating and compressing shortly. Problems this splitting solves are: - CSS generated by tools like LESS/SASS/... can be large and the designer cannot really predict the number of selectors before it is generated - the backend CSS is currently larger than the limit for IE9 - concatenating small CSS files (also in frontend) creates less downloads per page, but can cross the limit for selectors (IE9 also has a limit of 31 CSS files per page) Since we offer automatic concatenation we should also fix the problems with large resulting files. This needs a bit more thought and planning to make it better cacheable (also for the backend) to lower the impact on the rendering time. Therefore I've blocked it myself with a -2 for the time being.
-
Sascha Egerer commented on patch set 1 12/08/14, 13:17
> CSS generated by tools like LESS/SASS/... can be large and the designer cannot really predict the number of selectors before it is generated Then they should stop using tools like less/sass. I still dislike this idea because it does not fix a real problem but is a workaround for bad code at a different place. -
Mathias Brodala commented on patch set 1 12/08/14, 13:19
> Then they should stop using tools like less/sass. I still dislike this idea because it does not fix a real problem but is a workaround for bad code at a different place. Correct, but who's gonna fix IE9 and lower? ;-) -
Benni Mack commented on patch set 1 01/31/15, 23:49
Jigal, can you still reproduce this issue in current master? We cleaned up the t3skin CSS a lot and the size got smaller by around 30% already. -
Jigal van Hemert commented on patch set 1 02/01/15, 12:52
> Jigal, can you still reproduce this issue in current master? We > cleaned up the t3skin CSS a lot and the size got smaller by around > 30% already. Size !== number of selectors. Besides, the problem is not only in the backend, but also for the frontend. As said before, we provide automatic concatenation of CSS and this can easily lead to CSS files which have more selectors than older versions of IE can handle. On the other hand, many small CSS files are slower to download and can also exceed the number of files which can be loaded by the same IE versions. Especially for FE use concatenation and splitting are simply necessary. -
Anja Leichsenring commented on patch set 1 03/02/15, 17:03
can we find a consensus here? Seems a legit issue, which is not solved yet. -
Anja Leichsenring commented on patch set 1 07/13/15, 10:42
still no action? Speak up please, otherwise I will abandon this patch in three weeks from now due to lack of activity. -
Jigal van Hemert commented on patch set 1 07/13/15, 15:47
> still no action? Speak up please, otherwise I will abandon this > patch in three weeks from now due to lack of activity. Shall we have a look somewhere between Thursday morning and Sunday afternoon? -
Alexander Opitz commented on patch set 1 08/26/15, 11:49
What's the state of this issue. IMHO the fix is necessary for BE and FE.PageRenderer.php:2811ReplyIs correct: - 4096 selectors (12bit) but the selector 0 is an IE internal selector who holds the pointer to the CSS file => 4095 for us. - 32 pointer to selectors but the first points to the browsers default CSS => 31 file pointer for us. -
Jigal van Hemert commented on patch set 1 08/29/15, 17:51
Tomorrow I'll try to refactor the Splitter class. Currently it has to process the entire CSS multiple times: once to count and each time a block is created. It will still cost some time during a request, but it can be reduced a lot if it's also incorporated in the concatenation process. -
Sascha Egerer commented on patch set 1 CR -1 09/25/15, 14:04
Don't forget to update the composer.lock file. If no dependencies have changed then use "composer update --lock" -
Jigal van Hemert commented on patch set 1 09/26/15, 18:12
As mentioned in the forge issue: I contacted the author of the splitter and we're introducing caching of the parsed CSS to speed up the process (it was parsed on each call to count and splitting off each part). Once the final change is in up-stream we can simply use the library via composer. -
Benni Mack commented on patch set 1 03/03/16, 17:59
Jigal, are you going to update the patch? -
Mathias Schreiber wrote 04/09/16, 20:12
Topic set to UXW -
Mathias Schreiber commented on patch set 1 04/09/16, 20:26
Notes from discussing with Benji and Frank: - Rebuild based on composer - Only run splitting when concatenation has been turned ON. We will try to make it happen during UXW -
Frank Nägler uploaded patch set 2 04/10/16, 12:37
-
Frank Nägler commented on patch set 2 04/10/16, 12:39
@Jigal: patch updated to use composer and run only if concatenation is turned on. please remove your -2 and test your patch :) -
Riccardo De Contardi commented on patch set 2 04/10/16, 16:45
when using composer install, I got the message: "Package csssplitter/cssplitter is abandoned, you should avoid using it. Use dlundgren/css-splitter instead." -
Jigal van Hemert voted on patch set 2 CR 0 04/10/16, 17:12
-
Jigal van Hemert commented on patch set 2 04/10/16, 17:36
The more I think about it, the more I have my doubts about this feature. Market share of IE 10 and lower is decreasing rapidly as Microsoft pushes IE11 and has ended support of older versions. For the BE we can drop it completely if we either raise requirements to IE11 or do the splitting while processing the CSS. For FE we'd do this for approx. 17% of the browsers, but how low is this number at the time of the release of 8LTS?composer.json:52The original already used dlundgren's css splitterPageRenderer.php:2843For BE we should probably turn it off completely. We have full control over the BE CSS. It was in TYPO3 7 only needed for IE9 and Microsoft now only supports the latest Internet Explorer (currently IE11). For TYPO3 8 we can raise the requirements for the BE to IE11+.PageRenderer.php:2863After splitting, shouldn't we remove the not-splitted file? It's no longer in $this->cssFiles, but still present in the file system and it's not the original. -
Benni Mack commented on patch set 2 04/11/16, 05:03
Hey Jigal, yeah, good point, I agree. - It's for IE9 and below, and only for problems with large CSS files, which is really a minority in the web and on websites, and will get less and less traction. - The issue originally came up (I think) in Nov 2014 because of the bloated backend CSS which we cleaned up (for v7, for v8 we support IE11+ as you stated) - If someone needs to split up the CSS files for their frontend, they can use grunt etc or something else to take care of it. Feel free to abandon the patch -
Frank Nägler commented on patch set 2 04/11/16, 07:18
before abandon, please lets wait of the feedback from Benji Kott. I patched new set because we want this feature in. I will ask him in some hours. -
Jigal van Hemert commented on patch set 2 04/11/16, 08:05
> before abandon, please lets wait of the feedback from Benji Kott. I > patched new set because we want this feature in. > I will ask him in some hours. Please consider this: - it costs performance during page rendering (even though I added caching of the parsed CSS blocks in dlundgren's CSS splitter the initial counting still has to parse the CSS) - for 8 LTS it's not needed in the BE anymore (IE11+, we process CSS ourselves) - it's only useful if an integrator relies on extensions adding their own CSS, concatenation is enabled and the integrator is not able to process the entire CSS themself. Perhaps we can turn it into a FE-only feature that can be enabled with a TS setting? -
Frank Nägler commented on patch set 2 04/14/16, 11:48
@Jigal: After talking to Benji we would prefer to abandon this patch. If you agree, please do so. -
Benni Mack commented on patch set 2 04/14/16, 12:13
yes, I agree. if somebody needs it badly, it *can* be achieved with an extension (maybe some XCLASSES involved... ;)) -
Jigal van Hemert abandoned the change 04/14/16, 15:07
Consensus: for BE not needed, for FE only for legacy browsers (IE < 9). Now that MS has stopped support of these the market share will rapidly decline. Due to the performance impact the core will not provide this functionality.