Creating My Own JS LIbrary

Intro

I’ve decided to make a JavaScript library, unlike jQuery, it’s not gonna have an endless number of functions and features. I plan on making a more lightweight alternative to jQuery, purely because jQuery does not seem to perform all that well on mobile devices, and after talking to many web developers, they agree, it’s about time someone made something that’s a bit more lightweight. Well I thought why not give it a go?

My Project

I’ve recently created an ‘Alpha’ version, earlier today if anything, if you take a look at my git account, you’ll see that I uploaded the files only moments ago. I think it already has a couple of neat little features and functions that are both reliable and fast.

ToolKit JS

I decided to name it ToolKit JS because that’s what it’s meant to be, a series of tools for developers to use for both, developing and deploying their web based applications. It’s currently far from finished, I mean it needs a tonne of work, however, I’m looking for suggestions as to what I could include in this JS?

So what do you think this library should include?

  • Custom/Draggable UI
  • Admin UI
  • Charts
  • 3D Stuff
  • Google Maps Features (Have something interesting in mind)
  • Other - If other, please comment.

0 voters

Encase you want to view the source code, here’s a link to my repository: https://github.com/Argonaxe/ToolKit-JS


Update

I thought that I’d post an update here, I’ve decided to actually strip back the core of this library to being full of small and quite powerful tools. If you’d like to know what it will contain, I’ve decided to include the following within this library, I’ve also decided to say:

Screw anything older than IE10! YAY! :smiley:

Featuring

  • AJAX
  • Multi Threading
  • Object Query Script
  • Template Engine
  • Promises
  • Asynchronous Features
  • Utils
    • DOM Selector
    • Event Handling
    • Basic Object Manipulation
    • etc…

Why the change?

I think that with my original idea(s) it would’ve consisted of a few too many features that people will probably want to build specifically to their own application. Features such as predefined data structures, half the time with JavaScript you can just use something like an object which essentially acts like an associative array and if I’m not mistaken the lookup time for a value with an object in JavaScript is O(1).

The same said for the lazy loading feature that I built, some people may want animation included, etc. Mine was as simple as:

A) Image not in view? - Don’t load
B) Image is in view? - Load

There was no subtle feature to make it better when considering the UX of the application.

What about charts?

Charts area great and all, but there’s just soooooo many options to choose from already, even if I did create something neat, it probably wouldn’t be better than the solutions that exist right now.

What’s Object Query Script?

It’s simple, it’s essentially a small tool that you can use to query an array of JavaScript objects, typically just value objects, an example being a collection of user records. You could load ‘x’ amount into the DOM and then run a query so that it doesn’t require another HTTP request, if you have data on the client’s device, this may be ab ideal way to run queries if the device is off line. The only major difference would be that the content within the local storage may not be totally up to date, and of course you may be lacking in images too, but it isn’t designed to cater for storing images onto a user’s device or whatever.

2 Likes

As someone who wants to make their own crypto market tracker, charts would be cool.

1 Like

Consider it done!

I’ve thought about making something similar, I’ve thought about building something that looks like an admin console that updates in real time. Making the charts move, change and mutate as much as necessary, etc, I was previously working on making a chart where it can use stuff like gradient backgrounds for the bars and what not, but that project got a bit messy, I need to re-think that one… Lol… But the foundations for it, they already work fine, I just need to make it more vague, so you can make different types of charts, and maybe have a combination of charts together… Etc…

I mean if you’re after a quick solution that’s not so lightweight, I’d personally recommend ChartJS, but to be fair, when I say it’s not that lightweight, it does kinda have to meet that one fits all kinda solutions… Just like jQuery… In all fairness, although I’m not a fan of using jQuery (performance mostly), it does have to have a tonne of functionality and a tonne of functionality that works across a huge range of platforms.

I would like a to code in a visual representation of a web hook of when to buy/sell for different market strategies. End goal of course being a bot.

1 Like

Reading through your Github page, I would say documentation is very valuable. I would also really focus on 1 thing to start with. In this case, I would request charts. Back to documentation, I would look at Vue or Symfony documentation that walk you through each method or function or feature and you are literally building something while you do it. Also an extremely clear point by point menu/table of contents for people that just want to click around. If you are at all serious about this (even for just a resume builder), I can not stress enough documentation.

1 Like

Yeah, I’m MOSTLY using this documentation scheme for myself at this moment in time, I’ll actually try to make it nicer, more readable, etc once I’ve included more features, I mean it wouldn’t exactly be hard to replace documentation, considering even if I forget what ‘x’ piece of code does, there’s already some notes there for me! :slight_smile:

Question

While I’ve practically already implemented a chart like feature (not yet released to the public :joy:) … One thing I’m trying to implement is like a cheat… One thing I’ve been trying to implement the classic PHP $_POST feature. I mean $_GET is p**s easy to implement, but the $_POST, not quite as easy… BUTT… With that said, I may have a trick or two up my sleeve, BUT for me to be able to test it, I’m gonna have to create another test file or so… I don’t like making things too easy for myself… :wink:


Edit: Forgot to actually put the question.

What do you think of a feature like this?

I’m only trying to implement a feature like this for people who I’ve actually worked for, they didn’t have access to the back end, it was all out sourced, they couldn’t even breath on the backend, lol… However, I noticed that because I couldn’t access the backend, it made life incredibly fuing awkward, the back end devs were also a holes, they wouldn’t implement a simple feature without trying to rape the company for every penny possible. I mean I remember they wanted to charge like £3,000 for adding an additional form input field… Sure, worst case scenario they’d have to re-structure the submission page, tweak a query… But £3,000 is a bit over the top for something as small as that… Worst part… This company that’s doing all the back end, they’re clearly GOD AWFUL at writing performance efficient queries… For a simple product page to load, worst case, 45 seconds… It actually annoys the crap outta me to be perfectly honest…

Progress

I’ve already added a couple of generic and neat little features, I’ve also got around to encapsulating everything into one large object. So far, we’re looking at about 1600 lines of code, considering the number of neat little gadgets that are offered straight outta the box, I don’t think that’s too bad? Sure it may not be great, but then again, that is still while it’s beautified and it still has all of the lines of documentation…

I’d say for version 0.0.2, I’m about 45% of the way there, I’ve started the XHR object which I’ve named TKHI (ToolKit HTTP Interactions). I’ve also begun the animation object too, the only thing I’ve failed to start making is the graph data structure, but I’m wondering how far I should go with that… I’m wondering if I should make a pretty basic graph, or one that implements a wide range of searching/sorting algorithms, etc… I think I’ll do what I’ve done with the tree data structure, make a pretty basic one to start with, and if I think it could do with more functionality, implement further options/features/algorithms.

… That reminds me, talking about the tree, I also need to implement a balanced tree… :joy: … This should be fun!

I haven’t ever used this, but do you mean something like this: https://www.w3schools.com/jquery/ajax_post.asp ?

Not quite… That’s just a matter of posting data to an external file, I mean implementing a way of recording what data has been posted to this current file… I’m not sure I explained that in the best of terms… But basically create an object which gets the data of all data that’s sent to the current file… I’m not 100% sure it’s possible…

BUT I’m gonna try anyway!

I’m not sure JS can access what files/forms/data has been submitted to the currently open document or not… Like I said, I’m gonna give it a go anyway… I fail to see it being impossible, maybe somewhat annoying or awkward to implement… But impossible, idk…

Sounds like you need some sort of a Node stack. But I think you said that you do not in fact have access to the back end server?

Exactly! It’s a bit of a weird one, the only logical thing that makes any sense to me is building some peer-peer js stuff that can be done without a server, I mean I’ve looked into things like RTCPeerConnection, but that alone doesn’t work solidly without a browser, nor does it work in IE9! Great! :smiley: … Haha, I think I’m probably going a little over board with the features available??? …

I’ve even built a VERY basic encryption part to the library, I was thinking about protecting user’s cookies from basic XSS attempts. But the concept is that you’d wanna save the key somewhere/somehow, then reuse it… But you’d wanna save this key where the attacker can’t get their hands on it… Lol… The implementation is far from bullet proof, but it’s a good learning curve…

I mean I’ve gone into stuff like actually going from binary to hex to ASCII codes back to string and vice versa, while manipulating the data, then reverse engineering what I’ve done, it’s somewhat different, I’ve taken a shortcut just so it works, although I do plan to revise it so that it works more efficiently! … Etc…

I hope you guys like the update!