Thanks for bringing this up here, Nick!

----- Original Message -----
> From: "Nick Alexander" <[email protected]>
> To: "mobile-firefox-dev" <[email protected]>
> Sent: Saturday, 13 September, 2014 8:47:16 PM
> Subject: Questions about dspec
> 
> Hey y'all,
> 
> Our very own lucasr has built a cool thing called dspec.  You can read
> lucasr's words at http://lucasr.org/2014/09/08/introducing-dspec/, but
> in a nut-shell it's an Android library that renders certain design
> invariants (like margins and baselines) on top of Android Views.
> 
> lucasr's post has a call to action to use dspec to help Firefox for
> Android development.  I'd like to help by getting it building for
> developers, but there are a few questions that I'd like to get some
> feedback on first.
> 
> 1) How do you enable it?
> 
> Rendering the design spec requires modifying either a View's onDraw
> method or adding a DesignSpecFrameLayout somewhere into the view
> hierarchy.  It's the kind of thing that you either bake in and disable
> until you want it, or you add only during development.  Making changes
> like this only during development is a great way to make sure a tool
> isn't available when you want it.
> 
> 2) Is this a thing that's only available on developer builds?  In
> Nightly (debug) builds?  More generally?
> 
> We have a lot of freedom here, but shipping debug code up to release is
> not a good idea; and shipping different view hierarchies for different
> configurations is likely to cause future pain.  Also, be aware that
> Proguard is a harsh master and will strip anything that's not being used
> or explicitly annotated as important.
> 
> My ask: can folks suggest a technical path towards making dspec a part
> of our application, available when we want it, but not always shipped?
> I imagine lucasr has a model in mind, but I can't think of another
> Android library or tool that pulls this off.

The rough plan I had in mind was: create a jar that only contains 'dev tools' 
code. Namely, we start with:
- ViewServer (https://github.com/romainguy/ViewServer) - So that we can use 
Hierarchy Viewer with Fennec.
- dspec (https://github.com/lucasr/dspec) - So that we can show specs whenever 
we need it while changing UI code.
- proble (https://github.com/lucasr/probe/) - So that we can run interceptors 
to debug layout behaviour.

This jar would only be used on local builds. In other words, I think it's fine 
(for now, anyway) to just have them readily available in a local build so that 
we can easily use them. No need to go further and integrate them by default. 

ViewServer might be an easy one to have in code by default as it's just a 
single java class that you use in the main activity i.e. easy to disable. 

Thoughts?
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to