₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,415 members, 8,421,818 topics. Date: Sunday, 07 June 2026 at 06:15 AM

Toggle theme

Official Release Of Bucketjs Library Version 0.1.0 - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersOfficial Release Of Bucketjs Library Version 0.1.0 (489 Views)

1 Reply (Go Down)

Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(op): 11:16am On Sep 03, 2016
I'm happy to release the first official release of the BucketJS library version 0.1.0.
The aim of the library is to implement namespacing system which is present in languages like c++, php and so on. I hope you guys can help embrace it and improving.
Because having a class or context per file makes you more organized and its always easy to amend errors since you know the class having fault, you just go straight to file to fix it.

I will be more happy if you all can embrace the concept. behind the library. I will like you all to give your comments for that's what help in improving the library.


# BucketJS Library
* it tries to help you make your codes well organised i.e. a class per file
...* var control = Bucket('App/Core/Controller') matches app/core/controller.js file in the base directory.
...* Bucket(['App/Game'], function(){
this.init = function(){
console.log('game started');
}
}); // matches www/app/game.js
...* you will find some examples below
* trying to implement Namespacing in the other languages
* Include the src/Bucket.js file in your page and you are set to use it.
* The dist directory consists of the different aspects implemented into the library

it is very simple to use
/**
* the files are fetched from a default folder App e.g. www/app, www/js/app
* you can also set the base directory where the app folder is
* e.g. Bucket({fetch: true, base: js/app/});
* it will fetch the files from www/js/app directory
*/

// to define a class, the classname must match the path to the file
// file: www/app/core/hello.js
Bucket(['App/Core/Hello'], function(){
this.call = function(){
alert('hello world');
}
});

// file: www/index.html including the library
// to get the instantiated copy
var hello = Bucket('App/Core/Hello');
hello.call(); // 'hello world'

/**
* defining a class with dependencies to other classes
* a class can have as many dependencies as possible but they will all
* be passed as parameters in the order they were declared to the class depending on them.
* if a dependency depends on another class they all get passed for the library
* is smart enough to sort that.
*/
// file: www/app/core/welcome.js

Bucket(['App/Core/Welcome', ['App/Core/Hello', 'App/Core/Bye']], function(hello, bye){
// the hello param will be an object of App\Core\Hello::class
this.welcome = function(){
hello.call();
}

this.bye = function(){
bye.bye();
}
});

// file; www/app/core/bye.js
Bucket(['App/Core/Bye'], function(){
this.bye = function(){
alert('Thank you for trying me out. Courtesy: BucketJS');
}
});

// file: www/index.html including the library
// to get the instantiated copy
var app = Bucket('App/Core/Welcome');
app.welcome(); // => 'hello world'
app.bye() // => 'Thank you for trying me out. Courtesy: BucketJS'

composer: require heywhy/bucketjs
github link:
https//github.com/heywhy/BucketJS
Re: Official Release Of Bucketjs Library Version 0.1.0 by mokoshalb(m): 11:29am On Sep 03, 2016
impressive... will look into it later...
Re: Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(op): 11:51am On Sep 03, 2016
Thanks man wil really appreciate that
Re: Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(op): 11:58am On Sep 03, 2016
mokoshalb:
impressive... will look into it later...
Thanks man.
And please drop a review when you are done.
Re: Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(op): 12:35pm On Sep 03, 2016
when defining a class if 'App' is not part of the definition it assumes that the namespace is a subpath in tbe app directory. e.g
Bucket(['Core/Hello'], function(){
this.call = function(){
alert('hello');
}
});

defaults to App/Core/Hello.js, if 'App' was included it is omitted before requiring the file;

if a file has been require before it gets cached, while subsequent calls to file will be fetched from the cache instead of requesting it from the server, which can be an overkill.
1 Reply

After A Great Release Of Another ForumVersion 0.1.1 Of BUCKETJS Library Released234

Allow Me To Ask You This Simple Question....19 Dangerous Mistakes That Can Damage Your Freelance Writing CareerE-commerce Website