Git Product home page Git Product logo

laboratory's People

Contributors

marrus-sh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

laboratory's Issues

Liberate from localStorage

Right now the handler for LaboratoryAuthorizationGranted needs localStorage in order to do its work. We're already relying on local variables with recalledOrigin; why not ditch the localStorage dependency and use local variables for everything?

Labelled a bug because localStorage wasn't supposed to be a dependency.

Figure out authorization

On one hand, authorization is stored in localStorage so there's no use in trying to hide it from other scripts. On the other hand, firing events (for Clients at least) seems overkill.

stop the super sneaky valueOf demons

Sometimes valueOf gets called but you don't know that valueOf is getting called and a super sneaky demon has wriggled its way into the valueOf and now is running rampant inside your code. This is only an issue when dealing with semi-naïve privileged/non-privileged code boundaries but this is already what we have going on with Enumerals so.

Merge Failures

Having different failure events for each module doesn't make sense when they all do the exact same thing and you can check the module by looking at what the Failure is responding to. Bring them all under one tent as a "Failure" module even.

Dispatch events from constructors

I don't know why we should be thinking about this I just wrote - Events dispatched from within handlers on my sticky note so think about it, idk

Localization interface

I mean for programmers mostly because this is an API and not like, a client after all. But it'd be cool if stuff was variables and not strings and hey if we're doing that why not make some of those variables overwritable.

Don't declare functions inside of constructors

Right now Requests especially are guilty of this. Functions should be declared outside of constructors and then bound to their proper arguments inside. This may take a little work though.

Overwrite hasInstance??

In case #10 wasn't wild enough for you we can actually override hasInstance if we're not on IE. That's silly and weird but hey maybe if we're feeling rebellious

Add usage examples

To constructor pages at minimum, and maybe everywhere. I'm thinking a triumvirate of Usage, Examples, and Implementation here right now.

Meter event firing

Especially if #27 happens a lot of events will be fired and gosh that will be a ton to wade through if we're not metering them and removing duplicates in an orderly fashion. This would be some little bit of trickery through dispatch() and probably requestAnimationFrame or setTimeout or who knows.

`Promise`s for `Request`s

Of course, these aren't hard for people to write themselves, but a prototype method to make this easier might be useful.

Advanced relationship processing

Not sure if this should be done or not, but a "make unfollow" request might be useful. IDK if friend request confirmation can happen through the API but if it can that would be a plus too.

Add State to Requests

It'd be great to have a Request.State enumeral with the values

STOPPED: 0
RUNNING: 1

so that you can do eg do request.stop if request.state

Allow for following a remote user

This could be as simple as passing an account parameter to a SetFollow() request instead of an id.
I mean, the API request would be different, of course.

Don't assume responses have a compare function

Right now the requests for Post and whatnot kinda assume that any Post etc will have a compare function, but someone could hypothetically overwrite this value (why? don't ask me) with a non-function and then the code would break. Sad day.

Notification clearing ? -_-

idk how i feel about letting users just nuke their entire notification timelines but hey i guess its their feeds or whatever more power to them

Allow proliferation of status (& account?) types

If we're going to let extensions maybe create their own posts and accounts, then we should provide a mechanism for namespacing them in our Store so there aren't id conflicts. Obviously Symbols would work well for this but there might be a way to make it happen by registering Enumerals. Maybe in an array.

Event pipeline tagging

It'd be great if Laboratory.dispatch returned a numeric ID that could be verified against responses/errors. If we keep this all on our side then we can even guarantee uniqueness.

Post deletion responses and errors

Post deletion is one of those things where you kinda really wanna know if it went through or not. Mastodon isn't the best about this but we can at least check for that empty-object-response or whatever.

Make Timelines and Rolodexes better

Timelines and Rolodexes act like XMLHttpRequest() and they aren't designed to be shared, unlike most other Laboratory data. It would be better to have them return objects which are valid EventTargets if that is in any way possible, or spoof it somehow if it isn't.

Document Issues

all of these issues i'm writing should be documented in the code, yo

Support exports

ECMAScript 2015 exports might not ever be supported due to how CoffeeScript interacts with them, but a CommonJS exports object might be feasible. Look into it.

Rethink Request events

Right now Request events are tied to XMLHttpRequest but maybe they should be tied to Requests instead; cf #43 and who knows if they should be dispatched on the document or just the individual requests tbh.

Max line-length for code

Right now code gets unreadable af on Github.com since it doesn't do line-wrapping.
Get it more verbose and spread it tf out.

Local/global hashtag search

Apparently there aren't just local/global timelines, but also local/global hashtag timelines. Look into this.

Document API Spoofs

This should at least be mentioned somewhere apart from the forthcoming examples in 0.4

Conversation support

These can just be implemented as Timelines but at least implement them.
To go the extra mile provide advanced processing/linking in the Timeline constructor.

Combat naïvity of instanceof

This means maybe n = Object(n) instead of n instanceof Object and who even knows what with Arrays my goodness. And then with all our magic constructors… idk. Think of something.

Better follow request support

I actually don't know what the API gives us in terms of this. But at the very least it seems you should be able to do a follow-request rolodex, if that's helpful to anyone.

Let users specify OAuth popup window

If you know that there isn't a LaboratoryOAuth window open, you should be able to opt out of closing it when you call LaboratoryAuthorizationGranted. Otherwise

do (window.open "about:blank", "LaboratoryOAuth").close

will open and close a window unnecessarily.

Shorthand for current events in source

yeah yeah this isn't really necessary but writing "LaboratorySomeEvent" 50 bajillion times is boring and what if the event name changes and so on. It'd be cool if there was just a keyword that just always referred to the current event or whatever. You'd probably have to do some magic in dispatch to make this happen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.