This is a migrated thread and some comments may be shown as answers.

[Solved] COmment regarding Rad Script and Style SHeet Managers

6 Answers 271 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 16 Jan 2008, 09:48 AM

Hi Guys,

I am Just playing around with the RadStyleSheetManager and RadScriptManager  ( Prometheus Q3 SP1).

I used “<asp:ScriptReference>” to reference my own script with “asp:scriptmanager>” . But for the RadScriptManager what do I use. I can’t find any kind of documentation on this. I used  “<asp:ScriptManager>” and it works! The RadScriptManager doesn’t provide any intellisence help to add those tags?

When combine the scripts using RadScript manager it combines all my own scripts as well when I put my script under “Scriptreference”. Is possible to make scripts in each script tags combined separately?

Is it possible to combine the scripts of a rad control separately from another rad control. For an example if I have a radGrid and a radEditor, I should get two different combined scripts.

How do I add my own style sheet to the RadStyleSheetManager? Like I asked for RasScriptManager, is it possible to combine my own CSS file separate from Rad Control s. And Is it possible to combine the style of a rad control separately from another rad control?

I would like see to more flexibility with Rad Style and script managers, otherwise it will look like another ajax toolkit manager!

Cheer,

Shane

6 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 16 Jan 2008, 01:32 PM
Hi Shane,

Basically RadScriptManager control either combines all the ScriptReferences having their Assembly property defined, or it does not combine any ScriptReferences. The regular scripts, referenced only by their Path property are output properly and are not combined. Currently there is a limitation in the ScriptReference support of RadScriptManager - the approach to override a ScriptReference by defining it with a different Path does not work as in the regular ScriptManager control.

We are investigating the lack of intellisense for the control's Scripts property. We hope we will be able to fix that for the next service pack of the RadControls "Prometheus" suite.

Up to the other questions:
  • "When combine the scripts using RadScript manager it combines all my own scripts as well when I put my script under “Scriptreference”. Is possible to make scripts in each script tags combined separately?"
    Actually, no matter how many <Scripts> tags you have, all these refer to a single ScriptReferenceCollection, which makes it impossible to determine script groups at runtime. Can you please, help us and describe the scenario in which you need such grouping? What we can do is separate the scripts being grouped by their Assembly property, but I am not sure how can this fit your scenario.
  • "Is it possible to combine the scripts of a rad control separately from another rad control. For an example if I have a radGrid and a radEditor, I should get two different combined scripts."
    As all RadControls "Prometheus" use the same codebase, such a separation would be a very hard one. Again, can you help us by describing why you need such a grouping?
  • "How do I add my own style sheet to the RadStyleSheetManager? Like I asked for RasScriptManager, is it possible to combine my own CSS file separate from Rad Control s. And Is it possible to combine the style of a rad control separately from another rad control?"
    We are now working on providing StyleSheetReferences for RadStyleSheetManager, similar to the ScriptReferences of RadScriptManager and I hope we will have such for the next service pack of the control.
  • "And the scripts for the controls are not Minified! How do I enable that?"
    RadScriptManager implements only gzip compression for the browsers supporting it. The optimization the control makes is the reduced script reference number and the improved script loading time. For additional js code compression you can use a javascript compression tool to have the scripts you embed in the assembly minimized.
Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shane
Top achievements
Rank 1
answered on 16 Jan 2008, 08:40 PM
Hi Erjan,

Thanks for your reply!

  1. I have a RadScriptManager in the master page and the scripts that are used across all the pages. Then I have a scriptmanagerproxy in some pages where I referenced scripts which are used in only that page. So I would like to combined these script separately. So they can be cached and the size of the combined script will become smaller.
  2. I have a radgrid in one page and radgird , radeditor in another page. If I can combine controls scripts separately, than the second page only needs to download the script that is needed for radeditor. Radgrid script will be available already because it is been cached.
  3. Thanks for that. Please consider this when you develop "like I asked for RasScriptManager, is it possible to combine my own CSS file separate from Rad Control s. And Is it possible to combine the style of a rad control separately from another rad control?" Any time frame on this?
  4. Sorry I wasn't clear. I met to say radscripts are not minified. How do I menify the radscripts (scripts that belongs to rad controls)?
Cheers,
Shane
0
Erjan Gavalji
Telerik team
answered on 17 Jan 2008, 11:18 AM
Hi Shane,

RadScriptManager is designed to allow per-page script caching. If a per-control caching is available, there is a chance that a page will have a lot of <script> tags output, which still reduces the page load time.

Our controls are built in a way that as much as possible of the code is combined in a single file. For example, different features of RadEditor "Prometheus" are pre-combined to single files, RadMenu "Prometheus" files are combined in a single file, etc.

I am still not sure about the "minified" scripts. We use a tool to pre-compress the javascript files to be included in the built assembly. Although there are possibilities to obfuscate the code, we decided to not do that for the reasons below:
  • Obfuscation makes the code harder to debug;
  • Variable/class name collisions can occur when using different controls and third-party javascript code.
The only minification that we thought adding is removing the newlines from the compressed javascript files, but we decided not to implement that for the debugging reasons.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shane
Top achievements
Rank 1
answered on 17 Jan 2008, 08:53 PM
Hi Erjan,

Thanks for your explanation! :)

I don’t want to use too many script tags; I want to have a script tag in the master page and in a page. So I can have a global combined scripts that is used by all the pages and local combined scripts that is been used by a particular page. By used page level combined scripts, each page is going to download a copy of the script which is I don’t want.

I understand that you are already combining scripts together, but if I combine the scripts of a control together, then it will only be downloaded once.

Minify = obfuscate. Minify is the term that is used in the YSlow.

I don’t see your reason for not obfuscate as valid! I only need to debug in the development environment. What about the live environment? But I am not very concern about this matter. But if you could include a debug, live version to the controls, it would be great. Extra spaces and new lines should be taken out and be properly obfuscated (live script), the debug script do not need these.

0
Erjan Gavalji
Telerik team
answered on 18 Jan 2008, 08:20 AM
Hi Shane,

Indeed, the suggestion for resource grouping is good for RadScriptManager and RadStyleSheetManager. We will consider it for the future development of the two controls. Due to the tight schedule we will not be able to include this grouping to the next release, but we will surely have it in mind for some of the future releases.

As per the minification - our scripts are already minified by using the Dojo compressor. As I said, the only thing we didn't add was the removal of several newlines we found unnecessary. I am not sure on the YSlow validation procedure, but I suppose it is these newlines that make it report our scripts as non-minified.

Best regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shane
Top achievements
Rank 1
answered on 18 Jan 2008, 12:55 PM
Hi Erjan,

Thanks for the consideration.and I understand you in tight schedule for the next release.

The scripts are Minified except some some are with newlines as you pointed out here. As I mentioned previously, it is not in higher priority :)

Good Luck :)

Cheers,
Shane
Tags
General Discussions
Asked by
Shane
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Shane
Top achievements
Rank 1
Share this question
or