Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,066 members, 7,828,772 topics. Date: Wednesday, 15 May 2024 at 01:55 PM

Official Release Of Bucketjs Library Version 0.1.0 - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Official Release Of Bucketjs Library Version 0.1.0 (377 Views)

After A Great Release Of Another Forum / Version 0.1.1 Of BUCKETJS Library Released (2) (3) (4)

(1) (Reply) (Go Down)

Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(m): 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(m): 11:51am On Sep 03, 2016
Thanks man wil really appreciate that
Re: Official Release Of Bucketjs Library Version 0.1.0 by heywhy824(m): 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(m): 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)

Kindly Help Suggest A New Domain Name To This Forum / Nigerian News Website For Sale(own Your Own News Website That Runs On Autopilot) / Non Hosted Nigerian Adsense For Sale

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.