Page 1 of 1

idea easy Plugin Respository

PostPosted: Thu Jan 22, 2009 3:14 pm
by daKmoR
This is just an idea I had.
I think this would dramatically reduce all the questions users have. It's a Plugin Repository that should help people to use Plugins from different users.
There is no more need to manually include all the files (css, dependencies, images...). This should all be done by the plugin itself.

It's maybe best to see the Screencast.

What do you think about this idea?

Re: idea easy Plugin Respository

PostPosted: Thu Jan 22, 2009 3:46 pm
by cfenzo
I like the idea.
Any more info you can share on how you picture the plugin syntax for setting required files and modules/plugins?

Re: idea easy Plugin Respository

PostPosted: Thu Jan 22, 2009 4:01 pm
by horseweapon
I think there is already an official plugin repository in progress, digitarald is working on it. But still, I like the idea. Oh and thank yhou for using myh plugins :)
I've been working on the new gallery btw, still need to fix a few things, but I will release soon I hope. Actually, I have like four or five plugins ready to update

Re: idea easy Plugin Respository

PostPosted: Fri Jan 23, 2009 1:59 am
by daKmoR
ok, it seems like I need to explain all this a little bit better as some people misunderstood me.
  • All you saw in the Screencast is for development only
  • It's main purpose is aid MooTools Users to easily develop sites without the need to include multiple files by themselves into the header
  • MPR (MooTools Plugin Repository) is just a dummy name, as I'm not creative enough to come up with a nice name
Something like this would be my ultimate solution.

1) DEVELOPMENT
In the header part of the HTML File you only need to include TWO file,

  1. File: a minimal core + some functions for the Repository. Remember all the files for the Repository will resist on your local Test-Server in a directory you can choose.
  2. File: an autocreated file from the Repository that only contains dummy classes and dummy functions and it's only purpose is to help you get the right files into your local Repository.
Example of an local Repository wrote:index.html
MPR/Core/Utilities/Cookie/Cookie.js
MPR/More/Fx.Elements/Fx.Elements.js
MPR/More/Fx.Scroll/Fx.Scroll.js
MPR/Galleries/UvumiGallery/UvumiGallery.js
MPR/Galleries/UvumiGallery/UvumiGallery.css
MPR/Galleries/UvumiGallery/img/ajax-loader.gif
MPR/Galleries/UvumiGallery/img/redx.gif
...


The path for MPR can be anything like "mySecret/Folder/" it just needs to be defined.
As you can see there are some Plugins that need more than just one file, so every Plugin get it's own folder.
If it's done right I think even some parts of the MooTools Core can be "exported" to Plugins.
It's just like on the github only that every file get it's own Folder (as every file is ultimately seen as an Plugin)

So what you get is a bunch of files that are not loaded and a really small core that is only capable of loading new Plugins.
After you include your first Plugin for Example UvumiGallery it will load Fx.Element which will also load some core files so you have a bunch of Request.
But hey it's your local TestServer so it shouldn't matter. Once you finished all you work and you know that everything is working - go on to the next step.
(you can of course use a more advanced core or even some plugin included in this core file, thoses files won't be loaded again)

2) PRODUCTIVE
Your working code uses some $require and there are a lot more of it in all the Plugins you use.
So you got to a special page on MPR and just give it your url. Due to all the $require in the code it's easy to find out what files you really need.
A script scans to your code and all the files that are required. So finally you get a list of files you really need.

Example wrote:Javascript:
MPR/Core/some Core Plugins
MPR/More/Fx.Elements/Fx.Elements.js
MPR/More/Fx.Scroll/Fx.Scroll.js
MPR/Galleries/UvumiGallery/UvumiGallery.js
...

CSS:
MPR/Galleries/UvumiGallery/UvumiGallery.css
MPR/UI/Milkbox/Milkbox.css
...

Images:
MPR/Galleries/UvumiGallery/img/ajax-loader.gif
MPR/Galleries/UvumiGallery/img/redx.gif
MPR/UI/Milkbox/img/borders.gif
...


So what the script can do you for you is:
  • create ONE single javascript file for you to include into your page
  • maybe even make one single file for all the css you need
  • a zip file for all images you need with the right folder structure (or just in one Folder?)
  • or create ONE single zip file you just need to extract to your Server and you are DONE.
Most of the time you might need different Plugins for different page but still need some Plugins for all pages,
then you can just split it up to one basefile and one file for each individual page.
I think there are many ways to deal with that (include one big file and hope for the browser cache, or split
it up to individual files (some are included once others are always included))
be creative, just said the MPR won't help you with that but it also won't forces you to do anything.

CONCLUSION

So what do we get with all this.
  • It's way easier to develop
  • you can just use all the Plugins, if you don't have it's easy to download and include
  • you always get all the files (forget missing images, or css files)
  • still just one file to include in PRODUCTIVE

EVEN FURTHER THOUGHTS

1) Repository Plugin Registration
You will need to register a plugins class name if you want to check it into the Repository
You can also register Element.implement function names (and for every other implement or extend)
[so you basically give a name and say if the plugin is a class or an Element.implement or an Asset.extend ...

2) use it with an CMS
You can include the "get the needed files script" into an CMS so people don't need to worry about anything.
So the CMS can have it's own local Repository of available scripts and new Plugins can easily downloaded within the Backend of the CMS.

3) a Plugin isn't just plain js
as every Plugin is in it's own folder you can just do more.
Maybe have a doku or demo folder within the Plugin and these files will be automatically parsed and showed on the MPR page.
So with every Package or Plugin you can have your own doku and demo. They will have a unified format so new plugins will be easier to explore.

4) Versioning
We could use git for all this. So people could just push to it. If there is a tag MPRv1.0 then it will be published to the MPR as "Version 1.0".
You could easily allow to see multiple versions of the script just show every tag with "MPRvx.x".
The current development or master or whatever version won't be visible on the MPR page but people who know the right url will still be able to
work together on this.
But people should also be able to just upload zip files.
one upload = one new version
I don't know if there is any other easier/better way for Versioning so help me out on this. (or if my idea with git won't be possible [I'm definitely no git pro])


Theses are just my thought about a really nice Repository and I think it would really help a lot of people. How would it affect your work with MooTools?

Re: idea easy Plugin Respository

PostPosted: Wed Feb 04, 2009 2:42 am
by daKmoR
ok here we go again...

a little update, now we can use a php script to automatically include all Plugin files with ONE script tag and ONE css tag.
It's just great...

I just opened a blog - so I can just talk freely about this and other stuff I'm interested in.
Just have a look: http://www.delusionworld.com/mootools/m ... on-part-2/