Proposal looks good to me.
I'd be interested in knowing same things as Matt and Jeremy:
- Integration with JDocument.
I'd research options to automatically compress all assets when using
solely native methods $this->document->addStylesheet('/styles.css').
There would be switch in Joomla global configuration (compression on/
off, ratio, exlcusions, etc). This way compression would be
transparent and available for extensions without changes in code.
You can also take a look at JHtml::script and JHtml::stylesheet which
are more intelligent wrappers for addScript and addStylesheet.
As for non-platform ways to add assets (manually using script and link
tags in template), I guess It's worth to make a small research if it
does make sense to bother at all.
I mean, when developer opts to add assets this way, this theoretically
means that he/she has some reasons to go around native methods (ie.
loading assets asynchronously with js loader like require.js or
labjs).
What I've usually seen is simply the convenience of using familiar
html way over framework methods but well, in my opinion this is wrong.
It would be nice to have an option to load javascript files at the
bottom of html, but then there is a risk that developer may include js
code inline in template html which is dependent on some libraries.
- As for caching,
I've managed to integrate Minify (
http://code.google.com/p/minify/) as
a Joomla library. Seems like caching is pretty decent there (caching
files based on required files and proper header responses).
This is quite interesting project and in my opinion Joomla was missing
this functionality for long time. There were few attempts but I had
problem with each.
I think you are doing well so far.
On Apr 4, 6:16 pm, kavith Thiranga <
rc404m...@gmail.com> wrote:
> Hi Matt,
>
> First of all, thank you very much for your feedback. I will clarify my
> ideas regarding your points.
>
> - I am thinking of cashing the files as it will increase the
> performance, But I haven't yet come up with a plan on doing it.
> - Yes. This library allows excluding files as my plan is to give the
> > - What are your thoughts on caching the combined/minified files?
> > - Would this library allow for excluding files from the
> > combination/minification?
> > - Would this library support the developer to indicate the order of
> > files when combined/minified?
> > - Would you only combine/minify files that use JDocument, or would you
> > also search for files that use <link> and <script> tags? For example, see
> > lines 37 - 40 of
> >
https://github.com/joomla/joomla-cms/blob/master/templates/beez_20/in...
>
> > These are not requirements, or changes that you need to make, but a few
> > thoughts that came to mind.
>
> > Also, you may want to look athttp://
jproven.com/extensions/jbetoloand
> >
http://blank.vc/as they have some of these features in them. Their code
> > may inspire something within yours.
>
> > I hope that helps.
>
> > Best,
>
> > Matt Thomas
> > Founder betweenbrain <
http://betweenbrain.com/>™
> > Lead Developer Construct Template Development Framework<
http://construct-framework.com/>