← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~rharding/launchpad/productjs into lp:launchpad

 

I couldn't land this due to a timeout error when running the test suite on ec2. Deryck found that flattening the namespace allowed the tests to pass.

In order to keep some structure, but with a smaller namespace, I've tried to setup a standard that drops the lp. since that's just something all our code has. It does mean we have to watch for collisions with the raw YUI library, but that's well documented.

What I am going for is a nesting based on the 'type' of code in question. In this case, I'm writing up code for an html view. This might have also been a model, utils, etc. 

I also didn't nest within the registry namespace by doing registry.product. Instead, the name of the module is registry_product. In this way, there can be many modules that add code to the views.registry namespace. This module adds a class NewProduct. So the full name is Y.views.registry.NewProduct. I like that a lot better than the previous Y.lp.registry.product.views.New. 

If there was a model that went with this to be used, it would be in Y.models.registry.Product. This takes us from 5 levels deep to 3 for most use cases I can think of and tries to keep it there.
-- 
https://code.launchpad.net/~rharding/launchpad/productjs/+merge/123803
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References