Skip to content

Instantly share code, notes, and snippets.

@pfrazee
Last active December 16, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfrazee/5436436 to your computer and use it in GitHub Desktop.
Save pfrazee/5436436 to your computer and use it in GitHub Desktop.
should I unify the namespace?

When I started on Local, it wasn't clear what all was needed -- originally, it was just the LinkJS project. Then I had to make a Worker manager: MyHouse. Then I had to create client behaviors: CommonClient. Not to mention the promises lib and the couple of prototypes that Local added under the Environment namespace. So now, here's a quick overview of what's getting used in a Local deployment:

Local.Promise // yeah, the ONE thing under the Local namespace. Brilliant.
Link.dispatch()
Link.subscribe()
Link.Navigator
Link.Router
Link.Responder
Link.Headerer // it...helps you build response headers
Environment.addServer()
Environment.getClient()

// and, more behind the scenes:
CommonClient.listen()
MyHouse.Sandbox

So that's kind of all over the place. In Local 0.2.0, I had them each in submodules. In Local 0.3.0, only the promises are embedded. I'm thinking I should take the opportunity (while I can) to unify the namespace, like so:

local.Promise
local.http.dispatch()
local.http.subscribe()
local.http.Navigator
local.http.Router
local.http.Responder
local.http.Headerer
local.env.addServer()
local.env.getClient()
local.client.listen()
local.Worker

Worth making the switch? Thoughts on the new namespaces?

@jrf0110
Copy link

jrf0110 commented Apr 22, 2013

++ On the Namespace.

@jrf0110
Copy link

jrf0110 commented Apr 22, 2013

Though if you were using module loading and dependency injection, wouldn't matter :D

@pfrazee
Copy link
Author

pfrazee commented Apr 22, 2013

Nah, I prefer not to have the requirejs module pattern, especiall when Workers -- where most grim users will live -- already have an injection system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment